make/common/Modules.gmk
changeset 37975 551c5d86de79
parent 37973 922326ad0c94
child 38626 68d286c03952
--- a/make/common/Modules.gmk	Mon May 16 12:33:22 2016 +0200
+++ b/make/common/Modules.gmk	Thu May 19 17:24:50 2016 +0200
@@ -86,6 +86,10 @@
     java.xml.ws \
     #
 
+# Modules explicitly declared as not being upgradeable even though they require
+# an upgradeable module.
+NON_UPGRADEABLE_MODULES +=
+
 AGGREGATOR_MODULES += \
     java.compact1 \
     java.compact2 \
@@ -245,6 +249,19 @@
             $(foreach n, $(call FindDepsForModule, $m), \
                  $(call FindDepsForModule, $n))))
 
+# Upgradeable modules are those that are either defined as upgradeable or that
+# require an upradeable module.
+FindAllUpgradeableModules = \
+    $(filter-out $(MODULES_FILTER) $(NON_UPGRADEABLE_MODULES), \
+        $(sort $(UPGRADEABLE_MODULES) $(foreach m, \
+            $(filter-out $(UPGRADEABLE_MODULES), $(call FindAllModules)), \
+          $(if $(filter $(UPGRADEABLE_MODULES), \
+              $(call FindTransitiveDepsForModule, $m)), \
+            $m \
+          ) \
+        )) \
+    )
+
 ################################################################################
 
 # Param 1 - Name of module