< prev index next >

make/common/Modules.gmk

Print this page

 51 
 52 # Some platforms don't have the serviceability agent
 53 ifeq ($(INCLUDE_SA), false)
 54   MODULES_FILTER += jdk.hotspot.agent
 55 endif
 56 
 57 # jpackage is only on windows, macosx, and linux
 58 ifeq ($(call isTargetOs, windows macosx linux), false)
 59   MODULES_FILTER += jdk.jpackage
 60 endif
 61 
 62 ################################################################################
 63 # Module list macros
 64 
 65 # Use append so that the custom extension may add to these variables
 66 
 67 GENERATED_SRC_DIRS += \
 68     $(SUPPORT_OUTPUTDIR)/gensrc \
 69     #
 70 






 71 TOP_SRC_DIRS += \
 72     $(TOPDIR)/src \
 73     #
 74 
 75 SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
 76 ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
 77   SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
 78 endif
 79 SRC_SUBDIRS += share/classes
 80 
 81 SPEC_SUBDIRS += share/specs
 82 
 83 MAN_SUBDIRS += share/man $(TARGET_OS)/man
 84 
 85 # The docs should include the sum of all man pages for all platforms
 86 MAN_DOCS_SUBDIRS += share/man windows/man
 87 
 88 # Find all module-info.java files for the current build target platform and
 89 # configuration.
 90 # Param 1 - Module to find for, set to * for finding all

