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:: |
66 all_product_build:: |
77 @$(FINISH_ECHO) |
|
78 |
67 |
79 # Everything for a full product build |
68 # Everything for a full product build |
80 all_product_build:: |
|
81 @$(START_ECHO) |
|
82 |
|
83 ifeq ($(SKIP_PRODUCT_BUILD), false) |
69 ifeq ($(SKIP_PRODUCT_BUILD), false) |
84 |
70 |
85 all_product_build:: product_build |
71 all_product_build:: product_build |
86 |
72 |
87 ifeq ($(BUILD_INSTALL), true) |
73 ifeq ($(BUILD_INSTALL), true) |
88 all_product_build:: $(INSTALL) |
74 all_product_build:: $(INSTALL) |
89 clobber:: install-clobber |
75 clobber:: install-clobber |
90 endif |
76 endif |
91 |
77 |
92 ifeq ($(BUILD_SPONSORS), true) |
78 ifeq ($(BUILD_SPONSORS), true) |
93 all_product_build:: $(SPONSORS) |
79 all_product_build:: $(SPONSORS) |
94 clobber:: sponsors-clobber |
80 clobber:: sponsors-clobber |
95 endif |
81 endif |
96 |
82 |
97 ifneq ($(SKIP_COMPARE_IMAGES), true) |
83 ifneq ($(SKIP_COMPARE_IMAGES), true) |
98 all_product_build:: compare-image |
84 all_product_build:: compare-image |
99 endif |
85 endif |
100 |
86 |
101 endif |
87 endif |
102 |
88 |
103 all_product_build:: |
89 define StartTimer |
104 @$(FINISH_ECHO) |
90 $(MKDIR) -p $(BUILDTIMESDIR) |
|
91 $(RM) $(BUILDTIMESDIR)/build_time_* |
|
92 $(call RecordStartTime,TOTAL) |
|
93 endef |
|
94 |
|
95 define StopTimer |
|
96 $(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),) |
|
97 endef |
105 |
98 |
106 # Generic build of basic repo series |
99 # Generic build of basic repo series |
107 generic_build_repo_series:: |
100 generic_build_repo_series:: |
108 $(MKDIR) -p $(OUTPUTDIR) |
101 $(MKDIR) -p $(OUTPUTDIR) |
109 $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image |
102 $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image |
|
103 @$(call StartTimer) |
110 |
104 |
111 ifeq ($(BUILD_LANGTOOLS), true) |
105 ifeq ($(BUILD_LANGTOOLS), true) |
112 generic_build_repo_series:: langtools |
106 generic_build_repo_series:: langtools |
113 clobber:: langtools-clobber |
107 clobber:: langtools-clobber |
114 endif |
108 endif |
140 |
134 |
141 ifeq ($(BUILD_DEPLOY), true) |
135 ifeq ($(BUILD_DEPLOY), true) |
142 generic_build_repo_series:: $(DEPLOY) |
136 generic_build_repo_series:: $(DEPLOY) |
143 clobber:: deploy-clobber |
137 clobber:: deploy-clobber |
144 endif |
138 endif |
|
139 |
|
140 generic_build_repo_series:: |
|
141 @$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build)) |
145 |
142 |
146 # The debug build, fastdebug or debug. Needs special handling. |
143 # The debug build, fastdebug or debug. Needs special handling. |
147 # Note that debug builds do NOT do INSTALL steps, but must be done |
144 # 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. |
145 # after the product build and before the INSTALL step of the product build. |
149 # |
146 # |
165 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk |
162 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk |
166 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image |
163 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image |
167 FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image |
164 FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME)/j2sdk-image |
168 |
165 |
169 create_fresh_product_bootdir: FRC |
166 create_fresh_product_bootdir: FRC |
170 @$(START_ECHO) |
|
171 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
167 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
172 GENERATE_DOCS=false \ |
168 GENERATE_DOCS=false \ |
173 BOOT_CYCLE_SETTINGS= \ |
169 BOOT_CYCLE_SETTINGS= \ |
174 build_product_image |
170 build_product_image |
175 @$(FINISH_ECHO) |
|
176 |
171 |
177 create_fresh_debug_bootdir: FRC |
172 create_fresh_debug_bootdir: FRC |
178 @$(START_ECHO) |
|
179 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
173 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
180 GENERATE_DOCS=false \ |
174 GENERATE_DOCS=false \ |
181 BOOT_CYCLE_DEBUG_SETTINGS= \ |
175 BOOT_CYCLE_DEBUG_SETTINGS= \ |
182 build_debug_image |
176 build_debug_image |
183 @$(FINISH_ECHO) |
|
184 |
177 |
185 create_fresh_fastdebug_bootdir: FRC |
178 create_fresh_fastdebug_bootdir: FRC |
186 @$(START_ECHO) |
|
187 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
179 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \ |
188 GENERATE_DOCS=false \ |
180 GENERATE_DOCS=false \ |
189 BOOT_CYCLE_DEBUG_SETTINGS= \ |
181 BOOT_CYCLE_DEBUG_SETTINGS= \ |
190 build_fastdebug_image |
182 build_fastdebug_image |
191 @$(FINISH_ECHO) |
|
192 |
183 |
193 # Create boot image? |
184 # Create boot image? |
194 ifeq ($(SKIP_BOOT_CYCLE),false) |
185 ifeq ($(SKIP_BOOT_CYCLE),false) |
195 ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64) |
186 ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64) |
196 DO_BOOT_CYCLE=true |
187 DO_BOOT_CYCLE=true |
197 endif |
188 endif |
198 endif |
189 endif |
|
190 |
|
191 |
199 |
192 |
200 ifeq ($(DO_BOOT_CYCLE),true) |
193 ifeq ($(DO_BOOT_CYCLE),true) |
201 |
194 |
202 # Create the bootdir to use in the build |
195 # Create the bootdir to use in the build |
203 product_build:: create_fresh_product_bootdir |
196 product_build:: create_fresh_product_bootdir |
219 BOOT_CYCLE_DEBUG_SETTINGS= |
212 BOOT_CYCLE_DEBUG_SETTINGS= |
220 |
213 |
221 endif |
214 endif |
222 |
215 |
223 build_product_image: |
216 build_product_image: |
224 @$(START_ECHO) |
|
225 $(MAKE) \ |
217 $(MAKE) \ |
226 SKIP_FASTDEBUG_BUILD=true \ |
218 SKIP_FASTDEBUG_BUILD=true \ |
227 SKIP_DEBUG_BUILD=true \ |
219 SKIP_DEBUG_BUILD=true \ |
228 $(BOOT_CYCLE_SETTINGS) \ |
220 $(BOOT_CYCLE_SETTINGS) \ |
229 generic_build_repo_series |
221 generic_build_repo_series |
230 @$(FINISH_ECHO) |
|
231 |
222 |
232 # NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME). |
223 # NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME). |
233 # Due to the use of short paths in $(ABS_OUTPUTDIR), this may |
224 # Due to the use of short paths in $(ABS_OUTPUTDIR), this may |
234 # not be the same location. |
225 # not be the same location. |
235 |
226 |
236 generic_debug_build: |
227 generic_debug_build: |
237 @$(START_ECHO) |
|
238 $(MAKE) \ |
228 $(MAKE) \ |
239 ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \ |
229 ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-$(DEBUG_NAME) \ |
240 DEBUG_NAME=$(DEBUG_NAME) \ |
230 DEBUG_NAME=$(DEBUG_NAME) \ |
241 GENERATE_DOCS=false \ |
231 GENERATE_DOCS=false \ |
242 $(BOOT_CYCLE_DEBUG_SETTINGS) \ |
232 $(BOOT_CYCLE_DEBUG_SETTINGS) \ |
243 generic_build_repo_series |
233 generic_build_repo_series |
244 @$(FINISH_ECHO) |
|
245 |
234 |
246 build_debug_image: |
235 build_debug_image: |
247 $(MAKE) DEBUG_NAME=debug generic_debug_build |
236 $(MAKE) DEBUG_NAME=debug generic_debug_build |
248 |
237 |
249 build_fastdebug_image: |
238 build_fastdebug_image: |
252 # Build final image |
241 # Build final image |
253 product_build:: build_product_image |
242 product_build:: build_product_image |
254 debug_build:: build_debug_image |
243 debug_build:: build_debug_image |
255 fastdebug_build:: build_fastdebug_image |
244 fastdebug_build:: build_fastdebug_image |
256 |
245 |
257 clobber:: |
246 clobber:: REPORT_BUILD_TIMES= |
|
247 clobber:: |
258 $(RM) -r $(OUTPUTDIR)/* |
248 $(RM) -r $(OUTPUTDIR)/* |
259 $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/* |
249 $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-debug/* |
260 $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/* |
250 $(RM) -r $(OUTPUTDIR)/../$(PLATFORM)-$(ARCH)-fastdebug/* |
261 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE)) |
251 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE)) |
262 |
252 |