100 JMOD_FLAGS += --warn-if-resolved=incubating 101 endif 102 103 # Add dependencies on other jmod files. Only java.base needs access to other 104 # jmods. 105 ifeq ($(MODULE), java.base) 106 # When creating a BUILDJDK, we don't need to add hashes to java.base 107 ifneq ($(CREATING_BUILDJDK), true) 108 # When creating interim versions of jmods, skip hashes 109 ifneq ($(INTERIM_JMOD), true) 110 ALL_UPGRADEABLE_MODULES := $(call FindAllUpgradeableModules) 111 DEPS += $(patsubst %, $(JMODS_DIR)/%.jmod, \ 112 $(filter-out java.base $(ALL_UPGRADEABLE_MODULES), $(call FindAllModules))) 113 114 EXCLUDE_PATTERN := $(strip $(subst $(SPACE),$$|,$(strip $(ALL_UPGRADEABLE_MODULES)))) 115 116 JMOD_FLAGS += --module-path $(JMODS_DIR) \ 117 --hash-modules '^(?!$(EXCLUDE_PATTERN)$$)' 118 endif 119 endif 120 endif 121 122 # Changes to the jmod tool itself should also trigger a rebuild of all jmods. 123 # The variable JMOD_CMD could contain an environment variable assignment before 124 # the actual command. Filter that out using wildcard before adding to DEPS. 125 DEPS += $(wildcard $(JMOD_CMD)) 126 ifeq ($(EXTERNAL_BUILDJDK), false) 127 DEPS += $(call CacheFind, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod) 128 endif 129 130 # If creating interim versions of jmods, certain files need to be filtered out 131 # to avoid false incremental rebuilds. 132 ifeq ($(INTERIM_JMOD), true) 133 DEPS := $(filter-out $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist, $(DEPS)) 134 endif 135 136 # Create jmods in a temp dir and then move them into place to keep the 137 # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times. 138 $(JMODS_DIR)/$(MODULE).jmod: $(DEPS) 139 $(call LogWarn, Creating $(patsubst $(OUTPUTDIR)/%, %, $@)) 140 $(call MakeDir, $(JMODS_DIR) $(JMODS_TEMPDIR)) 141 $(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@) 142 $(JMOD) create \ 143 --module-version $(VERSION_SHORT) \ 144 --target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \ 145 --module-path $(JMODS_DIR) \ 146 --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' \ 147 $(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@) 148 $(MV) $(JMODS_TEMPDIR)/$(notdir $@) $@ 149 150 TARGETS += $(JMODS_DIR)/$(MODULE).jmod 151 152 ################################################################################ 153 154 all: $(TARGETS) 155 156 ################################################################################ | 100 JMOD_FLAGS += --warn-if-resolved=incubating 101 endif 102 103 # Add dependencies on other jmod files. Only java.base needs access to other 104 # jmods. 105 ifeq ($(MODULE), java.base) 106 # When creating a BUILDJDK, we don't need to add hashes to java.base 107 ifneq ($(CREATING_BUILDJDK), true) 108 # When creating interim versions of jmods, skip hashes 109 ifneq ($(INTERIM_JMOD), true) 110 ALL_UPGRADEABLE_MODULES := $(call FindAllUpgradeableModules) 111 DEPS += $(patsubst %, $(JMODS_DIR)/%.jmod, \ 112 $(filter-out java.base $(ALL_UPGRADEABLE_MODULES), $(call FindAllModules))) 113 114 EXCLUDE_PATTERN := $(strip $(subst $(SPACE),$$|,$(strip $(ALL_UPGRADEABLE_MODULES)))) 115 116 JMOD_FLAGS += --module-path $(JMODS_DIR) \ 117 --hash-modules '^(?!$(EXCLUDE_PATTERN)$$)' 118 endif 119 endif 120 else # not java.base 121 ifeq ($(OPENJDK_TARGET_OS), windows) 122 # Only java.base needs to include the MSVC*_DLLs. Make sure no other module 123 # tries to include them (typically imported ones). 124 ifneq ($(wildcard $(LIBS_DIR)/$(notdir $(MSVCR_DLL))), ) 125 JMOD_FLAGS += --exclude '$(notdir $(MSVCR_DLL))' 126 endif 127 ifneq ($(wildcard $(LIBS_DIR)/$(notdir $(MSVCP_DLL))), ) 128 JMOD_FLAGS += --exclude '$(notdir $(MSVCP_DLL))' 129 endif 130 endif 131 endif 132 133 # Changes to the jmod tool itself should also trigger a rebuild of all jmods. 134 # The variable JMOD_CMD could contain an environment variable assignment before 135 # the actual command. Filter that out using wildcard before adding to DEPS. 136 DEPS += $(wildcard $(JMOD_CMD)) 137 ifeq ($(EXTERNAL_BUILDJDK), false) 138 DEPS += $(call CacheFind, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod) 139 endif 140 141 # If creating interim versions of jmods, certain files need to be filtered out 142 # to avoid false incremental rebuilds. 143 ifeq ($(INTERIM_JMOD), true) 144 DEPS := $(filter-out $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist, $(DEPS)) 145 endif 146 147 JMOD_FLAGS += --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' 148 149 # Create jmods in a temp dir and then move them into place to keep the 150 # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times. 151 $(JMODS_DIR)/$(MODULE).jmod: $(DEPS) 152 $(call LogWarn, Creating $(patsubst $(OUTPUTDIR)/%, %, $@)) 153 $(call MakeDir, $(JMODS_DIR) $(JMODS_TEMPDIR)) 154 $(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@) 155 $(call ExecuteWithLog, $(SUPPORT_OUTPUTDIR)/jmods/$(MODULE).jmod, \ 156 $(JMOD) create \ 157 --module-version $(VERSION_SHORT) \ 158 --target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \ 159 --module-path $(JMODS_DIR) \ 160 $(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@) \ 161 ) 162 $(MV) $(JMODS_TEMPDIR)/$(notdir $@) $@ 163 164 TARGETS += $(JMODS_DIR)/$(MODULE).jmod 165 166 ################################################################################ 167 168 all: $(TARGETS) 169 170 ################################################################################ |