Skip to content

Commit

Permalink
8244044: Refactor phase makefiles to be structured per module
Browse files Browse the repository at this point in the history
Reviewed-by: erikj
  • Loading branch information
magicus committed Apr 29, 2020
1 parent 739e8e3 commit 0de9bbd
Show file tree
Hide file tree
Showing 104 changed files with 62 additions and 116 deletions.
2 changes: 1 addition & 1 deletion make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ GENSRC_TARGETS += $(sort $(GENSRC_MODULEINFO_TARGETS) \
define DeclareModuleInfoRecipe
$1-gensrc-moduleinfo:
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
-f gensrc/GensrcModuleInfo.gmk MODULE=$1)
-f common/modules/GensrcModuleInfo.gmk MODULE=$1)

$1-gensrc: $1-gensrc-moduleinfo
endef
Expand Down
15 changes: 7 additions & 8 deletions make/MainSupport.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -129,18 +129,17 @@ define DeclareRecipeForModuleMakefile
$2-$$($1_TARGET_SUFFIX):
ifeq ($$($1_USE_WRAPPER), true)
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
-f ModuleWrapper.gmk \
-f ModuleWrapper.gmk -I $$(TOPDIR)/make/common/modules \
$$(addprefix -I, $$(PHASE_MAKEDIRS) \
$$(addsuffix /$$($1_MAKE_SUBDIR), $$(PHASE_MAKEDIRS)) \
$$(addsuffix /modules/$2, $$(PHASE_MAKEDIRS)) \
) \
MODULE=$2 MAKEFILE_PREFIX=$$($1_FILE_PREFIX) $$($1_EXTRA_ARGS))
else
+($(CD) $$(dir $$(firstword $$(wildcard $$(addsuffix \
/$$($1_MAKE_SUBDIR)/$$($1_FILE_PREFIX)-$2.gmk, $$(PHASE_MAKEDIRS))))) \
+($(CD) $$(TOPDIR)/make \
&& $(MAKE) $(MAKE_ARGS) \
-f $$($1_FILE_PREFIX)-$2.gmk \
-f modules/$2/$$($1_FILE_PREFIX).gmk -I $$(TOPDIR)/make/common/modules \
$$(addprefix -I, $$(PHASE_MAKEDIRS) \
$$(addsuffix /$$($1_MAKE_SUBDIR), $$(PHASE_MAKEDIRS)) \
$$(addsuffix /modules/$2, $$(PHASE_MAKEDIRS)) \
) \
MODULE=$2 $$($1_EXTRA_ARGS) \
)
Expand All @@ -153,7 +152,7 @@ endef
# Param 2: Module name
define DeclareRecipesForPhaseAndModule
$1_$2_MAKEFILES := $$(strip $$(wildcard \
$$(addsuffix /$$($1_MAKE_SUBDIR)/$$($1_FILE_PREFIX)-$2.gmk, $$(PHASE_MAKEDIRS))))
$$(addsuffix /modules/$2/$$($1_FILE_PREFIX).gmk, $$(PHASE_MAKEDIRS))))

# Only declare recipes if there are makefiles to call
ifneq ($$($1_$2_MAKEFILES), )
Expand Down
4 changes: 2 additions & 2 deletions make/ModuleWrapper.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -39,7 +39,7 @@ include MakeBase.gmk
TARGETS :=

# Include the file being wrapped.
include $(MAKEFILE_PREFIX)-$(MODULE).gmk
include modules/$(MODULE)/$(MAKEFILE_PREFIX).gmk

# Setup copy rules from the modules directories to the jdk image directory.
ifeq ($(call isTargetOs, windows), true)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -27,7 +27,8 @@ include CopyCommon.gmk
include Modules.gmk
include TextFileProcessing.gmk

$(eval $(call IncludeCustomExtension, copy/Copy-java.base.gmk))
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, modules/java.base/Copy.gmk))

################################################################################

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,18 +25,15 @@

include GendataCommon.gmk

# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, gendata/Gendata-java.base.gmk))
include gendata/GendataBreakIterator.gmk

include GendataBreakIterator.gmk
include gendata/GendataTZDB.gmk

include GendataTZDB.gmk
include gendata/GendataBlacklistedCerts.gmk

include GendataBlacklistedCerts.gmk
include gendata/GendataCryptoPolicy.gmk

include GendataCryptoPolicy.gmk

include GendataPublicSuffixList.gmk
include gendata/GendataPublicSuffixList.gmk

################################################################################

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,16 +25,16 @@

include GensrcCommonJdk.gmk

include GensrcLocaleData.gmk
include GensrcCharacterData.gmk
include GensrcMisc.gmk
include GensrcCharsetMapping.gmk
include GensrcCharsetCoder.gmk
include GensrcBuffer.gmk
include GensrcExceptions.gmk
include GensrcVarHandles.gmk
include GensrcModuleLoaderMap.gmk
include GensrcEmojiData.gmk
include gensrc/GensrcLocaleData.gmk
include gensrc/GensrcCharacterData.gmk
include gensrc/GensrcMisc.gmk
include gensrc/GensrcCharsetMapping.gmk
include gensrc/GensrcCharsetCoder.gmk
include gensrc/GensrcBuffer.gmk
include gensrc/GensrcExceptions.gmk
include gensrc/GensrcVarHandles.gmk
include gensrc/GensrcModuleLoaderMap.gmk
include gensrc/GensrcEmojiData.gmk

