Makefile

changeset 29
55b2666e52e1
parent 20
2dab2f712e18
child 34
46a989ab9329
equal deleted inserted replaced
27:64da805be725 29:55b2666e52e1
47 endif 47 endif
48 ifndef JDK_MAKE_SHARED_DIR 48 ifndef JDK_MAKE_SHARED_DIR
49 JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared 49 JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
50 endif 50 endif
51 51
52 # For start and finish echo lines
53 TITLE_TEXT = Control $(PLATFORM) $(ARCH) $(RELEASE)
54 DAYE_STAMP = `$(DATE) '+%y-%m-%d %H:%M'`
55 START_ECHO = echo "$(TITLE_TEXT) $@ build started: $(DATE_STAMP)"
56 FINISH_ECHO = echo "$(TITLE_TEXT) $@ build finished: $(DATE_STAMP)"
57
58 default: all
59
52 include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk 60 include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
53
54 include ./make/Defs-internal.gmk 61 include ./make/Defs-internal.gmk
55
56 all::
57 @$(ECHO) $(PLATFORM) $(ARCH) $(RELEASE) build started: `$(DATE) '+%y-%m-%d %H:%M'`
58 $(MKDIR) -p $(OUTPUTDIR)
59
60 # Rules for sanity checks
61 include ./make/sanity-rules.gmk 62 include ./make/sanity-rules.gmk
62
63 dev : dev-build
64
65 dev-build:
66 $(MAKE) DEV_ONLY=true all
67 dev-sanity:
68 $(MAKE) DEV_ONLY=true sanity
69 dev-clobber:
70 $(MAKE) DEV_ONLY=true clobber
71
72 # Rules for various components
73 include ./make/hotspot-rules.gmk 63 include ./make/hotspot-rules.gmk
74 include ./make/langtools-rules.gmk 64 include ./make/langtools-rules.gmk
75 include ./make/corba-rules.gmk 65 include ./make/corba-rules.gmk
76 include ./make/jaxp-rules.gmk 66 include ./make/jaxp-rules.gmk
77 include ./make/jaxws-rules.gmk 67 include ./make/jaxws-rules.gmk
78 include ./make/jdk-rules.gmk 68 include ./make/jdk-rules.gmk
79 include ./make/install-rules.gmk 69 include ./make/install-rules.gmk
80 include ./make/sponsors-rules.gmk 70 include ./make/sponsors-rules.gmk
81 include ./make/deploy-rules.gmk 71 include ./make/deploy-rules.gmk
82 72
83 all:: setup build 73 # What "all" means
84 74 all::
85 setup: openjdk_check 75 @$(START_ECHO)
76
77 all:: openjdk_check sanity all_product_build
78
79 ifeq ($(SKIP_FASTDEBUG_BUILD), false)
80 all:: fastdebug_build
81 endif
82
83 ifeq ($(SKIP_DEBUG_BUILD), false)
84 all:: debug_build
85 endif
86
87 ifneq ($(SKIP_OPENJDK_BUILD), true)
88 all:: openjdk_build
89 endif
90
91 all::
92 @$(FINISH_ECHO)
93
94 # Everything for a full product build
95 all_product_build::
96 @$(START_ECHO)
97
98 ifeq ($(SKIP_PRODUCT_BUILD), false)
99
100 all_product_build:: product_build
101
102 ifeq ($(BUILD_INSTALL), true)
103 all_product_build:: $(INSTALL)
104 clobber:: install-clobber
105 endif
106
107 ifeq ($(BUILD_SPONSORS), true)
108 all_product_build:: $(SPONSORS)
109 clobber:: sponsors-clobber
110 endif
111
112 ifneq ($(SKIP_COMPARE_IMAGES), true)
113 all_product_build:: compare-image
114 endif
115
116 endif
117
118 all_product_build::
119 @$(FINISH_ECHO)
120
121 # Generis build of basic repo series
122 generic_build_repo_series::
123 $(MKDIR) -p $(OUTPUTDIR)
86 $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image 124 $(MKDIR) -p $(OUTPUTDIR)/j2sdk-image
125
126 ifeq ($(BUILD_LANGTOOLS), true)
127 generic_build_repo_series:: langtools
128 clobber:: langtools-clobber
129 endif
130
131 ifeq ($(BUILD_CORBA), true)
132 generic_build_repo_series:: corba
133 clobber:: corba-clobber
134 endif
135
136 ifeq ($(BUILD_JAXP), true)
137 generic_build_repo_series:: jaxp
138 clobber:: jaxp-clobber
139 endif
140
141 ifeq ($(BUILD_JAXWS), true)
142 generic_build_repo_series:: jaxws
143 clobber:: jaxws-clobber
144 endif
145
146 ifeq ($(BUILD_HOTSPOT), true)
147 generic_build_repo_series:: $(HOTSPOT)
148 clobber:: hotspot-clobber
149 endif
150
151 ifeq ($(BUILD_JDK), true)
152 generic_build_repo_series:: $(JDK_JAVA_EXE)
153 clobber:: jdk-clobber
154 endif
155
156 ifeq ($(BUILD_DEPLOY), true)
157 generic_build_repo_series:: $(DEPLOY)
158 clobber:: deploy-clobber
159 endif
160
161 ifeq ($(BUILD_JDK), true)
162 ifeq ($(BUNDLE_RULES_AVAILABLE), true)
163 generic_build_repo_series:: openjdk-binary-plugs-bundles
164 endif
165 endif
166
167 # The debug build, fastdebug or debug. Needs special handling.
168 # Note that debug builds do NOT do INSTALL steps, but must be done
169 # after the product build and before the INSTALL step of the product build.
170 #
171 # DEBUG_NAME is fastdebug or debug
172 # ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
173 # The resulting j2sdk-image is used by the install makefiles to create a
174 # debug install bundle jdk-*-debug-** bundle (tar or zip)
175 # which will install in the debug or fastdebug subdirectory of the
176 # normal product install area.
177 # The install process needs to know what the DEBUG_NAME is, so
178 # look for INSTALL_DEBUG_NAME in the install rules.
179 #
180
181 # Location of fresh bootdir output
182 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
183 FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image
184 FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME)/j2sdk-image
185
186 create_fresh_product_bootdir: FRC
187 @$(START_ECHO)
188 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
189 NO_DOCS=true \
190 BOOT_CYCLE_SETTINGS= \
191 build_product_image
192 @$(FINISH_ECHO)
193
194 create_fresh_debug_bootdir: FRC
195 @$(START_ECHO)
196 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
197 NO_DOCS=true \
198 BOOT_CYCLE_DEBUG_SETTINGS= \
199 build_debug_image
200 @$(FINISH_ECHO)
201
202 create_fresh_fastdebug_bootdir: FRC
203 @$(START_ECHO)
204 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
205 NO_DOCS=true \
206 BOOT_CYCLE_DEBUG_SETTINGS= \
207 build_fastdebug_image
208 @$(FINISH_ECHO)
209
210 # Create boot image?
211 ifeq ($(SKIP_BOOT_CYCLE),false)
212 ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
213 DO_BOOT_CYCLE=true
214 endif
215 endif
216
217 ifeq ($(DO_BOOT_CYCLE),true)
218
219 # Create the bootdir to use in the build
220 product_build:: create_fresh_product_bootdir
221 debug_build:: create_fresh_debug_bootdir
222 fastdebug_build:: create_fresh_fastdebug_bootdir
223
224 # Define variables to be used now for the boot jdk
225 BOOT_CYCLE_SETTINGS= \
226 ALT_BOOTDIR=$(FRESH_BOOTDIR) \
227 ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR)
228 BOOT_CYCLE_DEBUG_SETTINGS= \
229 ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \
230 ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR)
231
232 else
233
234 # Use the supplied ALT_BOOTDIR as the boot
235 BOOT_CYCLE_SETTINGS=
236 BOOT_CYCLE_DEBUG_SETTINGS=
237
238 endif
239
240 build_product_image:
241 @$(START_ECHO)
242 $(MAKE) \
243 SKIP_FASTDEBUG_BUILD=true \
244 SKIP_DEBUG_BUILD=true \
245 $(BOOT_CYCLE_SETTINGS) \
246 generic_build_repo_series
247 @$(FINISH_ECHO)
248
249 generic_debug_build:
250 @$(START_ECHO)
251 $(MAKE) \
252 ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \
253 DEBUG_NAME=$(DEBUG_NAME) \
254 NO_DOCS=true \
255 $(BOOT_CYCLE_DEBUG_SETTINGS) \
256 generic_build_repo_series
257 @$(FINISH_ECHO)
258
259 build_debug_image:
260 $(MAKE) DEBUG_NAME=debug generic_debug_build
261
262 build_fastdebug_image:
263 $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
264
265 # Build final image
266 product_build:: build_product_image
267 debug_build:: build_debug_image
268 fastdebug_build:: build_fastdebug_image
87 269
88 # Check on whether we really can build the openjdk, need source etc. 270 # Check on whether we really can build the openjdk, need source etc.
89 openjdk_check: FRC 271 openjdk_check: FRC
90 ifneq ($(SKIP_OPENJDK_BUILD), true) 272 ifneq ($(SKIP_OPENJDK_BUILD), true)
91 @$(ECHO) " " 273 @$(ECHO) " "
97 $(ECHO) "OpenJDK will be built after JDK is built"; \ 279 $(ECHO) "OpenJDK will be built after JDK is built"; \
98 $(ECHO) " OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \ 280 $(ECHO) " OPENJDK_BUILDDIR=$(OPENJDK_BUILDDIR)"; \
99 fi 281 fi
100 @$(ECHO) "=================================================" 282 @$(ECHO) "================================================="
101 @$(ECHO) " " 283 @$(ECHO) " "
102 endif
103
104 build:: sanity
105
106 clobber::
107
108 ifeq ($(BUILD_LANGTOOLS), true)
109 build:: langtools
110 clobber:: langtools-clobber
111 endif
112
113 ifeq ($(BUILD_CORBA), true)
114 build:: corba
115 clobber:: corba-clobber
116 endif
117
118 ifeq ($(BUILD_JAXP), true)
119 build:: jaxp
120 clobber:: jaxp-clobber
121 endif
122
123 ifeq ($(BUILD_JAXWS), true)
124 build:: jaxws
125 clobber:: jaxws-clobber
126 endif
127
128 ifeq ($(BUILD_HOTSPOT), true)
129 build:: $(HOTSPOT)
130 clobber:: hotspot-clobber
131 endif
132
133 ifeq ($(BUILD_JDK), true)
134 build:: $(JDK_JAVA_EXE)
135 clobber:: jdk-clobber
136 endif
137
138 ifeq ($(BUILD_DEPLOY), true)
139 build:: $(DEPLOY)
140 clobber:: deploy-clobber
141 endif
142
143 #
144 # Generic debug build, fastdebug or debug. Needs special handling.
145 # Note that debug builds do NOT do INSTALL steps, but must be done
146 # after the product build and before the INSTALL step of the product build.
147 #
148 # DEBUG_NAME is fastdebug or debug
149 # ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
150 # The resulting j2sdk-image is used by the install makefiles to create a
151 # debug install bundle jdk-*-debug-** bundle (tar or zip)
152 # which will install in the debug or fastdebug subdirectory of the
153 # normal product install area.
154 # The install process needs to know what the DEBUG_NAME is, so
155 # look for INSTALL_DEBUG_NAME in the install rules.
156 #
157
158 COMMON_DEBUG_FLAGS= \
159 DEBUG_NAME=$(DEBUG_NAME) \
160 ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)-$(DEBUG_NAME) \
161 NO_DOCS=true
162
163 product_build: setup
164 @$(ECHO) $@ build started: `$(DATE) '+%y-%m-%d %H:%M'`
165 $(MAKE) SKIP_FASTDEBUG_BUILD=true SKIP_DEBUG_BUILD=true all
166 @$(ECHO) $@ build finished: `$(DATE) '+%y-%m-%d %H:%M'`
167
168 generic_debug_build:
169 @$(ECHO) $@ build started: `$(DATE) '+%y-%m-%d %H:%M'`
170 $(MAKE) $(COMMON_DEBUG_FLAGS) setup build
171 @$(ECHO) $@ build finished: `$(DATE) '+%y-%m-%d %H:%M'`
172
173 debug_build: setup
174 $(MAKE) DEBUG_NAME=debug generic_debug_build
175
176 fastdebug_build: setup
177 $(MAKE) DEBUG_NAME=fastdebug generic_debug_build
178
179 ifeq ($(SKIP_FASTDEBUG_BUILD), false)
180 all:: fastdebug_build
181 endif
182
183 ifeq ($(SKIP_DEBUG_BUILD), false)
184 all:: debug_build
185 endif
186
187 ifeq ($(BUILD_JDK), true)
188 ifeq ($(BUNDLE_RULES_AVAILABLE), true)
189 all:: openjdk-binary-plugs-bundles
190 endif
191 endif
192
193 ifeq ($(BUILD_INSTALL), true)
194 all :: $(INSTALL)
195 clobber:: install-clobber
196 endif
197
198 ifeq ($(BUILD_SPONSORS), true)
199 all :: $(SPONSORS)
200 clobber:: sponsors-clobber
201 endif
202
203 ifneq ($(SKIP_COMPARE_IMAGES), true)
204 all :: compare-image
205 endif
206
207 ifneq ($(SKIP_OPENJDK_BUILD), true)
208 all :: openjdk_build
209 endif 284 endif
210 285
211 # If we have bundle rules, we have a chance here to do a complete cycle 286 # If we have bundle rules, we have a chance here to do a complete cycle
212 # build, of production and open build. 287 # build, of production and open build.
213 # FIXUP: We should create the openjdk source bundle and build that? 288 # FIXUP: We should create the openjdk source bundle and build that?
233 OPENJDK_BOOTDIR=$(BUILT_IMAGE) 308 OPENJDK_BOOTDIR=$(BUILT_IMAGE)
234 OPENJDK_IMPORTJDK=$(BUILT_IMAGE) 309 OPENJDK_IMPORTJDK=$(BUILT_IMAGE)
235 endif 310 endif
236 311
237 openjdk_build: 312 openjdk_build:
313 @$(START_ECHO)
238 @$(ECHO) " " 314 @$(ECHO) " "
239 @$(ECHO) "=================================================" 315 @$(ECHO) "================================================="
240 @$(ECHO) "Starting openjdk build" 316 @$(ECHO) "Starting openjdk build"
241 @$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)" 317 @$(ECHO) " Using: ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR)"
242 @$(ECHO) "=================================================" 318 @$(ECHO) "================================================="
243 @$(ECHO) " " 319 @$(ECHO) " "
244 $(RM) -r $(OPENJDK_OUTPUTDIR) 320 $(RM) -r $(OPENJDK_OUTPUTDIR)
245 $(MKDIR) -p $(OPENJDK_OUTPUTDIR) 321 $(MKDIR) -p $(OPENJDK_OUTPUTDIR)
246 ($(CD) $(OPENJDK_BUILDDIR) && $(MAKE) \ 322 ($(CD) $(OPENJDK_BUILDDIR) && $(MAKE) \
247 OPENJDK=true \ 323 OPENJDK=true \
324 NO_DOCS=true \
248 ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \ 325 ALT_JDK_DEVTOOLS_DIR=$(JDK_DEVTOOLS_DIR) \
249 ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \ 326 ALT_OUTPUTDIR=$(OPENJDK_OUTPUTDIR) \
250 ALT_BINARY_PLUGS_PATH=$(OPENJDK_PLUGS) \ 327 ALT_BINARY_PLUGS_PATH=$(OPENJDK_PLUGS) \
251 ALT_BOOTDIR=$(OPENJDK_BOOTDIR) \ 328 ALT_BOOTDIR=$(OPENJDK_BOOTDIR) \
252 ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \ 329 ALT_JDK_IMPORT_PATH=$(OPENJDK_IMPORTJDK) \
259 @$(ECHO) "=================================================" 336 @$(ECHO) "================================================="
260 @$(ECHO) "Finished openjdk build" 337 @$(ECHO) "Finished openjdk build"
261 @$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)" 338 @$(ECHO) " Binary Bundle: $(OPENJDK_BUILD_BINARY_ZIP)"
262 @$(ECHO) "=================================================" 339 @$(ECHO) "================================================="
263 @$(ECHO) " " 340 @$(ECHO) " "
341 @$(FINISH_ECHO)
264 342
265 endif 343 endif
266 endif 344 endif
267 endif 345 endif
268 346
272 $(RM) -r $(OUTPUTDIR)-fastdebug/* 350 $(RM) -r $(OUTPUTDIR)-fastdebug/*
273 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE)) 351 -($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
274 352
275 clean: clobber 353 clean: clobber
276 354
277 all:: 355 #
278 @$(ECHO) Control build finished: `$(DATE) '+%y-%m-%d %H:%M'` 356 # Dev builds
357 #
358
359 dev : dev-build
360
361 dev-build:
362 $(MAKE) DEV_ONLY=true all
363 dev-sanity:
364 $(MAKE) DEV_ONLY=true sanity
365 dev-clobber:
366 $(MAKE) DEV_ONLY=true clobber
279 367
280 # 368 #
281 # Quick jdk verification build 369 # Quick jdk verification build
282 # 370 #
283 jdk_only: 371 jdk_only:
459 ifeq ($(BUNDLE_RULES_AVAILABLE), true) 547 ifeq ($(BUNDLE_RULES_AVAILABLE), true)
460 include $(BUNDLE_RULES) 548 include $(BUNDLE_RULES)
461 endif 549 endif
462 550
463 ################################################################ 551 ################################################################
464 # Cycle build. Build the jdk, use it to build the jdk again.
465 ################################################################
466
467 ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
468
469 boot_cycle:
470 $(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) product_build
471 $(MAKE) ALT_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/j2sdk-image product_build
472
473 ################################################################
474 # JPRT rule to build 552 # JPRT rule to build
475 ################################################################ 553 ################################################################
476 554
477 include ./make/jprt.gmk 555 include ./make/jprt.gmk
478 556
479 ################################################################ 557 ################################################################
480 # PHONY 558 # PHONY
481 ################################################################ 559 ################################################################
482 560
483 .PHONY: all build what clobber insane \ 561 .PHONY: all \
484 fastdebug_build debug_build product_build setup \ 562 generic_build_repo_series \
485 dev dev-build dev-sanity dev-clobber 563 what clobber insane \
564 dev dev-build dev-sanity dev-clobber \
565 product_build \
566 fastdebug_build \
567 debug_build \
568 build_product_image \
569 build_debug_image \
570 build_fastdebug_image \
571 create_fresh_product_bootdir \
572 create_fresh_debug_bootdir \
573 create_fresh_fastdebug_bootdir \
574 generic_debug_build
486 575
487 # Force target 576 # Force target
488 FRC: 577 FRC:
489 578

mercurial