58 ifeq ($(INCLUDE_JVMCI), false)
59 MODULES_FILTER += jdk.internal.vm.ci
60 MODULES_FILTER += jdk.graal.compiler
61 MODULES_FILTER += jdk.graal.compiler.management
62 endif
63
64 # jpackage is only on windows, macosx, and linux
65 ifeq ($(call isTargetOs, windows macosx linux), false)
66 MODULES_FILTER += jdk.jpackage
67 endif
68
69 ################################################################################
70 # Module list macros
71
72 # Use append so that the custom extension may add to these variables
73
74 GENERATED_SRC_DIRS += \
75 $(SUPPORT_OUTPUTDIR)/gensrc \
76 #
77
78 TOP_SRC_DIRS += \
79 $(TOPDIR)/src \
80 #
81
82 SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
83 ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
84 SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
85 endif
86 SRC_SUBDIRS += share/classes
87
88 SPEC_SUBDIRS += share/specs
89
90 MAN_SUBDIRS += share/man $(TARGET_OS)/man
91
92 # The docs should include the sum of all man pages for all platforms
93 MAN_DOCS_SUBDIRS += share/man windows/man
94
95 # Find all module-info.java files for the current build target platform and
96 # configuration.
97 # Param 1 - Module to find for, set to * for finding all
127 $(call GetModuleNameFromModuleInfo, $(MODULE_INFOS))))
128
129 # Find all modules in a specific src dir
130 # Param 1 - Src dir to find modules in
131 FindModulesForSrcDir = \
132 $(sort $(filter-out $(MODULES_FILTER), \
133 $(call GetModuleNameFromModuleInfo, $(call FindModuleInfosForSrcDir, $1)) \
134 ))
135
136 FindImportedModules = \
137 $(filter-out $(MODULES_FILTER), \
138 $(if $(IMPORT_MODULES_CLASSES), $(notdir $(wildcard $(IMPORT_MODULES_CLASSES)/*))))
139
140 # Find all source dirs for a particular module
141 # $1 - Module to find source dirs for
142 FindModuleSrcDirs = \
143 $(strip $(wildcard \
144 $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
145 $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
146
147 # Find all specs dirs for a particular module
148 # $1 - Module to find specs dirs for
149 FindModuleSpecsDirs = \
150 $(strip $(wildcard \
151 $(foreach sub, $(SPEC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
152
153 # Find all man dirs for a particular module
154 # $1 - Module to find man dirs for
155 FindModuleManDirs = \
156 $(strip $(wildcard \
157 $(foreach sub, $(MAN_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
158
159 FindModuleManDirsForDocs = \
160 $(strip $(wildcard \
161 $(foreach sub, $(MAN_DOCS_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
162
163 # Construct the complete module source path
164 GetModuleSrcPath = \
165 $(call PathList, \
166 $(addsuffix /*, $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
167 $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
168
169 ################################################################################
170 # Extract module dependencies from module-info.java files, both normal
171 # dependencies ("requires"), and indirect exports ("requires transitive").
172
173 MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
174
175 MODULE_INFOS := $(call FindAllModuleInfos, *)
176
177 ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
178 $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
179 $(call DependOnVariable, MODULE_INFOS, $(MAKESUPPORT_OUTPUTDIR)/MODULE_INFOS.vardeps)
180 $(call MakeTargetDir)
181 $(RM) $@
182 $(foreach m, $(MODULE_INFOS), \
183 ( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) := " && \
184 $(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \
185 BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
186 /^ *requires/ { sub(/;/, ""); \
187 sub(/requires /, " "); \
188 sub(/ static /, " "); \
|
58 ifeq ($(INCLUDE_JVMCI), false)
59 MODULES_FILTER += jdk.internal.vm.ci
60 MODULES_FILTER += jdk.graal.compiler
61 MODULES_FILTER += jdk.graal.compiler.management
62 endif
63
64 # jpackage is only on windows, macosx, and linux
65 ifeq ($(call isTargetOs, windows macosx linux), false)
66 MODULES_FILTER += jdk.jpackage
67 endif
68
69 ################################################################################
70 # Module list macros
71
72 # Use append so that the custom extension may add to these variables
73
74 GENERATED_SRC_DIRS += \
75 $(SUPPORT_OUTPUTDIR)/gensrc \
76 #
77
78 GENERATED_VALUE_CLASS_SUBDIRS += \
79 $(SUPPORT_OUTPUTDIR)/gensrc-valueclasses \
80 #
81
82 TOP_SRC_DIRS += \
83 $(TOPDIR)/src \
84 #
85
86 SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
87 ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
88 SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
89 endif
90 SRC_SUBDIRS += share/classes
91
92 SPEC_SUBDIRS += share/specs
93
94 MAN_SUBDIRS += share/man $(TARGET_OS)/man
95
96 # The docs should include the sum of all man pages for all platforms
97 MAN_DOCS_SUBDIRS += share/man windows/man
98
99 # Find all module-info.java files for the current build target platform and
100 # configuration.
101 # Param 1 - Module to find for, set to * for finding all
131 $(call GetModuleNameFromModuleInfo, $(MODULE_INFOS))))
132
133 # Find all modules in a specific src dir
134 # Param 1 - Src dir to find modules in
135 FindModulesForSrcDir = \
136 $(sort $(filter-out $(MODULES_FILTER), \
137 $(call GetModuleNameFromModuleInfo, $(call FindModuleInfosForSrcDir, $1)) \
138 ))
139
140 FindImportedModules = \
141 $(filter-out $(MODULES_FILTER), \
142 $(if $(IMPORT_MODULES_CLASSES), $(notdir $(wildcard $(IMPORT_MODULES_CLASSES)/*))))
143
144 # Find all source dirs for a particular module
145 # $1 - Module to find source dirs for
146 FindModuleSrcDirs = \
147 $(strip $(wildcard \
148 $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
149 $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
150
151 # Find value class source dirs for a particular module (only generated)
152 # $1 - Module to find source dirs for
153 FindModuleValueClassSrcDirs = \
154 $(strip $(wildcard \
155 $(addsuffix /$(strip $1), $(GENERATED_VALUE_CLASS_SUBDIRS))))
156
157 # Find all specs dirs for a particular module
158 # $1 - Module to find specs dirs for
159 FindModuleSpecsDirs = \
160 $(strip $(wildcard \
161 $(foreach sub, $(SPEC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
162
163 # Find all man dirs for a particular module
164 # $1 - Module to find man dirs for
165 FindModuleManDirs = \
166 $(strip $(wildcard \
167 $(foreach sub, $(MAN_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
168
169 FindModuleManDirsForDocs = \
170 $(strip $(wildcard \
171 $(foreach sub, $(MAN_DOCS_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
172
173 # Construct the complete module source path
174 GetModuleSrcPath = \
175 $(call PathList, \
176 $(addsuffix /*, $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
177 $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
178
179 # Construct the complete module source path for value classes
180 GetModuleValueClassSrcPath = \
181 $(call PathList, \
182 $(addsuffix /*, $(GENERATED_VALUE_CLASS_SUBDIRS) $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
183 $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
184
185 ################################################################################
186 # Extract module dependencies from module-info.java files, both normal
187 # dependencies ("requires"), and indirect exports ("requires transitive").
188
189 MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
190
191 MODULE_INFOS := $(call FindAllModuleInfos, *)
192
193 ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
194 $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
195 $(call DependOnVariable, MODULE_INFOS, $(MAKESUPPORT_OUTPUTDIR)/MODULE_INFOS.vardeps)
196 $(call MakeTargetDir)
197 $(RM) $@
198 $(foreach m, $(MODULE_INFOS), \
199 ( $(PRINTF) "DEPS_$(call GetModuleNameFromModuleInfo, $m) := " && \
200 $(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \
201 BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
202 /^ *requires/ { sub(/;/, ""); \
203 sub(/requires /, " "); \
204 sub(/ static /, " "); \
|