make/Main.gmk
changeset 44027 3a3050924db2
parent 43927 f97a7c02d349
child 44078 673240c54c2e
equal deleted inserted replaced
44026:a46c32199211 44027:3a3050924db2
     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 :=
   421 endif
   422 endif
   422 
   423 
   423 ALL_TARGETS += $(INTERIM_JMOD_TARGETS) interim-image generate-link-opt-data
   424 ALL_TARGETS += $(INTERIM_JMOD_TARGETS) interim-image generate-link-opt-data
   424 
   425 
   425 ################################################################################
   426 ################################################################################
       
   427 # Generate test names for all JTReg test groups
       
   428 #
       
   429 
       
   430 define DeclareRunTestRecipe
       
   431   run-test-$1:
       
   432 	+($(CD) $(SRC_ROOT)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1")
       
   433 
       
   434 endef
       
   435 
       
   436 # ALL_NAMED_TESTS is defined in FindTests.gmk
       
   437 $(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t)))
       
   438 ALL_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS))
       
   439 
       
   440 ALL_TARGETS += $(ALL_TEST_TARGETS)
       
   441 
       
   442 ################################################################################
   426 # Build tests
   443 # Build tests
   427 #
   444 #
   428 
   445 
   429 prepare-test-image:
   446 prepare-test-image:
   430 	$(MKDIR) -p $(TEST_IMAGE_DIR)
   447 	$(MKDIR) -p $(TEST_IMAGE_DIR)
   443 	    build-test-jdk-jtreg-native)
   460 	    build-test-jdk-jtreg-native)
   444 
   461 
   445 test-image-jdk-jtreg-native:
   462 test-image-jdk-jtreg-native:
   446 	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
   463 	+($(CD) $(JDK_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregNative.gmk \
   447 	    test-image-jdk-jtreg-native)
   464 	    test-image-jdk-jtreg-native)
       
   465 
       
   466 run-test:
       
   467 	+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$(TEST)")
   448 
   468 
   449 ifeq ($(BUILD_GTEST), true)
   469 ifeq ($(BUILD_GTEST), true)
   450   test-image-hotspot-gtest:
   470   test-image-hotspot-gtest:
   451 	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk)
   471 	+($(CD) $(HOTSPOT_TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk)
   452 endif
   472 endif
   472 endif
   492 endif
   473 
   493 
   474 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
   494 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \
   475     test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
   495     test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \
   476     test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
   496     test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \
   477     test-failure-handler test-image-failure-handler test-image-hotspot-gtest
   497     test-failure-handler test-image-failure-handler test-image-hotspot-gtest \
       
   498     run-test
   478 
   499 
   479 ################################################################################
   500 ################################################################################
   480 # Run tests
   501 # Run tests
   481 
   502 
   482 # Run tests specified by $(TEST), or the default test set.
   503 # Run tests specified by $(TEST), or the default test set.
   755 
   776 
   756   docs-zip: docs-javadoc docs-copy
   777   docs-zip: docs-javadoc docs-copy
   757 
   778 
   758   test: jdk-image test-image
   779   test: jdk-image test-image
   759 
   780 
       
   781   run-test: jdk-image test-image
       
   782 
       
   783   # Declare dependency for all generated test targets
       
   784   $(foreach t, $(ALL_TEST_TARGETS), $(eval $t: jdk-image test-image))
       
   785 
   760   create-buildjdk-copy: jdk.jlink-java java.base-gendata \
   786   create-buildjdk-copy: jdk.jlink-java java.base-gendata \
   761       $(addsuffix -java, $(INTERIM_IMAGE_MODULES))
   787       $(addsuffix -java, $(INTERIM_IMAGE_MODULES))
   762 
   788 
   763   create-buildjdk-interim-image: create-buildjdk-copy
   789   create-buildjdk-interim-image: create-buildjdk-copy
   764 
   790 
  1029 	  @$(ECHO) $(sort $(ALL_TARGETS))
  1055 	  @$(ECHO) $(sort $(ALL_TARGETS))
  1030 
  1056 
  1031 print-modules:
  1057 print-modules:
  1032 	  @$(ECHO) $(sort $(ALL_MODULES))
  1058 	  @$(ECHO) $(sort $(ALL_MODULES))
  1033 
  1059 
       
  1060 print-tests:
       
  1061 	  @$(ECHO) $(sort $(ALL_NAMED_TESTS))
       
  1062 
  1034 create-main-targets-include:
  1063 create-main-targets-include:
  1035 	  $(call LogInfo, Generating main target list)
  1064 	  $(call LogInfo, Generating main target list)
  1036 	  @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
  1065 	  @$(ECHO) ALL_MAIN_TARGETS := $(sort $(ALL_TARGETS)) > \
  1037 	      $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
  1066 	      $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
  1038 
  1067