diff --git a/make/CompileJavaModules.gmk b/make/CompileJavaModules.gmk index 1e26fb2b529cc..c6e8fab30387c 100644 --- a/make/CompileJavaModules.gmk +++ b/make/CompileJavaModules.gmk @@ -85,7 +85,7 @@ CreateHkTargets = \ ################################################################################ # Include module specific build settings -THIS_SNIPPET := modules/$(MODULE)/Java.gmk +THIS_SNIPPET := $(call GetModuleSnippetName, Java) ifneq ($(wildcard $(THIS_SNIPPET)), ) include MakeSnippetStart.gmk diff --git a/make/CreateJmods.gmk b/make/CreateJmods.gmk index 40bceda69a97f..a26042fb0d553 100644 --- a/make/CreateJmods.gmk +++ b/make/CreateJmods.gmk @@ -184,7 +184,7 @@ endif ################################################################################ # Include module specific build settings -THIS_SNIPPET := modules/$(MODULE)/Jmod.gmk +THIS_SNIPPET := $(call GetModuleSnippetName, Jmod) ifneq ($(wildcard $(THIS_SNIPPET)), ) include MakeSnippetStart.gmk diff --git a/make/Images.gmk b/make/Images.gmk index 22e3e43cb1f33..34d81081d2968 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -270,6 +270,7 @@ endif # Since debug symbols are not included in the jmod files, they need to be copied # in manually after generating the images. +# These variables are read by SetupCopyDebuginfo ALL_JDK_MODULES := $(JDK_MODULES) ALL_JRE_MODULES := $(sort $(JRE_MODULES), $(foreach m, $(JRE_MODULES), \ $(call FindTransitiveDepsForModule, $m))) diff --git a/make/Main.gmk b/make/Main.gmk index d0568509a4e5b..f8712c69b2737 100644 --- a/make/Main.gmk +++ b/make/Main.gmk @@ -1407,7 +1407,7 @@ CLEAN_SUPPORT_DIRS += demos CLEAN_SUPPORT_DIR_TARGETS := $(addprefix clean-, $(CLEAN_SUPPORT_DIRS)) CLEAN_TESTS += hotspot-jtreg-native jdk-jtreg-native lib CLEAN_TEST_TARGETS += $(addprefix clean-test-, $(CLEAN_TESTS)) -CLEAN_PHASES := gensrc java native include +CLEAN_PHASES += gensrc java native include CLEAN_PHASE_TARGETS := $(addprefix clean-, $(CLEAN_PHASES)) CLEAN_MODULE_TARGETS := $(addprefix clean-, $(ALL_MODULES)) # Construct targets of the form clean-$module-$phase diff --git a/make/MainSupport.gmk b/make/MainSupport.gmk index d8dc894c1e983..ee5bb324f8f0a 100644 --- a/make/MainSupport.gmk +++ b/make/MainSupport.gmk @@ -149,7 +149,7 @@ endef ################################################################################ -PHASE_MAKEDIRS := $(TOPDIR)/make +PHASE_MAKEDIRS += $(TOPDIR)/make # Helper macro for DeclareRecipesForPhase # Declare a recipe for calling the module and phase specific makefile. diff --git a/make/ModuleWrapper.gmk b/make/ModuleWrapper.gmk index b3ddf940e008c..2db77b9ea3288 100644 --- a/make/ModuleWrapper.gmk +++ b/make/ModuleWrapper.gmk @@ -34,18 +34,23 @@ include MakeFileStart.gmk ################################################################################ include CopyFiles.gmk +include Modules.gmk MODULE_SRC := $(TOPDIR)/src/$(MODULE) -# Define the snippet for MakeSnippetStart/End -THIS_SNIPPET := modules/$(MODULE)/$(MAKEFILE_PREFIX).gmk +################################################################################ +# Include module specific build settings + +THIS_SNIPPET := $(call GetModuleSnippetName, $(MAKEFILE_PREFIX)) -include MakeSnippetStart.gmk +ifneq ($(wildcard $(THIS_SNIPPET)), ) + include MakeSnippetStart.gmk -# Include the file being wrapped. -include $(THIS_SNIPPET) + # Include the file being wrapped. + include $(THIS_SNIPPET) -include MakeSnippetEnd.gmk + include MakeSnippetEnd.gmk +endif ifeq ($(MAKEFILE_PREFIX), Lib) # We need to keep track of what libraries are generated/needed by this diff --git a/make/common/JavaCompilation.gmk b/make/common/JavaCompilation.gmk index c5a74413de19e..99672d5988484 100644 --- a/make/common/JavaCompilation.gmk +++ b/make/common/JavaCompilation.gmk @@ -178,6 +178,10 @@ define SetupJavaCompilationBody $1_SAFE_NAME := $$(strip $$(subst /,_, $1)) + ifeq ($$($1_LOG_ACTION), ) + $1_LOG_ACTION := Compiling + endif + ifeq ($$($1_SMALL_JAVA), ) # If unspecified, default to true $1_SMALL_JAVA := true @@ -472,7 +476,7 @@ define SetupJavaCompilationBody # list of files. $$($1_FILELIST): $$($1_SRCS) $$($1_VARDEPS_FILE) $$(call MakeDir, $$(@D)) - $$(call LogWarn, Compiling up to $$(words $$($1_SRCS)) files for $1) + $$(call LogWarn, $$($1_LOG_ACTION) up to $$(words $$($1_SRCS)) files for $1) $$(eval $$(call ListPathsSafely, $1_SRCS, $$($1_FILELIST))) # Create a $$($1_MODFILELIST) file with significant modified dependencies diff --git a/make/common/Modules.gmk b/make/common/Modules.gmk index 725424d7618da..2880504676aa4 100644 --- a/make/common/Modules.gmk +++ b/make/common/Modules.gmk @@ -33,7 +33,7 @@ include $(TOPDIR)/make/conf/module-loader-map.conf # Append platform-specific and upgradeable modules PLATFORM_MODULES += $(PLATFORM_MODULES_$(OPENJDK_TARGET_OS)) \ - $(UPGRADEABLE_PLATFORM_MODULES) + $(UPGRADEABLE_PLATFORM_MODULES) $(CUSTOM_UPGRADEABLE_PLATFORM_MODULES) ################################################################################ # Setup module sets for docs @@ -216,7 +216,7 @@ endif # Find dependencies ("requires") for a given module. # Param 1: Module to find dependencies for. FindDepsForModule = \ - $(DEPS_$(strip $1)) + $(filter-out $(IMPORT_MODULES), $(DEPS_$(strip $1))) # Find dependencies ("requires") transitively in 3 levels for a given module. # Param 1: Module to find dependencies for. @@ -254,7 +254,8 @@ FindTransitiveIndirectDepsForModules = \ # Upgradeable modules are those that are either defined as upgradeable or that # require an upradeable module. FindAllUpgradeableModules = \ - $(sort $(filter-out $(MODULES_FILTER), $(UPGRADEABLE_PLATFORM_MODULES))) + $(sort $(filter-out $(MODULES_FILTER), \ + $(UPGRADEABLE_PLATFORM_MODULES) $(CUSTOM_UPGRADEABLE_PLATFORM_MODULES))) ################################################################################ @@ -316,6 +317,19 @@ define ReadImportMetaData $$(eval $$(call ReadSingleImportMetaData, $$m))) endef +################################################################################ +# Get a full snippet path for the current module and a given base name. +# +# Param 1 - The base name of the snippet file to include +GetModuleSnippetName = \ + $(if $(CUSTOM_MODULE_MAKE_ROOT), \ + $(if $(wildcard $(CUSTOM_MODULE_MAKE_ROOT)/$(MODULE)/$(strip $1).gmk), \ + $(CUSTOM_MODULE_MAKE_ROOT)/$(MODULE)/$(strip $1).gmk, \ + $(wildcard modules/$(MODULE)/$(strip $1).gmk) \ + ), \ + $(wildcard modules/$(MODULE)/$(strip $1).gmk) \ + ) + ################################################################################ endif # include guard