Makefile

changeset 313
a1c8b847b753
parent 291
24900a58ab9f
child 317
c6f380693342
     1.1 --- a/Makefile	Thu Feb 24 15:15:45 2011 -0800
     1.2 +++ b/Makefile	Mon Feb 28 10:56:10 2011 +0100
     1.3 @@ -36,12 +36,6 @@
     1.4    JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
     1.5  endif
     1.6  
     1.7 -# For start and finish echo lines
     1.8 -TITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE)
     1.9 -DATE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'`
    1.10 -START_ECHO  = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)"
    1.11 -FINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)"
    1.12 -
    1.13  default: all
    1.14  
    1.15  include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
    1.16 @@ -57,10 +51,6 @@
    1.17  include ./make/sponsors-rules.gmk
    1.18  include ./make/deploy-rules.gmk
    1.19  
    1.20 -# What "all" means
    1.21 -all::
    1.22 -	@$(START_ECHO)
    1.23 -
    1.24  all:: sanity
    1.25  
    1.26  ifeq ($(SKIP_FASTDEBUG_BUILD), false)
    1.27 @@ -73,40 +63,42 @@
    1.28  
    1.29  all:: all_product_build 
    1.30  
    1.31 -all:: 
    1.32 -	@$(FINISH_ECHO)
    1.33 +# Everything for a full product build
    1.34 +ifeq ($(SKIP_PRODUCT_BUILD), false)
    1.35  
    1.36 -# Everything for a full product build
    1.37 -all_product_build::
    1.38 -	@$(START_ECHO)
    1.39 -
    1.40 -ifeq ($(SKIP_PRODUCT_BUILD), false)
    1.41 -  
    1.42    all_product_build:: product_build
    1.43  
    1.44    ifeq ($(BUILD_INSTALL), true)
    1.45      all_product_build:: $(INSTALL)
    1.46      clobber:: install-clobber
    1.47    endif
    1.48 -  
    1.49 +
    1.50    ifeq ($(BUILD_SPONSORS), true)
    1.51      all_product_build:: $(SPONSORS)
    1.52      clobber:: sponsors-clobber
    1.53    endif
    1.54 -  
    1.55 +
    1.56    ifneq ($(SKIP_COMPARE_IMAGES), true)
    1.57      all_product_build:: compare-image
    1.58    endif
    1.59  
    1.60  endif
    1.61  
    1.62 -all_product_build:: 
    1.63 -	@$(FINISH_ECHO)
    1.64 +define StartTimer
    1.65 +	$(MKDIR) -p $(BUILDTIMESDIR)
    1.66 +	$(RM) $(BUILDTIMESDIR)/build_time_*
    1.67 +	$(call RecordStartTime,TOTAL)
    1.68 +endef
    1.69 +
    1.70 +define StopTimer
    1.71 +	$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
    1.72 +endef
    1.73  
    1.74  # Generic build of basic repo series
    1.75  generic_build_repo_series::
    1.76  	$(MKDIR) -p $(OUTPUTDIR)
    1.77  	$(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
    1.78 +	@$(call StartTimer)
    1.79  
    1.80  ifeq ($(BUILD_LANGTOOLS), true)
    1.81    generic_build_repo_series:: langtools
    1.82 @@ -143,6 +135,9 @@
    1.83    clobber:: deploy-clobber
    1.84  endif
    1.85  
    1.86 +generic_build_repo_series::
    1.87 +	@$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
    1.88 +
    1.89  # The debug build, fastdebug or debug. Needs special handling.
    1.90  #  Note that debug builds do NOT do INSTALL steps, but must be done
    1.91  #  after the product build and before the INSTALL step of the product build.
    1.92 @@ -167,28 +162,22 @@
    1.93  FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
    1.94    
    1.95  create_fresh_product_bootdir: FRC
    1.96 -	@$(START_ECHO)
    1.97  	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
    1.98  		GENERATE_DOCS=false \
    1.99  		BOOT_CYCLE_SETTINGS= \
   1.100  		build_product_image
   1.101 -	@$(FINISH_ECHO)
   1.102  
   1.103  create_fresh_debug_bootdir: FRC
   1.104 -	@$(START_ECHO)
   1.105  	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
   1.106  		GENERATE_DOCS=false \
   1.107  		BOOT_CYCLE_DEBUG_SETTINGS= \
   1.108  		build_debug_image
   1.109 -	@$(FINISH_ECHO)
   1.110  
   1.111  create_fresh_fastdebug_bootdir: FRC
   1.112 -	@$(START_ECHO)
   1.113  	$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
   1.114  		GENERATE_DOCS=false \
   1.115  		BOOT_CYCLE_DEBUG_SETTINGS= \
   1.116  		build_fastdebug_image
   1.117 -	@$(FINISH_ECHO)
   1.118  
   1.119  # Create boot image?
   1.120  ifeq ($(SKIP_BOOT_CYCLE),false)
   1.121 @@ -197,6 +186,8 @@
   1.122    endif
   1.123  endif
   1.124  
   1.125 +
   1.126 +
   1.127  ifeq ($(DO_BOOT_CYCLE),true)
   1.128    
   1.129    # Create the bootdir to use in the build
   1.130 @@ -221,27 +212,23 @@
   1.131  endif
   1.132  
   1.133  build_product_image:
   1.134 -	@$(START_ECHO)
   1.135  	$(MAKE) \
   1.136  	        SKIP_FASTDEBUG_BUILD=true \
   1.137  	        SKIP_DEBUG_BUILD=true \
   1.138  	        $(BOOT_CYCLE_SETTINGS) \
   1.139  	        generic_build_repo_series
   1.140 -	@$(FINISH_ECHO)
   1.141  
   1.142  #   NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
   1.143  #         Due to the use of short paths in $(ABS_OUTPUTDIR), this may 
   1.144  #         not be the same location.
   1.145  
   1.146  generic_debug_build:
   1.147 -	@$(START_ECHO)
   1.148  	$(MAKE) \
   1.149  		ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
   1.150  	        DEBUG_NAME=$(DEBUG_NAME) \
   1.151  		GENERATE_DOCS=false \
   1.152  	        $(BOOT_CYCLE_DEBUG_SETTINGS) \
   1.153  		generic_build_repo_series
   1.154 -	@$(FINISH_ECHO)
   1.155  
   1.156  build_debug_image:
   1.157  	$(MAKE) DEBUG_NAME=debug generic_debug_build
   1.158 @@ -254,7 +241,8 @@
   1.159  debug_build:: build_debug_image
   1.160  fastdebug_build:: build_fastdebug_image
   1.161  
   1.162 -clobber::
   1.163 +clobber:: REPORT_BUILD_TIMES=
   1.164 +clobber:: 
   1.165  	$(RM) -r $(OUTPUTDIR)/*
   1.166  	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
   1.167  	$(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*

mercurial