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