make/Images.gmk
changeset 36682 5203b786299e
parent 36543 a8ce27ddc757
child 36723 295e7ec5d8f9
--- a/make/Images.gmk	Fri Mar 25 16:50:20 2016 -0700
+++ b/make/Images.gmk	Wed Jul 05 21:29:38 2017 +0200
@@ -38,61 +38,23 @@
 
 ############################################################################
 
-MAIN_MODULES += java.se.ee java.smartcardio jdk.httpserver jdk.sctp \
-               jdk.security.auth jdk.security.jgss jdk.pack200 jdk.xml.dom \
-               jdk.accessibility jdk.internal.le jdk.dynalink \
-               jdk.scripting.nashorn jdk.scripting.nashorn.shell \
-               jdk.vm.ci jdk.management jdk.jsobject
-
-# providers
-PROVIDER_MODULES += jdk.charsets jdk.crypto.ec jdk.crypto.pkcs11 jdk.jvmstat jdk.jvmstat.rmi \
-               jdk.localedata jdk.naming.dns jdk.naming.rmi jdk.zipfs
-
-# tools
-TOOLS_MODULES += jdk.attach jdk.compiler \
-               jdk.javadoc jdk.jcmd jdk.jconsole jdk.hotspot.agent jdk.jartool \
-               jdk.jdeps jdk.jdi jdk.jdwp.agent jdk.jlink jdk.jshell \
-               jdk.policytool jdk.rmic jdk.xml.bind jdk.xml.ws jdk.internal.opt
-
-ifeq ($(OPENJDK_TARGET_OS), windows)
-  PROVIDER_MODULES += jdk.crypto.mscapi
-endif
-
-ifeq ($(OPENJDK_TARGET_OS), solaris)
-  PROVIDER_MODULES += jdk.crypto.ucrypto
-endif
+# All modules for the current target platform.
+ALL_MODULES := $(call FindAllModules)
 
-JRE_MODULES := $(filter-out $(MODULES_FILTER), $(MAIN_MODULES) $(PROVIDER_MODULES))
-JDK_MODULES := $(filter-out $(MODULES_FILTER), $(JRE_MODULES) $(TOOLS_MODULES))
+$(eval $(call ReadImportMetaData))
 
-# Param 1 - Name of module
-define ReadImportMetaData
-  ifneq ($$(wildcard $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties), )
-    include_in_jre :=
-    include_in_jdk :=
-    include $(IMPORT_MODULES_MAKE)/$$(strip $1)/build.properties
-    ifeq ($$(include_in_jre), true)
-      JRE_MODULES += $1
-    endif
-    ifeq ($$(include_in_jdk), true)
-      JDK_MODULES += $1
-    endif
-  else
-    # Default to include in all
-    JRE_MODULES += $1
-    JDK_MODULES += $1
-  endif
-endef
-
-IMPORTED_MODULES := $(call FindImportedModules)
-$(foreach m, $(IMPORTED_MODULES), $(eval $(call ReadImportMetaData, $m)))
+JRE_MODULES += $(filter-out $(MODULES_FILTER), $(BOOT_MODULES) $(PLATFORM_MODULES) $(JRE_TOOL_MODULES))
+JDK_MODULES += $(filter-out $(MODULES_FILTER), $(ALL_MODULES))
 
 # Compact builds have additional modules
-COMPACT_EXTRA_MODULES := jdk.localedata jdk.crypto.pkcs11 jdk.crypto.ec
-JRE_COMPACT1_MODULES := $(COMPACT_EXTRA_MODULES) java.compact1
-JRE_COMPACT2_MODULES := $(JRE_COMPACT1_MODULES) java.compact2 jdk.xml.dom jdk.httpserver
-JRE_COMPACT3_MODULES := $(JRE_COMPACT2_MODULES) java.compact3 java.smartcardio jdk.management \
-                        jdk.naming.dns jdk.naming.rmi jdk.sctp jdk.security.auth
+COMPACT1_EXTRA_MODULES := jdk.localedata jdk.crypto.pkcs11 jdk.crypto.ec
+COMPACT2_EXTRA_MODULES := jdk.xml.dom jdk.httpserver
+COMPACT3_EXTRA_MODULES := java.smartcardio jdk.management \
+    jdk.naming.dns jdk.naming.rmi jdk.sctp jdk.security.auth
+
+JRE_COMPACT1_MODULES := java.compact1 $(COMPACT1_EXTRA_MODULES)
+JRE_COMPACT2_MODULES := $(JRE_COMPACT1_MODULES) java.compact2 $(COMPACT2_EXTRA_MODULES)
+JRE_COMPACT3_MODULES := $(JRE_COMPACT2_MODULES) java.compact3 $(COMPACT3_EXTRA_MODULES)
 
 # Replacing double-comma with a single comma is to workaround the issue
 # with some version of make on windows that doesn't substitute spaces