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_%s := " "$(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 # Directories in which generated preview classes may exist.
79 # Currently this is restricted to generated value classes, but can be extended.
80 GENERATED_PREVIEW_SUBDIRS += \
81 $(SUPPORT_OUTPUTDIR)/gensrc-valueclasses \
82 #
83
84 TOP_SRC_DIRS += \
85 $(TOPDIR)/src \
86 #
87
88 SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
89 ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
90 SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
91 endif
92 SRC_SUBDIRS += share/classes
93
94 SPEC_SUBDIRS += share/specs
95
96 MAN_SUBDIRS += share/man $(TARGET_OS)/man
97
98 # The docs should include the sum of all man pages for all platforms
99 MAN_DOCS_SUBDIRS += share/man windows/man
100
101 # Find all module-info.java files for the current build target platform and
102 # configuration.
103 # Param 1 - Module to find for, set to * for finding all
133 $(call GetModuleNameFromModuleInfo, $(MODULE_INFOS))))
134
135 # Find all modules in a specific src dir
136 # Param 1 - Src dir to find modules in
137 FindModulesForSrcDir = \
138 $(sort $(filter-out $(MODULES_FILTER), \
139 $(call GetModuleNameFromModuleInfo, $(call FindModuleInfosForSrcDir, $1)) \
140 ))
141
142 FindImportedModules = \
143 $(filter-out $(MODULES_FILTER), \
144 $(if $(IMPORT_MODULES_CLASSES), $(notdir $(wildcard $(IMPORT_MODULES_CLASSES)/*))))
145
146 # Find all source dirs for a particular module
147 # $1 - Module to find source dirs for
148 FindModuleSrcDirs = \
149 $(strip $(wildcard \
150 $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
151 $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
152
153 # Find preview class source dirs for a particular module.
154 # Currently this is restricted to generated value classes, but can be extended.
155 # $1 - Module to find source dirs for
156 FindModulePreviewSrcDirs = \
157 $(strip $(wildcard \
158 $(addsuffix /$(strip $1), $(GENERATED_PREVIEW_SUBDIRS))))
159
160 # Find all specs dirs for a particular module
161 # $1 - Module to find specs dirs for
162 FindModuleSpecsDirs = \
163 $(strip $(wildcard \
164 $(foreach sub, $(SPEC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
165
166 # Find all man dirs for a particular module
167 # $1 - Module to find man dirs for
168 FindModuleManDirs = \
169 $(strip $(wildcard \
170 $(foreach sub, $(MAN_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
171
172 FindModuleManDirsForDocs = \
173 $(strip $(wildcard \
174 $(foreach sub, $(MAN_DOCS_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
175
176 # Construct the complete module source path
177 GetModuleSrcPath = \
178 $(call PathList, \
179 $(addsuffix /*, $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
180 $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
181
182 # Construct the complete module source path for preview classes.
183 # Currently this is restricted to generated value classes, but can be extended.
184 GetModulePreviewSrcPath = \
185 $(call PathList, \
186 $(addsuffix /*, $(GENERATED_PREVIEW_SUBDIRS) $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
187 $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
188
189 ################################################################################
190 # Extract module dependencies from module-info.java files, both normal
191 # dependencies ("requires"), and indirect exports ("requires transitive").
192
193 MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
194
195 MODULE_INFOS := $(call FindAllModuleInfos, *)
196
197 ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
198 $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
199 $(call DependOnVariable, MODULE_INFOS, $(MAKESUPPORT_OUTPUTDIR)/MODULE_INFOS.vardeps)
200 $(call MakeTargetDir)
201 $(RM) $@
202 $(foreach m, $(MODULE_INFOS), \
203 ( $(PRINTF) "DEPS_%s := " "$(call GetModuleNameFromModuleInfo, $m)" && \
204 $(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \
205 BEGIN { if (MODULE != "java.base") printf(" java.base"); } \
206 /^ *requires/ { sub(/;/, ""); \
207 sub(/requires /, " "); \
208 sub(/ static /, " "); \
|