################################################################################

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@

include LauncherCommon.gmk

$(eval $(call IncludeCustomExtension, launcher/Launcher-java.base.gmk))
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, modules/java.base/Launcher.gmk))

JAVA_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/launcher/java.rc

Expand Down
6 changes: 3 additions & 3 deletions make/lib/Lib-java.base.gmk → make/modules/java.base/Lib.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,15 +26,15 @@
include LibCommon.gmk

# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, lib/Lib-java.base.gmk))
$(eval $(call IncludeCustomExtension, modules/java.base/Lib.gmk))

# Prepare the find cache.
$(call FillFindCache, $(wildcard $(TOPDIR)/src/java.base/*/native))

################################################################################
# Create all the core libraries

include CoreLibraries.gmk
include lib/CoreLibraries.gmk

################################################################################
# Create the network library
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,8 +23,6 @@
# questions.
#

$(eval $(call IncludeCustomExtension, gendata/GendataBlacklistedCerts.gmk))

GENDATA_BLACKLISTED_CERTS_SRC += $(TOPDIR)/make/data/blacklistedcertsconverter/blacklisted.certs.pem
GENDATA_BLACKLISTED_CERTS := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE)/security/blacklisted.certs

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -277,6 +277,3 @@ $(foreach t, $(VARHANDLES_MEMORY_ADDRESS_TYPES), \
$(eval $(call GenerateVarHandleMemoryAddress,VAR_HANDLE_MEMORY_ADDRESS_$t,$t)))

GENSRC_JAVA_BASE += $(GENSRC_VARHANDLES)

# Include custom extension post hook
$(eval $(call IncludeCustomExtension, gensrc/GensrcVarHandles-post.gmk))
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,10 +23,6 @@
# questions.
#

# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, lib/CoreLibraries.gmk))


##########################################################################################
# libfdlibm is statically linked with libjava below and not delivered into the
# product on its own.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,8 +26,6 @@
include CopyCommon.gmk
include Modules.gmk

$(eval $(call IncludeCustomExtension, copy/Copy-java.desktop.gmk))

################################################################################

$(CONF_DST_DIR)/sound.properties: $(TOPDIR)/src/java.desktop/share/conf/sound.properties
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,6 +25,6 @@

include GendataCommon.gmk

include GendataFontConfig.gmk
include gendata/GendataFontConfig.gmk

include GendataHtml32dtd.gmk
include gendata/GendataHtml32dtd.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,17 +26,17 @@
include GensrcCommonJdk.gmk

# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, gensrc/Gensrc-java.desktop.gmk))
$(eval $(call IncludeCustomExtension, modules/java.desktop/Gensrc.gmk))

ifeq ($(call isTargetOs, windows), false)
include GensrcIcons.gmk
include gensrc/GensrcIcons.gmk
endif

ifeq ($(call isTargetOs, linux solaris aix), true)
include GensrcX11Wrappers.gmk
include gensrc/GensrcX11Wrappers.gmk
endif

include GensrcSwing.gmk
include gensrc/GensrcSwing.gmk

################################################################################

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,15 +26,15 @@
include LibCommon.gmk

# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, lib/Lib-java.desktop.gmk))
$(eval $(call IncludeCustomExtension, modules/java.desktop/Lib.gmk))

# Prepare the find cache.
$(call FillFindCache, $(wildcard $(TOPDIR)/src/java.desktop/*/native))

################################################################################
# Create the AWT/2D libraries

include Awt2dLibraries.gmk
include lib/Awt2dLibraries.gmk

################################################################################
# Create the libjsound library
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,8 +23,6 @@
# questions.
#

$(eval $(call IncludeCustomExtension, gensrc/GensrcIcons.gmk))

GENSRC_AWT_ICONS :=
GENSRC_AWT_ICONS_SRC :=
GENSRC_AWT_ICONS_TMP := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -23,8 +23,6 @@
# questions.
#

$(eval $(call IncludeCustomExtension, lib/Awt2dLibraries-pre.gmk))

WIN_AWT_LIB := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt/awt.lib

LIBAWT_DEFAULT_HEADER_DIRS := \
Expand Down Expand Up @@ -900,8 +898,3 @@ ifeq ($(call isTargetOs, macosx), true)
$(BUILD_LIBOSXUI): $(BUILD_LIBAWT_LWAWT)

endif

################################################################################

# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, lib/Awt2dLibraries.gmk))
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,9 +25,6 @@

include LibCommon.gmk

# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, lib/Lib-java.instrument.gmk))

################################################################################

ifeq ($(call isTargetOs, windows), true)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
Expand All @@ -25,9 +25,6 @@

include LibCommon.gmk

# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, lib/Lib-java.management.gmk))

################################################################################

LIBMANAGEMENT_OPTIMIZATION := HIGH
Expand All @@ -52,8 +49,3 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBMANAGEMENT, \
$(BUILD_LIBMANAGEMENT): $(call FindLib, java.base, java)

TARGETS += $(BUILD_LIBMANAGEMENT)

################################################################################

# Include custom extension post hook
$(eval $(call IncludeCustomExtension, lib/Lib-java.management-post.gmk))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 0de9bbd

Please sign in to comment.