make/Main.gmk
changeset 44169 2cadf0cf763e
parent 44078 673240c54c2e
child 44397 f932d6b9f7fe
equal deleted inserted replaced
44168:604022687602 44169:2cadf0cf763e
     1 #
     1 #
     2 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2011, 2017, 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
    41 include $(SRC_ROOT)/make/MainSupport.gmk
    41 include $(SRC_ROOT)/make/MainSupport.gmk
    42 
    42 
    43 # Load the vital tools for all the makefiles.
    43 # Load the vital tools for all the makefiles.
    44 include $(SRC_ROOT)/make/common/MakeBase.gmk
    44 include $(SRC_ROOT)/make/common/MakeBase.gmk
    45 include $(SRC_ROOT)/make/common/Modules.gmk
    45 include $(SRC_ROOT)/make/common/Modules.gmk
       
    46 include $(SRC_ROOT)/make/common/FindTests.gmk
    46 
    47 
    47 # Declare ALL_TARGETS as an immediate variable. This variable is a list of all
    48 # Declare ALL_TARGETS as an immediate variable. This variable is a list of all
    48 # valid top level targets. It's used to declare them all as PHONY and to
    49 # valid top level targets. It's used to declare them all as PHONY and to
    49 # generate the -only targets.
    50 # generate the -only targets.
    50 ALL_TARGETS :=
    51 ALL_TARGETS :=
   369 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-copy)
   370 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-copy)
   370 
   371 
   371 docs-zip:
   372 docs-zip:
   372 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-zip)
   373 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs-zip)
   373 
   374 
   374 ALL_TARGETS += docs-javadoc docs-copy docs-zip
   375 update-build-docs:
       
   376 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f UpdateBuildDocs.gmk)
       
   377 
       
   378 ALL_TARGETS += docs-javadoc docs-copy docs-zip update-build-docs
   375 
   379 
   376 ################################################################################
   380 ################################################################################
   377 # Cross compilation support
   381 # Cross compilation support
   378 
   382 
   379 ifeq ($(CREATING_BUILDJDK), true)
   383 ifeq ($(CREATING_BUILDJDK), true)
   421 endif
   425 endif
   422 
   426 
   423 ALL_TARGETS += $(INTERIM_JMOD_TARGETS) interim-image generate-link-opt-data
   427 ALL_TARGETS += $(INTERIM_JMOD_TARGETS) interim-image generate-link-opt-data
   424 
   428 
   425 ################################################################################
   429 ################################################################################
       
   430 # Generate test names for all JTReg test groups
       
   431 #
       
   432 
       
   433 define DeclareRunTestRecipe
       
   434   run-test-$1:
       
   435 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1")
       
   436 
       
   437 endef
       
   438 
       
   439 # ALL_NAMED_TESTS is defined in FindTests.gmk
       
   440 $(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t)))
       
   441 ALL_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS))
       
   442 
       
   443 ALL_TARGETS += $(ALL_TEST_TARGETS)
       
   444 
       
   445 ################################################################################
   426 # Build tests
   446 # Build tests
   427 #
   447 #
   428 
   448 
   429 prepare-test-image:
   449 prepare-test-image:
   430 	$(MKDIR) -p $(TEST_IMAGE_DIR)
   450 	$(MKDIR) -p $(TEST_IMAGE_DIR)
   443 	    build-test-jdk-jtreg-native)
   463 	    build-test-jdk-jtreg-native)
   444 
   464 
   445 test-image-jdk-jtreg-native:
   465 test-image-jdk-jtreg-native:
   446 	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
   466 	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
   447 	    test-image-jdk-jtreg-native)
   467 	    test-image-jdk-jtreg-native)
       
   468 
       
   469 run-test:
       
   470 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$(TEST)")
   448 
   471 
   449 ifeq ($(BUILD_GTEST), true)
   472 ifeq ($(BUILD_GTEST), true)
   450   test-image-hotspot-gtest:
   473   test-image-hotspot-gtest:
   451 	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk)
   474 	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk)
   452 endif
   475 endif
   472 endif
   495 endif
   473 
   496 
   474 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
   497 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
   475     test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
   498     test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
   476     test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
   499     test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
   477     test-failure-handler test-image-failure-handler test-image-hotspot-gtest
   500     test-failure-handler test-image-failure-handler test-image-hotspot-gtest \
       
   501     run-test
   478 
   502 
   479 ################################################################################
   503 ################################################################################
   480 # Run tests
   504 # Run tests
   481 
   505 
   482 # Run tests specified by $(TEST), or the default test set.
   506 # Run tests specified by $(TEST), or the default test set.
   631 
   655 
   632   # The swing beans need to have java base properly generated to avoid errors
   656   # The swing beans need to have java base properly generated to avoid errors
   633   # in javadoc.
   657   # in javadoc.
   634   java.desktop-gensrc-jdk: java.base-gensrc
   658   java.desktop-gensrc-jdk: java.base-gensrc
   635 
   659 
   636   # The annotation processing for jdk.vm.ci and jdk.vm.compiler needs classes
   660   # The annotation processing for jdk.internal.vm.ci and jdk.internal.vm.compiler
   637   # from the current JDK.
   661   # needs classes from the current JDK.
   638   jdk.vm.ci-gensrc-hotspot: $(addsuffix -java, \
   662   jdk.internal.vm.ci-gensrc-hotspot: $(addsuffix -java, \
   639       $(call FindTransitiveDepsForModule, jdk.vm.ci))
   663       $(call FindTransitiveDepsForModule, jdk.internal.vm.ci))
   640   jdk.vm.compiler-gensrc-hotspot: $(addsuffix -java, \
   664   jdk.internal.vm.compiler-gensrc-hotspot: $(addsuffix -java, \
   641       $(call FindTransitiveDepsForModule, jdk.vm.compiler))
   665       $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler))
   642 
   666 
   643   # For jdk.vm.compiler, the gensrc step is generating a module-info.java.extra
   667   # For jdk.internal.vm.compiler, the gensrc step is generating a module-info.java.extra
   644   # file to be processed by the gensrc-moduleinfo target.
   668   # file to be processed by the gensrc-moduleinfo target.
   645   jdk.vm.compiler-gensrc-moduleinfo: jdk.vm.compiler-gensrc-hotspot
   669   jdk.internal.vm.compiler-gensrc-moduleinfo: jdk.internal.vm.compiler-gensrc-hotspot
   646 
   670 
   647   # Explicitly add dependencies for special targets
   671   # Explicitly add dependencies for special targets
   648   java.base-java: unpack-sec
   672   java.base-java: unpack-sec
   649 
   673 
   650   jdk.jdeps-gendata: java rmic
   674   jdk.jdeps-gendata: java rmic
   652   # Declare dependencies between jmod targets.
   676   # Declare dependencies between jmod targets.
   653   # java.base jmod needs jrt-fs.jar and access to the other jmods to be built.
   677   # java.base jmod needs jrt-fs.jar and access to the other jmods to be built.
   654   # When creating a BUILDJDK, we don't need to add hashes to java.base, thus
   678   # When creating a BUILDJDK, we don't need to add hashes to java.base, thus
   655   # we don't need to depend on all other jmods
   679   # we don't need to depend on all other jmods
   656   ifneq ($(CREATING_BUILDJDK), true)
   680   ifneq ($(CREATING_BUILDJDK), true)
   657     java.base-jmod: jrtfs-jar $(filter-out java.base-jmod \
   681     java.base-jmod: jrtfs-jar $(filter-out java.base-jmod, $(JMOD_TARGETS))
   658         $(addsuffix -jmod, $(call FindAllUpgradeableModules)), $(JMOD_TARGETS))
       
   659   endif
   682   endif
   660 
   683 
   661   # Building java.base-jmod requires all of hotspot to be built.
   684   # Building java.base-jmod requires all of hotspot to be built.
   662   java.base-jmod: hotspot
   685   java.base-jmod: hotspot
   663 
   686 
   726       generate-link-opt-data: interim-image
   749       generate-link-opt-data: interim-image
   727     endif
   750     endif
   728     generate-link-opt-data: buildtools-jdk
   751     generate-link-opt-data: buildtools-jdk
   729 
   752 
   730     # The generated classlist needs to go into java.base-jmod.
   753     # The generated classlist needs to go into java.base-jmod.
   731     java.base-jmod jdk-image jre-image: generate-link-opt-data
   754     java.base-jmod jdk.jlink-jmod jdk-image jre-image: generate-link-opt-data
   732   endif
   755   endif
   733 
   756 
   734   release-file: create-source-revision-tracker
   757   release-file: create-source-revision-tracker
   735 
   758 
   736   jdk-image: jmods zip-source demos samples release-file
   759   jdk-image: jmods zip-source demos samples release-file
   755   docs-copy: hotspot-$(JVM_VARIANT_MAIN)-gensrc jdk.jdi-gensrc
   778   docs-copy: hotspot-$(JVM_VARIANT_MAIN)-gensrc jdk.jdi-gensrc
   756 
   779 
   757   docs-zip: docs-javadoc docs-copy
   780   docs-zip: docs-javadoc docs-copy
   758 
   781 
   759   test: jdk-image test-image
   782   test: jdk-image test-image
       
   783 
       
   784   run-test: jdk-image test-image
       
   785 
       
   786   # Declare dependency for all generated test targets
       
   787   $(foreach t, $(ALL_TEST_TARGETS), $(eval $t: jdk-image test-image))
   760 
   788 
   761   create-buildjdk-copy: jdk.jlink-java java.base-gendata \
   789   create-buildjdk-copy: jdk.jlink-java java.base-gendata \
   762       $(addsuffix -java, $(INTERIM_IMAGE_MODULES))
   790       $(addsuffix -java, $(INTERIM_IMAGE_MODULES))
   763 
   791 
   764   create-buildjdk-interim-image: create-buildjdk-copy
   792   create-buildjdk-interim-image: create-buildjdk-copy
  1030 	  @$(ECHO) $(sort $(ALL_TARGETS))
  1058 	  @$(ECHO) $(sort $(ALL_TARGETS))
  1031 
  1059 
  1032 print-modules:
  1060 print-modules:
  1033 	  @$(ECHO) $(sort $(ALL_MODULES))
  1061 	  @$(ECHO) $(sort $(ALL_MODULES))
  1034 
  1062 
       
  1063 print-tests:
       
  1064 	  @$(ECHO) $(sort $(ALL_NAMED_TESTS))
       
  1065 
  1035 create-main-targets-include:
  1066 create-main-targets-include:
  1036 	  $(call LogInfo, Generating main target list)
  1067 	  $(call LogInfo, Generating main target list)
  1037 	  @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
  1068 	  @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
  1038 	      $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
  1069 	      $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
  1039 
  1070