comparison Makefile @ 311:a1c8b847b753

7021753: Add a build times report Summary: Report the build times at end of a jdkroot build. Reviewed-by: ohair
author ohrstrom
date Mon, 28 Feb 2011 10:56:10 +0100
parents 24900a58ab9f
children c6f380693342
comparison
equal deleted inserted replaced
15:f526fae54d33 16:15b540997ee2
33 JDK_TOPDIR=$(TOPDIR)/jdk 33 JDK_TOPDIR=$(TOPDIR)/jdk
34 endif 34 endif
35 ifndef JDK_MAKE_SHARED_DIR 35 ifndef JDK_MAKE_SHARED_DIR
36 JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared 36 JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
37 endif 37 endif
38
39 # For start and finish echo lines
40 TITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE)
41 DATE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'`
42 START_ECHO = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)"
43 FINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)"
44 38
45 default: all 39 default: all
46 40
47 include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk 41 include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
48 include ./make/Defs-internal.gmk 42 include ./make/Defs-internal.gmk
55 include ./make/jdk-rules.gmk 49 include ./make/jdk-rules.gmk
56 include ./make/install-rules.gmk 50 include ./make/install-rules.gmk
57 include ./make/sponsors-rules.gmk 51 include ./make/sponsors-rules.gmk
58 include ./make/deploy-rules.gmk 52 include ./make/deploy-rules.gmk
59 53
60 # What "all" means
61 all::
62 @$(START_ECHO)
63
64 all:: sanity 54 all:: sanity
65 55
66 ifeq ($(SKIP_FASTDEBUG_BUILD), false) 56 ifeq ($(SKIP_FASTDEBUG_BUILD), false)
67 all:: fastdebug_build 57 all:: fastdebug_build
68 endif 58 endif
71 all:: debug_build 61 all:: debug_build
72 endif 62 endif
73 63
74 all:: all_product_build 64 all:: all_product_build
75 65
76 all::
77 @$(FINISH_ECHO)
78
79 # Everything for a full product build 66 # Everything for a full product build
80 all_product_build::
81 @$(START_ECHO)
82
83 ifeq ($(SKIP_PRODUCT_BUILD), false) 67 ifeq ($(SKIP_PRODUCT_BUILD), false)
84 68
85 all_product_build:: product_build 69 all_product_build:: product_build
86 70
87 ifeq ($(BUILD_INSTALL), true) 71 ifeq ($(BUILD_INSTALL), true)
88 all_product_build:: $(INSTALL) 72 all_product_build:: $(INSTALL)
89 clobber:: install-clobber 73 clobber:: install-clobber
90 endif 74 endif
91 75
92 ifeq ($(BUILD_SPONSORS), true) 76 ifeq ($(BUILD_SPONSORS), true)
93 all_product_build:: $(SPONSORS) 77 all_product_build:: $(SPONSORS)
94 clobber:: sponsors-clobber 78 clobber:: sponsors-clobber
95 endif 79 endif
96 80
97 ifneq ($(SKIP_COMPARE_IMAGES), true) 81 ifneq ($(SKIP_COMPARE_IMAGES), true)
98 all_product_build:: compare-image 82 all_product_build:: compare-image
99 endif 83 endif
100 84
101 endif 85 endif
102 86
103 all_product_build:: 87 define StartTimer
104 @$(FINISH_ECHO) 88 $(MKDIR) -p $(BUILDTIMESDIR)
89 $(RM) $(BUILDTIMESDIR)/build_time_*
90 $(call RecordStartTime,TOTAL)
91 endef
92
93 define StopTimer
94 $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
95 endef
105 96
106 # Generic build of basic repo series 97 # Generic build of basic repo series
107 generic_build_repo_series:: 98 generic_build_repo_series::
108 $(MKDIR) -p $(OUTPUTDIR) 99 $(MKDIR) -p $(OUTPUTDIR)
109 $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image 100 $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
101 @$(call StartTimer)
110 102
111 ifeq ($(BUILD_LANGTOOLS), true) 103 ifeq ($(BUILD_LANGTOOLS), true)
112 generic_build_repo_series:: langtools 104 generic_build_repo_series:: langtools
113 clobber:: langtools-clobber 105 clobber:: langtools-clobber
114 endif 106 endif
140 132
141 ifeq ($(BUILD_DEPLOY), true) 133 ifeq ($(BUILD_DEPLOY), true)
142 generic_build_repo_series:: $(DEPLOY) 134 generic_build_repo_series:: $(DEPLOY)
143 clobber:: deploy-clobber 135 clobber:: deploy-clobber
144 endif 136 endif
137
138 generic_build_repo_series::
139 @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
145 140
146 # The debug build, fastdebug or debug. Needs special handling. 141 # The debug build, fastdebug or debug. Needs special handling.
147 # Note that debug builds do NOT do INSTALL steps, but must be done 142 # Note that debug builds do NOT do INSTALL steps, but must be done
148 # after the product build and before the INSTALL step of the product build. 143 # after the product build and before the INSTALL step of the product build.
149 # 144 #
165 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk 160 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
166 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image 161 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
167 FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image 162 FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image
168 163
169 create_fresh_product_bootdir: FRC 164 create_fresh_product_bootdir: FRC
170 @$(START_ECHO)
171 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ 165 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
172 GENERATE_DOCS=false \ 166 GENERATE_DOCS=false \
173 BOOT_CYCLE_SETTINGS= \ 167 BOOT_CYCLE_SETTINGS= \
174 build_product_image 168 build_product_image
175 @$(FINISH_ECHO)
176 169
177 create_fresh_debug_bootdir: FRC 170 create_fresh_debug_bootdir: FRC
178 @$(START_ECHO)
179 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ 171 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
180 GENERATE_DOCS=false \ 172 GENERATE_DOCS=false \
181 BOOT_CYCLE_DEBUG_SETTINGS= \ 173 BOOT_CYCLE_DEBUG_SETTINGS= \
182 build_debug_image 174 build_debug_image
183 @$(FINISH_ECHO)
184 175
185 create_fresh_fastdebug_bootdir: FRC 176 create_fresh_fastdebug_bootdir: FRC
186 @$(START_ECHO)
187 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ 177 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
188 GENERATE_DOCS=false \ 178 GENERATE_DOCS=false \
189 BOOT_CYCLE_DEBUG_SETTINGS= \ 179 BOOT_CYCLE_DEBUG_SETTINGS= \
190 build_fastdebug_image 180 build_fastdebug_image
191 @$(FINISH_ECHO)
192 181
193 # Create boot image? 182 # Create boot image?
194 ifeq ($(SKIP_BOOT_CYCLE),false) 183 ifeq ($(SKIP_BOOT_CYCLE),false)
195 ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64) 184 ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
196 DO_BOOT_CYCLE=true 185 DO_BOOT_CYCLE=true
197 endif 186 endif
198 endif 187 endif
188
189
199 190
200 ifeq ($(DO_BOOT_CYCLE),true) 191 ifeq ($(DO_BOOT_CYCLE),true)
201 192
202 # Create the bootdir to use in the build 193 # Create the bootdir to use in the build
203 product_build:: create_fresh_product_bootdir 194 product_build:: create_fresh_product_bootdir
219 BOOT_CYCLE_DEBUG_SETTINGS= 210 BOOT_CYCLE_DEBUG_SETTINGS=
220 211
221 endif 212 endif
222 213
223 build_product_image: 214 build_product_image:
224 @$(START_ECHO)
225 $(MAKE) \ 215 $(MAKE) \
226 SKIP_FASTDEBUG_BUILD=true \ 216 SKIP_FASTDEBUG_BUILD=true \
227 SKIP_DEBUG_BUILD=true \ 217 SKIP_DEBUG_BUILD=true \
228 $(BOOT_CYCLE_SETTINGS) \ 218 $(BOOT_CYCLE_SETTINGS) \
229 generic_build_repo_series 219 generic_build_repo_series
230 @$(FINISH_ECHO)
231 220
232 # NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME). 221 # NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
233 # Due to the use of short paths in $(ABS_OUTPUTDIR), this may 222 # Due to the use of short paths in $(ABS_OUTPUTDIR), this may
234 # not be the same location. 223 # not be the same location.
235 224
236 generic_debug_build: 225 generic_debug_build:
237 @$(START_ECHO)
238 $(MAKE) \ 226 $(MAKE) \
239 ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \ 227 ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \
240 DEBUG_NAME=$(DEBUG_NAME) \ 228 DEBUG_NAME=$(DEBUG_NAME) \
241 GENERATE_DOCS=false \ 229 GENERATE_DOCS=false \
242 $(BOOT_CYCLE_DEBUG_SETTINGS) \ 230 $(BOOT_CYCLE_DEBUG_SETTINGS) \
243 generic_build_repo_series 231 generic_build_repo_series
244 @$(FINISH_ECHO)
245 232
246 build_debug_image: 233 build_debug_image:
247 $(MAKE) DEBUG_NAME=debug generic_debug_build 234 $(MAKE) DEBUG_NAME=debug generic_debug_build
248 235
249 build_fastdebug_image: 236 build_fastdebug_image:
252 # Build final image 239 # Build final image
253 product_build:: build_product_image 240 product_build:: build_product_image
254 debug_build:: build_debug_image 241 debug_build:: build_debug_image
255 fastdebug_build:: build_fastdebug_image 242 fastdebug_build:: build_fastdebug_image
256 243
257 clobber:: 244 clobber:: REPORT_BUILD_TIMES=
245 clobber::
258 $(RM) -r $(OUTPUTDIR)/* 246 $(RM) -r $(OUTPUTDIR)/*
259 $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/* 247 $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/*
260 $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/* 248 $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/*
261 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE)) 249 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
262 250