120     $(call GetModuleNameFromModuleInfo, $(MODULE_INFOS))))
121 
122 # Find all modules in a specific src dir
123 # Param 1 - Src dir to find modules in
124 FindModulesForSrcDir = \
125     $(sort $(filter-out $(MODULES_FILTER), \
126         $(call GetModuleNameFromModuleInfo, $(call FindModuleInfosForSrcDir, $1)) \
127     ))
128 
129 FindImportedModules = \
130     $(filter-out $(MODULES_FILTER), \
131     $(if $(IMPORT_MODULES_CLASSES), $(notdir $(wildcard $(IMPORT_MODULES_CLASSES)/*))))
132 
133 # Find all source dirs for a particular module
134 # $1 - Module to find source dirs for
135 FindModuleSrcDirs = \
136     $(strip $(wildcard \
137         $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
138         $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
139 







140 # Find all specs dirs for a particular module
141 # $1 - Module to find specs dirs for
142 FindModuleSpecsDirs = \
143     $(strip $(wildcard \
144         $(foreach sub, $(SPEC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
145 
146 # Find all man dirs for a particular module
147 # $1 - Module to find man dirs for
148 FindModuleManDirs = \
149     $(strip $(wildcard \
150         $(foreach sub, $(MAN_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
151 
152 FindModuleManDirsForDocs = \
153     $(strip $(wildcard \
154         $(foreach sub, $(MAN_DOCS_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
155 
156 # Construct the complete module source path
157 GetModuleSrcPath = \
158     $(call PathList, \
159         $(addsuffix /*, $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
160         $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
161 







162 ################################################################################
163 # Extract module dependencies from module-info.java files, both normal
164 # dependencies ("requires"), and indirect exports ("requires transitive").
165 
166 MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
167 
168 MODULE_INFOS := $(call FindAllModuleInfos, *)
169 
170 ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
171   $(MODULE_DEPS_MAKEFILE): $(MODULE_INFOS) \
172       $(call DependOnVariable, MODULE_INFOS, $(MAKESUPPORT_OUTPUTDIR)/MODULE_INFOS.vardeps)
173 	$(call MakeTargetDir)
174 	$(RM) $@
175 	$(foreach m, $(MODULE_INFOS), \
176 	    ( $(PRINTF) "DEPS_%s := " "$(call GetModuleNameFromModuleInfo, $m)" && \
177 	      $(AWK) -v MODULE=$(call GetModuleNameFromModuleInfo, $m) ' \
178 	          BEGIN      { if (MODULE != "java.base") printf(" java.base"); } \
179 	          /^ *requires/ { sub(/;/, ""); \
180 	                          sub(/requires /, " "); \
181 	                          sub(/ static /, " "); \

 51 
 52 # Some platforms don't have the serviceability agent
 53 ifeq ($(INCLUDE_SA), false)
 54   MODULES_FILTER += jdk.hotspot.agent
 55 endif
 56 
 57 # jpackage is only on windows, macosx, and linux
 58 ifeq ($(call isTargetOs, windows macosx linux), false)
 59   MODULES_FILTER += jdk.jpackage
 60 endif
 61 
 62 ################################################################################
 63 # Module list macros
 64 
 65 # Use append so that the custom extension may add to these variables
 66 
 67 GENERATED_SRC_DIRS += \
 68     $(SUPPORT_OUTPUTDIR)/gensrc \
 69     #
 70 
 71 # Directories in which generated preview classes may exist.
 72 # Currently this is restricted to generated value classes, but can be extended.
 73 GENERATED_PREVIEW_SUBDIRS += \
 74     $(SUPPORT_OUTPUTDIR)/gensrc-valueclasses \
 75     #
 76 
 77 TOP_SRC_DIRS += \
 78     $(TOPDIR)/src \
 79     #
 80 
 81 SRC_SUBDIRS += $(OPENJDK_TARGET_OS)/classes
 82 ifneq ($(OPENJDK_TARGET_OS), $(OPENJDK_TARGET_OS_TYPE))
 83   SRC_SUBDIRS += $(OPENJDK_TARGET_OS_TYPE)/classes
 84 endif
 85 SRC_SUBDIRS += share/classes
 86 
 87 SPEC_SUBDIRS += share/specs
 88 
 89 MAN_SUBDIRS += share/man $(TARGET_OS)/man
 90 
 91 # The docs should include the sum of all man pages for all platforms
 92 MAN_DOCS_SUBDIRS += share/man windows/man
 93 
 94 # Find all module-info.java files for the current build target platform and
 95 # configuration.
 96 # Param 1 - Module to find for, set to * for finding all

126     $(call GetModuleNameFromModuleInfo, $(MODULE_INFOS))))
127 
128 # Find all modules in a specific src dir
129 # Param 1 - Src dir to find modules in
130 FindModulesForSrcDir = \
131     $(sort $(filter-out $(MODULES_FILTER), \
132         $(call GetModuleNameFromModuleInfo, $(call FindModuleInfosForSrcDir, $1)) \
133     ))
134 
135 FindImportedModules = \
136     $(filter-out $(MODULES_FILTER), \
137     $(if $(IMPORT_MODULES_CLASSES), $(notdir $(wildcard $(IMPORT_MODULES_CLASSES)/*))))
138 
139 # Find all source dirs for a particular module
140 # $1 - Module to find source dirs for
141 FindModuleSrcDirs = \
142     $(strip $(wildcard \
143         $(addsuffix /$(strip $1), $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
144         $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
145 
146 # Find preview class source dirs for a particular module.
147 # Currently this is restricted to generated value classes, but can be extended.
148 # $1 - Module to find source dirs for
149 FindModulePreviewSrcDirs = \
150     $(strip $(wildcard \
151         $(addsuffix /$(strip $1), $(GENERATED_PREVIEW_SUBDIRS))))
152 
153 # Find all specs dirs for a particular module
154 # $1 - Module to find specs dirs for
155 FindModuleSpecsDirs = \
156     $(strip $(wildcard \
157         $(foreach sub, $(SPEC_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
158 
159 # Find all man dirs for a particular module
160 # $1 - Module to find man dirs for
161 FindModuleManDirs = \
162     $(strip $(wildcard \
163         $(foreach sub, $(MAN_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
164 
165 FindModuleManDirsForDocs = \
166     $(strip $(wildcard \
167         $(foreach sub, $(MAN_DOCS_SUBDIRS), $(addsuffix /$(strip $1)/$(sub), $(TOP_SRC_DIRS)))))
168 
169 # Construct the complete module source path
170 GetModuleSrcPath = \
171     $(call PathList, \
172         $(addsuffix /*, $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
173         $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
174 
175 # Construct the complete module source path for preview classes.
176 # Currently this is restricted to generated value classes, but can be extended.
177 GetModulePreviewSrcPath = \
178     $(call PathList, \
179         $(addsuffix /*, $(GENERATED_PREVIEW_SUBDIRS) $(GENERATED_SRC_DIRS) $(IMPORT_MODULES_SRC)) \
180         $(foreach sub, $(SRC_SUBDIRS), $(addsuffix /*/$(sub), $(TOP_SRC_DIRS))))
181 
182 ################################################################################
183 # Extract module dependencies from module-info.java files, both normal
184 # dependencies ("requires"), and indirect exports ("requires transitive").
185 
186 MODULE_DEPS_MAKEFILE := $(MAKESUPPORT_OUTPUTDIR)/module-deps.gmk
187 
188 MODULE_INFOS := $(call FindAllModuleInfos, *)
189 
190 ifeq ($(GENERATE_MODULE_DEPS_FILE), true)
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_%s := " "$(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 /, " "); \
< prev index next >