make/Main.gmk
changeset 29156 bd932374081c
parent 28899 ceb890ca5f39
child 29159 7fed45c53518
equal deleted inserted replaced
29153:874d76e4699d 29156:bd932374081c
     1 #
     1 #
     2 # Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
     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.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     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
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
   236 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk profiles)
   236 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Images.gmk profiles)
   237 
   237 
   238 mac-bundles:
   238 mac-bundles:
   239 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
   239 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f MacBundles.gmk)
   240 
   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 
   241 prepare-test-image:
   259 prepare-test-image:
   242 	$(MKDIR) -p $(TEST_IMAGE_DIR)
   260 	$(MKDIR) -p $(TEST_IMAGE_DIR)
   243 	$(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
   261 	$(ECHO) > $(TEST_IMAGE_DIR)/Readme.txt 'JDK test image'
   244 
   262 
   245 ALL_TARGETS += source-tips bootcycle-images zip-security zip-source strip-binaries \
   263 build-test-hotspot-jtreg-native:
   246     jrtfs-jar jimages profiles mac-bundles prepare-test-image
   264 	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
   247 
   265 	    build-test-hotspot-jtreg-native)
   248 ################################################################################
   266 
   249 # Docs targets
   267 test-image-hotspot-jtreg-native:
   250 
   268 	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
   251 docs-javadoc:
   269 	    test-image-hotspot-jtreg-native)
   252 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
   270 
   253 
   271 build-test-jdk-jtreg-native:
   254 docs-jvmtidoc:
   272 	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
   255 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk jvmtidocs)
   273 	    build-test-jdk-jtreg-native)
   256 
   274 
   257 ALL_TARGETS += docs-javadoc docs-jvmtidoc
   275 test-image-jdk-jtreg-native:
   258 
   276 	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
   259 ################################################################################
   277 	    test-image-jdk-jtreg-native)
   260 # Test target
   278 
   261 
   279 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
       
   280     test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
       
   281     test-image-jdk-jtreg-native
       
   282 
       
   283 ################################################################################
       
   284 # Run tests
       
   285 
       
   286 # Run tests specified by $(TEST), or the default test set.
   262 test:
   287 test:
   263 	($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \
   288 	$(call RunTests, $(TEST))
   264 	    JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) \
   289 
   265 	    ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $(TEST)) || true
   290 test-hotspot-jtreg-native:
       
   291 	$(call RunTests, "hotspot_native_sanity")
       
   292 
       
   293 test-jdk-jtreg-native:
       
   294 	$(call RunTests, "jdk_native_sanity")
   266 
   295 
   267 test-make:
   296 test-make:
   268 	($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
   297 	($(CD) $(SRC_ROOT)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET))
   269 
   298 
   270 ALL_TARGETS += test test-make
   299 ALL_TARGETS += test test-hotspot-jtreg-native test-jdk-jtreg-native test-make
   271 
   300 
   272 ################################################################################
   301 ################################################################################
   273 # Verification targets
   302 # Verification targets
   274 
   303 
   275 verify-modules:
   304 verify-modules:
   396 
   425 
   397   docs-javadoc: gensrc rmic
   426   docs-javadoc: gensrc rmic
   398 
   427 
   399   docs-jvmtidoc: hotspot
   428   docs-jvmtidoc: hotspot
   400 
   429 
   401   test: jimages
   430   test: jimages test-image
   402 
   431 
   403   verify-modules: exploded-image
   432   verify-modules: exploded-image
   404 
   433 
   405   test-make: clean-test-make
   434   test-make: clean-test-make
       
   435 
       
   436   test-image-hotspot-jtreg-native: build-test-hotspot-jtreg-native
       
   437 
       
   438   test-image-jdk-jtreg-native: build-test-jdk-jtreg-native
   406 
   439 
   407 endif
   440 endif
   408 
   441 
   409 ################################################################################
   442 ################################################################################
   410 # Virtual targets without recipes
   443 # Virtual targets without recipes
   444     $(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
   477     $(GENDATA_MODULES) $(LIBS_MODULES) $(LAUNCHER_MODULES) $(COPY_MODULES))
   445 
   478 
   446 # The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
   479 # The "exploded image" is a locally runnable JDK in $(BUILD_OUTPUT)/jdk.
   447 exploded-image: $(ALL_MODULE_TARGETS)
   480 exploded-image: $(ALL_MODULE_TARGETS)
   448 
   481 
   449 # The $(BUILD_OUTPUT)/images directory contain the resulting deliverables, 
   482 # The $(BUILD_OUTPUT)/images directory contain the resulting deliverables,
   450 # and in line with this, our targets for creating these are named *-image[s].
   483 # and in line with this, our targets for creating these are named *-image[s].
   451 
   484 
   452 # This target builds the product images, e.g. the JRE and JDK image
   485 # This target builds the product images, e.g. the JRE and JDK image
   453 # (and possibly other, more specific versions)
   486 # (and possibly other, more specific versions)
   454 product-images: jimages demos samples zip-security verify-modules
   487 product-images: jimages demos samples zip-security verify-modules
   459 
   492 
   460 # This target builds the documentation image
   493 # This target builds the documentation image
   461 docs-image: docs-javadoc docs-jvmtidoc
   494 docs-image: docs-javadoc docs-jvmtidoc
   462 
   495 
   463 # This target builds the test image
   496 # This target builds the test image
   464 test-image: prepare-test-image
   497 test-image: prepare-test-image test-image-hotspot-jtreg-native \
       
   498     test-image-jdk-jtreg-native
   465 
   499 
   466 # all-images is the top-most target, it builds all our deliverables ("images").
   500 # all-images is the top-most target, it builds all our deliverables ("images").
   467 all-images: product-images test-image docs-image
   501 all-images: product-images test-image docs-image
   468 
   502 
   469 ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
   503 ALL_TARGETS += buildtools gensrc gendata copy java rmic libs launchers \
   493 # file.
   527 # file.
   494 
   528 
   495 CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
   529 CLEAN_DIRS += hotspot jdk bootcycle-build test buildtools support \
   496     images make-support test-make
   530     images make-support test-make
   497 CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
   531 CLEAN_DIR_TARGETS := $(addprefix clean-, $(CLEAN_DIRS))
       
   532 CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native
       
   533 CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS))
   498 CLEAN_PHASES := gensrc java native include
   534 CLEAN_PHASES := gensrc java native include
   499 CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
   535 CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES))
   500 CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
   536 CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES))
   501 # Construct targets of the form clean-$module-$phase
   537 # Construct targets of the form clean-$module-$phase
   502 CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
   538 CLEAN_MODULE_PHASE_TARGETS := $(addprefix clean-, $(foreach m, $(ALL_MODULES), \
   507 	($(CD) $(OUTPUT_ROOT) && $(RM) -r source_tips build.log* build-trace*.log*)
   543 	($(CD) $(OUTPUT_ROOT) && $(RM) -r source_tips build.log* build-trace*.log*)
   508 	$(ECHO) Cleaned all build artifacts.
   544 	$(ECHO) Cleaned all build artifacts.
   509 
   545 
   510 $(CLEAN_DIR_TARGETS):
   546 $(CLEAN_DIR_TARGETS):
   511 	$(call CleanDir,$(patsubst clean-%, %, $@))
   547 	$(call CleanDir,$(patsubst clean-%, %, $@))
       
   548 
       
   549 $(CLEAN_TEST_TARGETS):
       
   550 	$(call CleanTest,$(patsubst clean-test-%, %, $@))
   512 
   551 
   513 $(CLEAN_PHASE_TARGETS):
   552 $(CLEAN_PHASE_TARGETS):
   514 	$(call Clean-$(patsubst clean-%,%, $@))
   553 	$(call Clean-$(patsubst clean-%,%, $@))
   515 
   554 
   516 $(CLEAN_MODULE_TARGETS):
   555 $(CLEAN_MODULE_TARGETS):
   540 	        && $(RM) -r $(OUTPUT_ROOT)) \
   579 	        && $(RM) -r $(OUTPUT_ROOT)) \
   541 	  fi \
   580 	  fi \
   542 	)
   581 	)
   543 	$(ECHO) Cleaned everything, you will have to re-run configure.
   582 	$(ECHO) Cleaned everything, you will have to re-run configure.
   544 
   583 
   545 ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_PHASE_TARGETS) \
   584 ALL_TARGETS += clean dist-clean $(CLEAN_DIR_TARGETS) $(CLEAN_TEST_TARGETS) \
   546     $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
   585     $(CLEAN_PHASE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_MODULE_PHASE_TARGETS)
   547 
   586 
   548 ################################################################################
   587 ################################################################################
   549 
   588 
   550 # Setup a rule for SPEC file that fails if executed. This check makes sure the
   589 # 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.
   590 # configuration is up to date after changes to configure.