diff -r 3f1ef7f899ea -r 1c130e7b7a2e make/common/Defs.gmk --- a/make/common/Defs.gmk Tue Sep 01 23:44:41 2009 +0100 +++ b/make/common/Defs.gmk Wed Sep 02 09:20:17 2009 -0700 @@ -1,5 +1,5 @@ # -# Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved. +# Copyright 1995-2009 Sun Microsystems, Inc. All Rights Reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -310,125 +310,32 @@ SUBDIRS_MAKEFLAGS-clobber = INCREMENTAL_BUILD=false SUBDIRS_MAKEFLAGS-clean = INCREMENTAL_BUILD=false -# Current directory -CURRENT_DIRECTORY := $(shell $(PWD)) - -# If no timing wanted, we need to define these as empty -ifdef NO_TIMING - -TIMING_ID:=NA - -define TIMING_start -t=0:0:0:0 -endef - -define TIMING_end -time_used=0 -endef - -else # NO_TIMING - -# Default timing id -TIMING_ID:=$(shell $(BASENAME) $(CURRENT_DIRECTORY)) - -# Timing start (must be used in same shell, e.g. same command line) -# Defines the shell variable $1 to have the start time. -define TIMING_start -$1=`$(DATE) +%j:%H:%M:%S` -endef - -# Timing end (must be used in same shell, e.g. same command line) -# Expects shell variable $1 to have been defined as the start time. -# Expects shell variable $2 to have timing id string -# Sets total_seconds shell variable as the total seconds used. -# Sets time_used shell variable to contain format "%dh%dm%ds" -define TIMING_end -begTime="$${$1}"; \ -timing_id="$${$2}"; \ -endTime=`$(DATE) +%j:%H:%M:%S`; \ -d1=`$(ECHO) $${begTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \ -if [ "$${d1}" = "" ] ; then d1=0; fi; \ -h1=`$(ECHO) $${begTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \ -if [ "$${h1}" = "" ] ; then h1=0; fi; \ -m1=`$(ECHO) $${begTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \ -if [ "$${m1}" = "" ] ; then m1=0; fi; \ -s1=`$(ECHO) $${begTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \ -if [ "$${s1}" = "" ] ; then s1=0; fi; \ -d2=`$(ECHO) $${endTime} | $(CUT) -d':' -f1 | $(SED) -e 's@^0*@@'`; \ -if [ "$${d2}" = "" ] ; then d2=0; fi; \ -h2=`$(ECHO) $${endTime} | $(CUT) -d':' -f2 | $(SED) -e 's@^0*@@'`; \ -if [ "$${h2}" = "" ] ; then h2=0; fi; \ -m2=`$(ECHO) $${endTime} | $(CUT) -d':' -f3 | $(SED) -e 's@^0*@@'`; \ -if [ "$${m2}" = "" ] ; then m2=0; fi; \ -s2=`$(ECHO) $${endTime} | $(CUT) -d':' -f4 | $(SED) -e 's@^0*@@'`; \ -if [ "$${s2}" = "" ] ; then s2=0; fi; \ -t1_secs=`$(EXPR) $${d1} '*' 60 '*' 60 '*' 24 '+' $${h1} '*' 60 '*' 60 \ - '+' $${m1} '*' 60 '+' $${s1}`; \ -t2_secs=`$(EXPR) $${d2} '*' 60 '*' 60 '*' 24 '+' $${h2} '*' 60 '*' 60 \ - '+' $${m2} '*' 60 '+' $${s2}`; \ -total_seconds=`$(EXPR) $${t2_secs} '-' $${t1_secs}`; \ -if [ "$${total_seconds}" -lt 0 ] ; then total_seconds=0; fi; \ -t_hour=`$(EXPR) $${total_seconds} '/' '(' 60 '*' 60 ')'`h; \ -t_min=`$(EXPR) '(' $${total_seconds} '%' '(' 60 '*' 60 ')' ')' '/' 60`m; \ -t_sec=`$(EXPR) $${total_seconds} '%' 60`s; \ -time_used=$${t_sec}; \ -if [ "$${t_hour}" != "0h" ] ; then \ -time_used=$${t_hour}$${t_min}$${t_sec}; \ -elif [ "$${t_min}" != "0m" ] ; then \ -time_used=$${t_min}$${t_sec}; \ -else \ -time_used=$${t_sec}; \ -fi; \ -$(PRINTF) " Timing: %05d seconds or %s for %s\n" \ - $${total_seconds} $${time_used} $${timing_id} -endef - -endif # NO_TIMING - # Given a SUBDIRS list, cd into them and make them # SUBDIRS_MAKEFLAGS Make settings for a subdir make # SUBDIRS_MAKEFLAGS-$@ Make settings specific to this target define SUBDIRS-loop -@$(ECHO) "Begin Processing SUBDIRS: $(SUBDIRS)" @for i in DUMMY $(SUBDIRS) ; do \ if [ "$$i" != "DUMMY" ] ; then \ - $(ECHO) ">>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \ - timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \ - $(call TIMING_start,startTime); \ - curDir=$(CURRENT_DIRECTORY); \ - $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \ - $(SUBDIRS_MAKEFLAGS) \ - $(SUBDIRS_MAKEFLAGS-$@) \ - FULL_VERSION=$(FULL_VERSION) \ - RELEASE=$(RELEASE) || exit 1; \ - $(CD) $${curDir}; \ - $(call TIMING_end,startTime,timing_id); \ - $(ECHO) "<<>>Recursively making "$$i" "$@" @ `$(DATE)` ..."; \ - timing_id="$(TIMING_ID)-`$(BASENAME) $${i}`"; \ - $(call TIMING_start,startTime); \ - curDir=$(CURRENT_DIRECTORY); \ - $(CD) $$i; $(MAKE) $@ TIMING_ID=$${timing_id} \ - $(OTHERSUBDIRS_MAKEFLAGS) \ - FULL_VERSION=$(FULL_VERSION) \ - RELEASE=$(RELEASE) || exit 1; \ - $(CD) $${curDir}; \ - $(call TIMING_end,startTime,timing_id); \ - $(ECHO) "<<> $(WARNING_FILE) - @$(ECHO) " This file may be from an unresolved Teamware conflict." >> $(WARNING_FILE) - @$(ECHO) " This is also a symptom of a Teamware bringover/putback failure" >> $(WARNING_FILE) - @$(ECHO) " in which SCCS files are updated but not checked out." >> $(WARNING_FILE) - @$(ECHO) " Check for other out of date files in your workspace." >> $(WARNING_FILE) - @$(ECHO) "" >> $(WARNING_FILE) - @#exit 666 - +# Make sure we are all insane ifdef INSANE export INSANE endif -ifdef ALT_COPYRIGHT_YEAR - COPYRIGHT_YEAR = $(ALT_COPYRIGHT_YEAR) -else - COPYRIGHT_YEAR = $(shell $(DATE) '+%Y') +# Make sure we have the current year +ifndef COPYRIGHT_YEAR + ifdef ALT_COPYRIGHT_YEAR + COPYRIGHT_YEAR := $(ALT_COPYRIGHT_YEAR) + else + COPYRIGHT_YEAR := $(shell $(DATE) '+%Y') + endif + export COPYRIGHT_YEAR endif # Install of imported file (JDK_IMPORT_PATH, or some other external location)