Hello,

I would rename the JVM_VARIANT_TARGETS to JVM_MAIN_LIB_TARGETS. The purpose of this target is to be the minimal amount of prerequisites before we can start linking to -ljvm. I would also move the definition of that variable down to its first use, like the other variables.

I'm not clear on the difference between JVM_BUILD_TARGETS and JVM_MAIN_TARGETS. They should probably be merged.

The docs targets comment needs a newline before it.

Otherwise this looks ok.

/Erik


On 2018-02-14 07:01, Steve Groeger wrote:
diff -r b2f2bdba0472 make/Main.gmk
--- a/make/Main.gmkFri Jan 26 11:27:53 2018 -0800
+++ b/make/Main.gmkWed Feb 14 14:37:15 2018 +0000
@@ -56,6 +56,9 @@
 # All modules for the current target platform.
 ALL_MODULES := $(call FindAllModules)
+# If not already set, set the JVM variant target so that the JVM will be built.
+JVM_VARIANT_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-libs
+
 
################################################################################
 
################################################################################
 #
@@ -645,7 +648,7 @@
   generate-exported-symbols: java.base-libs jdk.jdwp.agent-libs
   # Building one JVM variant is enough to start building the other libs
-  $(LIBS_TARGETS): hotspot-$(JVM_VARIANT_MAIN)-libs
+  $(LIBS_TARGETS): $(JVM_VARIANT_TARGETS)
   $(LAUNCHER_TARGETS): java.base-libs
@@ -722,8 +725,11 @@
     java.base-jmod: jrtfs-jar $(filter-out java.base-jmod, $(JMOD_TARGETS))
   endif
-  # Building java.base-jmod requires all of hotspot to be built.
-  java.base-jmod: hotspot
+  # If not already set, set the JVM target so that the JVM will be built.
+  JVM_MAIN_TARGETS ?= hotspot
+
+  # Building java.base-jmod requires all of VM (ie hotspot) to be built.
+  java.base-jmod: $(JVM_MAIN_TARGETS)
   # Declare dependencies from <module>-jmod to all other module targets
   # When creating a BUILDJDK, the java compilation has already been done by the
@@ -749,7 +755,7 @@
   # in java.base-copy) and tzdb.dat (done in java.base-gendata) to the
   # appropriate location otherwise jimage, jlink and jmod won't start. This
   # also applies when creating the buildjdk.
-  DEFAULT_JMOD_DEPS := java.base-libs java.base-copy java.base-gendata \
+  DEFAULT_JMOD_DEPS += java.base-libs java.base-copy java.base-gendata \
       jdk.jlink-launchers
   # When cross compiling and buildjdk is to be created, depend on creating the
   # buildjdk instead of the default dependencies.
@@ -824,9 +830,11 @@
   docs-javase-api-modulegraph: exploded-image buildtools-modules
   docs-reference-api-modulegraph: exploded-image buildtools-modules
-
+  # If not already set, then set the JVM specific docs targets
+  JVM_DOCS_TARGETS ?= hotspot-$(JVM_VARIANT_MAIN)-gensrc
+
   # The gensrc steps for hotspot and jdk.jdi create html spec files.
-  docs-jdk-specs: hotspot-$(JVM_VARIANT_MAIN)-gensrc jdk.jdi-gensrc \
+  docs-jdk-specs: $(JVM_DOCS_TARGETS) jdk.jdi-gensrc \
       docs-jdk-index
   docs-jdk-index: exploded-image buildtools-modules
@@ -893,8 +901,10 @@
 
################################################################################
 # Virtual targets without recipes
+# If not already set, set the JVM specific tools targets
+JVM_TOOLS_TARGETS ?= buildtools-hotspot
 buildtools: buildtools-langtools interim-langtools interim-rmic \
-    buildtools-jdk buildtools-hotspot
+    buildtools-jdk $(JVM_TOOLS_TARGETS)
 hotspot: $(HOTSPOT_VARIANT_TARGETS) hotspot-jsig
@@ -936,8 +946,11 @@
 $(foreach m, $(LAUNCHER_MODULES), $(eval $m: $m-launchers))
 $(foreach m, $(ALL_COPY_MODULES), $(eval $m: $m-copy))
+# If not already set, set the JVM specific build targets
+JVM_BUILD_TARGETS ?= hotspot
+
 # Building java.base includes building all of hotspot.
-java.base: hotspot
+java.base: $(JVM_BUILD_TARGETS)
 demos: demos-jdk
@@ -1004,10 +1017,15 @@
 # This target builds the documentation image
 docs-image: docs-jdk
+# If not already set, set the JVM specific targets to built the test image +JVM_TEST_IMAGE_TARGETS ?= test-image-hotspot-jtreg-native test-image-hotspot-gtest
+
 # This target builds the test image
-test-image: prepare-test-image test-image-hotspot-jtreg-native \
-    test-image-jdk-jtreg-native test-image-failure-handler test-image-hotspot-gtest \
-    test-image-demos-jdk
+test-image: prepare-test-image \
+    test-image-jdk-jtreg-native test-image-failure-handler \
+    test-image-demos-jdk $(JVM_TEST_IMAGE_TARGETS)
+
+################################################################################
 # all-images builds all our deliverables as images.
 all-images: product-images test-image docs-image
@@ -1146,7 +1164,10 @@
     $(MAKESUPPORT_OUTPUTDIR)/main-targets.gmk
 
################################################################################
+# Hook to include the corresponding custom file, if present.
+$(eval $(call IncludeCustomExtension, Main-post.gmk))
 .PHONY: $(ALL_TARGETS)
 FRC: # Force target
+

Reply via email to