1 #
2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
221 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
222
223 zip-source:
224 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
225
226 strip-binaries:
227 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk)
228
229 jrtfs-jar:
230 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
231
232 jimages:
233 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jimages)
234
235 profiles:
236 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk profiles)
237
238 mac-bundles:
239 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
240
241 prepare-test-image:
242 $(MKDIR) -p $(TEST_IMAGE_DIR)
243 $(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
244
245 ALL_TARGETS += source-tips bootcycle-images zip-security zip-source strip-binaries \
246 jrtfs-jar jimages profiles mac-bundles prepare-test-image
247
248 ################################################################################
249 # Docs targets
250
251 docs-javadoc:
252 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
253
254 docs-jvmtidoc:
255 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
256
257 ALL_TARGETS += docs-javadoc docs-jvmtidoc
258
259 ################################################################################
260 # Test target
261
262 test:
263 ($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
264 JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) \
265 ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true
266
267 test-make:
268 ($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
269
270 ALL_TARGETS += test test-make
271
272 ################################################################################
273 # Verification targets
274
275 verify-modules:
276 @$(call TargetEnter)
277 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CheckModules.gmk)
278 @$(call TargetExit)
279
280 ALL_TARGETS += verify-modules
281
282 ################################################################################
283 # Install targets
284
285 install:
286 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
287
288 ALL_TARGETS += install
289
290 ################################################################################
381
382 zip-source: gensrc rmic
383
384 strip-binaries: libs launchers gendata copy
385
386 jrtfs-jar: buildtools-jdk
387
388 jimages: exploded-image zip-source strip-binaries source-tips demos samples \
389 jrtfs-jar
390
391 profiles: exploded-image strip-binaries source-tips
392
393 mac-bundles: jimages
394
395 bootcycle-images: jimages
396
397 docs-javadoc: gensrc rmic
398
399 docs-jvmtidoc: hotspot
400
401 test: jimages
402
403 verify-modules: exploded-image
404
405 test-make: clean-test-make
406
407 endif
408
409 ################################################################################
410 # Virtual targets without recipes
411
412 buildtools: buildtools-langtools interim-langtools interim-corba interim-rmic \
413 buildtools-jdk
414
415 gensrc: $(GENSRC_TARGETS)
416
417 gendata: $(GENDATA_TARGETS)
418
419 copy: $(COPY_TARGETS)
420
421 java: $(JAVA_TARGETS)
422
423 rmic: $(RMIC_TARGETS)
424
425 libs: $(LIBS_TARGETS)
426
444 $(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
445
446 # The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
447 exploded-image: $(ALL_MODULE_TARGETS)
448
449 # The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
450 # and in line with this, our targets for creating these are named *-image[s].
451
452 # This target builds the product images, e.g. the JRE and JDK image
453 # (and possibly other, more specific versions)
454 product-images: jimages demos samples zip-security verify-modules
455
456 ifeq ($(OPENJDK_TARGET_OS), macosx)
457 product-images: mac-bundles
458 endif
459
460 # This target builds the documentation image
461 docs-image: docs-javadoc docs-jvmtidoc
462
463 # This target builds the test image
464 test-image: prepare-test-image
465
466 # all-images is the top-most target, it builds all our deliverables ("images").
467 all-images: product-images test-image docs-image
468
469 ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
470 jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) exploded-image \
471 product-images docs-image test-image all-images
472
473 ################################################################################
474
475 # Traditional targets typically run by users.
476 # These can be considered aliases for the targets now named by a more
477 # "modern" naming scheme.
478 default: exploded-image
479 jdk: exploded-image
480 images: product-images
481 docs: docs-image
482 all: all-images
483
484 ALL_TARGETS += default jdk images docs all
485
486 ################################################################################
487 ################################################################################
488 #
489 # Clean targets
490 #
491 ################################################################################
492 # Clean targets are automatically run serially by the Makefile calling this
493 # file.
494
495 CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
496 images make-support test-make
497 CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
498 CLEAN_PHASES := gensrc java native include
499 CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
500 CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
501 # Construct targets of the form clean-$module-$phase
502 CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
503 $(addprefix $m-, $(CLEAN_PHASES))))
504
505 # Remove everything, except the output from configure.
506 clean: $(CLEAN_DIR_TARGETS)
507 ($(CD) $(OUTPUT_ROOT) && $(RM) -r source_tips build.log* build-trace*.log*)
508 $(ECHO) Cleaned all build artifacts.
509
510 $(CLEAN_DIR_TARGETS):
511 $(call CleanDir,$(patsubst clean-%, %, $@))
512
513 $(CLEAN_PHASE_TARGETS):
514 $(call Clean-$(patsubst clean-%,%, $@))
515
516 $(CLEAN_MODULE_TARGETS):
517 $(call CleanModule,$(patsubst clean-%, %, $@))
518
519 $(CLEAN_MODULE_PHASE_TARGETS):
520 $(call Clean-$(word 3, $(subst -,$(SPACE),$@)), \
521 $(word 2, $(subst -,$(SPACE),$@)))
522
523 # When removing the support dir, we must also remove jdk. Building classes has
524 # the side effect of generating native headers. The headers end up in support
525 # while classes and touch files end up in jdk.
526 clean-support: clean-jdk
527
528 clean-docs: clean-docstemp
529
530 # Remove everything, including configure configuration.
531 # If the output directory was created by configure and now becomes empty, remove it as well.
532 dist-clean: clean
533 ($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \
534 Makefile compare.sh tmp javacservers)
535 $(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
536 if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
537 $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
538 else \
539 ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
540 && $(RM) -r $(OUTPUT_ROOT)) \
541 fi \
542 )
543 $(ECHO) Cleaned everything, you will have to re-run configure.
544
545 ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_PHASE_TARGETS) \
546 $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
547
548 ################################################################################
549
550 # Setup a rule for SPEC file that fails if executed. This check makes sure the
551 # configuration is up to date after changes to configure.
552 ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), )
553 $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
554 @$(ECHO) "ERROR: $(SPEC) is not up to date."
555 @$(ECHO) "Please rerun configure! Easiest way to do this is by running"
556 @$(ECHO) "'make reconfigure'."
557 @$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true"
558 @if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
559 endif
560
561 # The reconfigure target is automatically run serially from everything else
562 # by the Makefile calling this file.
563
564 reconfigure:
565 ifneq ($(CONFIGURE_COMMAND_LINE), )
566 @$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
|
1 #
2 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. Oracle designates this
8 # particular file as subject to the "Classpath" exception as provided
9 # by Oracle in the LICENSE file that accompanied this code.
10 #
11 # This code is distributed in the hope that it will be useful, but WITHOUT
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # version 2 for more details (a copy is included in the LICENSE file that
15 # accompanied this code).
16 #
17 # You should have received a copy of the GNU General Public License version
18 # 2 along with this work; if not, write to the Free Software Foundation,
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 #
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 # or visit www.oracle.com if you need additional information or have any
221 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSecurity.gmk)
222
223 zip-source:
224 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f ZipSource.gmk)
225
226 strip-binaries:
227 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f StripBinaries.gmk)
228
229 jrtfs-jar:
230 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f JrtfsJar.gmk)
231
232 jimages:
233 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk jimages)
234
235 profiles:
236 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk profiles)
237
238 mac-bundles:
239 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
240
241 ALL_TARGETS += source-tips bootcycle-images zip-security zip-source strip-binaries \
242 jrtfs-jar jimages profiles mac-bundles
243
244 ################################################################################
245 # Docs targets
246
247 docs-javadoc:
248 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
249
250 docs-jvmtidoc:
251 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
252
253 ALL_TARGETS += docs-javadoc docs-jvmtidoc
254
255 ################################################################################
256 # Build tests
257 #
258
259 prepare-test-image:
260 $(MKDIR) -p $(TEST_IMAGE_DIR)
261 $(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
262
263 build-test-hotspot-jtreg-native:
264 +($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk build-test-hotspot-jtreg-native)
265
266 test-image-hotspot-jtreg-native:
267 +($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk test-image-hotspot-jtreg-native)
268
269 build-test-jdk-jtreg-native:
270 +($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk build-test-jdk-jtreg-native)
271
272 test-image-jdk-jtreg-native:
273 +($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk test-image-jdk-jtreg-native)
274
275 ################################################################################
276 # Run tests
277
278 # Run tests specified by $(TEST), or the default test set.
279 test:
280 $(call RunTests, $(TEST))
281
282 test-hotspot-jtreg-native:
283 $(call RunTests, "hotspot_native_sanity")
284
285 test-jdk-jtreg-native:
286 $(call RunTests, "jdk_native_sanity")
287
288 test-make:
289 ($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
290
291 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native build-test-jdk-jtreg-native \
292 test-image-hotspot-jtreg-native test-image-jdk-jtreg-native test test-make
293
294 ################################################################################
295 # Verification targets
296
297 verify-modules:
298 @$(call TargetEnter)
299 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f CheckModules.gmk)
300 @$(call TargetExit)
301
302 ALL_TARGETS += verify-modules
303
304 ################################################################################
305 # Install targets
306
307 install:
308 +($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Install.gmk)
309
310 ALL_TARGETS += install
311
312 ################################################################################
403
404 zip-source: gensrc rmic
405
406 strip-binaries: libs launchers gendata copy
407
408 jrtfs-jar: buildtools-jdk
409
410 jimages: exploded-image zip-source strip-binaries source-tips demos samples \
411 jrtfs-jar
412
413 profiles: exploded-image strip-binaries source-tips
414
415 mac-bundles: jimages
416
417 bootcycle-images: jimages
418
419 docs-javadoc: gensrc rmic
420
421 docs-jvmtidoc: hotspot
422
423 test: jimages test-image
424
425 verify-modules: exploded-image
426
427 test-make: clean-test-make
428
429 test-image-hotspot-jtreg-native: build-test-hotspot-jtreg-native
430
431 test-image-jdk-jtreg-native: build-test-jdk-jtreg-native
432
433 endif
434
435 ################################################################################
436 # Virtual targets without recipes
437
438 buildtools: buildtools-langtools interim-langtools interim-corba interim-rmic \
439 buildtools-jdk
440
441 gensrc: $(GENSRC_TARGETS)
442
443 gendata: $(GENDATA_TARGETS)
444
445 copy: $(COPY_TARGETS)
446
447 java: $(JAVA_TARGETS)
448
449 rmic: $(RMIC_TARGETS)
450
451 libs: $(LIBS_TARGETS)
452
470 $(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
471
472 # The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
473 exploded-image: $(ALL_MODULE_TARGETS)
474
475 # The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
476 # and in line with this, our targets for creating these are named *-image[s].
477
478 # This target builds the product images, e.g. the JRE and JDK image
479 # (and possibly other, more specific versions)
480 product-images: jimages demos samples zip-security verify-modules
481
482 ifeq ($(OPENJDK_TARGET_OS), macosx)
483 product-images: mac-bundles
484 endif
485
486 # This target builds the documentation image
487 docs-image: docs-javadoc docs-jvmtidoc
488
489 # This target builds the test image
490 test-image: prepare-test-image test-image-hotspot-jtreg-native test-image-jdk-jtreg-native
491
492 # all-images is the top-most target, it builds all our deliverables ("images").
493 all-images: product-images test-image docs-image
494
495 ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
496 jdk.jdwp.agent-gensrc $(ALL_MODULE_TARGETS) exploded-image \
497 product-images docs-image test-image all-images
498
499 ################################################################################
500
501 # Traditional targets typically run by users.
502 # These can be considered aliases for the targets now named by a more
503 # "modern" naming scheme.
504 default: exploded-image
505 jdk: exploded-image
506 images: product-images
507 docs: docs-image
508 all: all-images
509
510 ALL_TARGETS += default jdk images docs all
511
512 ################################################################################
513 ################################################################################
514 #
515 # Clean targets
516 #
517 ################################################################################
518 # Clean targets are automatically run serially by the Makefile calling this
519 # file.
520
521 CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
522 images make-support test-make
523 CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
524 CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native
525 CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
526 CLEAN_PHASES := gensrc java native include
527 CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
528 CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
529 # Construct targets of the form clean-$module-$phase
530 CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
531 $(addprefix $m-, $(CLEAN_PHASES))))
532
533 # Remove everything, except the output from configure.
534 clean: $(CLEAN_DIR_TARGETS)
535 ($(CD) $(OUTPUT_ROOT) && $(RM) -r source_tips build.log* build-trace*.log*)
536 $(ECHO) Cleaned all build artifacts.
537
538 $(CLEAN_DIR_TARGETS):
539 $(call CleanDir,$(patsubst clean-%, %, $@))
540
541 $(CLEAN_TEST_TARGETS):
542 $(call CleanTest,$(patsubst clean-test-%, %, $@))
543
544 $(CLEAN_PHASE_TARGETS):
545 $(call Clean-$(patsubst clean-%,%, $@))
546
547 $(CLEAN_MODULE_TARGETS):
548 $(call CleanModule,$(patsubst clean-%, %, $@))
549
550 $(CLEAN_MODULE_PHASE_TARGETS):
551 $(call Clean-$(word 3, $(subst -,$(SPACE),$@)), \
552 $(word 2, $(subst -,$(SPACE),$@)))
553
554 # When removing the support dir, we must also remove jdk. Building classes has
555 # the side effect of generating native headers. The headers end up in support
556 # while classes and touch files end up in jdk.
557 clean-support: clean-jdk
558
559 clean-docs: clean-docstemp
560
561 # Remove everything, including configure configuration.
562 # If the output directory was created by configure and now becomes empty, remove it as well.
563 dist-clean: clean
564 ($(CD) $(OUTPUT_ROOT) && $(RM) -r *spec.gmk config.* configure-arguments \
565 Makefile compare.sh tmp javacservers)
566 $(if $(filter $(CONF_NAME),$(notdir $(OUTPUT_ROOT))), \
567 if test "x`$(LS) $(OUTPUT_ROOT)`" != x; then \
568 $(ECHO) "Warning: Not removing non-empty configuration directory for '$(CONF_NAME)'" ; \
569 else \
570 ($(CD) $(SRC_ROOT) && $(ECHO) "Removing configuration directory for '$(CONF_NAME)'" \
571 && $(RM) -r $(OUTPUT_ROOT)) \
572 fi \
573 )
574 $(ECHO) Cleaned everything, you will have to re-run configure.
575
576 ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_TEST_TARGETS) \
577 $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
578
579 ################################################################################
580
581 # Setup a rule for SPEC file that fails if executed. This check makes sure the
582 # configuration is up to date after changes to configure.
583 ifeq ($(findstring reconfigure, $(MAKECMDGOALS)), )
584 $(SPEC): $(wildcard $(SRC_ROOT)/common/autoconf/*)
585 @$(ECHO) "ERROR: $(SPEC) is not up to date."
586 @$(ECHO) "Please rerun configure! Easiest way to do this is by running"
587 @$(ECHO) "'make reconfigure'."
588 @$(ECHO) "It may also be ignored by setting IGNORE_OLD_CONFIG=true"
589 @if test "x$(IGNORE_OLD_CONFIG)" != "xtrue"; then exit 1; fi
590 endif
591
592 # The reconfigure target is automatically run serially from everything else
593 # by the Makefile calling this file.
594
595 reconfigure:
596 ifneq ($(CONFIGURE_COMMAND_LINE), )
597 @$(ECHO) "Re-running configure using arguments '$(CONFIGURE_COMMAND_LINE)'"
|