Skip to content

Commit

Permalink
8245287: Start using ModuleWrapper for gensrc as well
Browse files Browse the repository at this point in the history
Reviewed-by: erikj
  • Loading branch information
magicus committed May 19, 2020
1 parent 74f1e6d commit 1cb7df6
Show file tree
Hide file tree
Showing 34 changed files with 80 additions and 199 deletions.
8 changes: 3 additions & 5 deletions make/Main.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ $(eval $(call DeclareRecipesForPhase, GENDATA, \
FILE_PREFIX := Gendata, \
MAKE_SUBDIR := gendata, \
CHECK_MODULES := $(ALL_MODULES), \
USE_WRAPPER := true))
))

ALL_TARGETS += $(GENDATA_TARGETS)

Expand All @@ -163,7 +163,6 @@ $(eval $(call DeclareRecipesForPhase, COPY, \
FILE_PREFIX := Copy, \
MAKE_SUBDIR := copy, \
CHECK_MODULES := $(ALL_MODULES), \
USE_WRAPPER := true, \
))

ALL_COPY_MODULES += $(COPY_MODULES)
Expand Down Expand Up @@ -206,7 +205,7 @@ $(eval $(call DeclareRecipesForPhase, LIBS, \
FILE_PREFIX := Lib, \
MAKE_SUBDIR := lib, \
CHECK_MODULES := $(ALL_MODULES), \
USE_WRAPPER := true))
))

ALL_TARGETS += $(LIBS_TARGETS)

Expand All @@ -219,7 +218,6 @@ $(eval $(call DeclareRecipesForPhase, STATIC_LIBS, \
FILE_PREFIX := Lib, \
MAKE_SUBDIR := lib, \
CHECK_MODULES := $(STATIC_LIBS_MODULES), \
USE_WRAPPER := true, \
EXTRA_ARGS := STATIC_LIBS=true, \
))

Expand All @@ -232,7 +230,7 @@ $(eval $(call DeclareRecipesForPhase, LAUNCHER, \
FILE_PREFIX := Launcher, \
MAKE_SUBDIR := launcher, \
CHECK_MODULES := $(ALL_MODULES), \
USE_WRAPPER := true))
))

ALL_TARGETS += $(LAUNCHER_TARGETS)

Expand Down
24 changes: 6 additions & 18 deletions make/MainSupport.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -148,23 +148,12 @@ PHASE_MAKEDIRS := $(TOPDIR)/make
# Param 2: Module name
define DeclareRecipeForModuleMakefile
$2-$$($1_TARGET_SUFFIX):
ifeq ($$($1_USE_WRAPPER), true)
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
-f ModuleWrapper.gmk -I $$(TOPDIR)/make/common/modules \
$$(addprefix -I, $$(PHASE_MAKEDIRS) \
$$(addsuffix /modules/$2, $$(PHASE_MAKEDIRS)) \
) \
MODULE=$2 MAKEFILE_PREFIX=$$($1_FILE_PREFIX) $$($1_EXTRA_ARGS))
else
+($(CD) $$(TOPDIR)/make \
&& $(MAKE) $(MAKE_ARGS) \
-f modules/$2/$$($1_FILE_PREFIX).gmk -I $$(TOPDIR)/make/common/modules \
$$(addprefix -I, $$(PHASE_MAKEDIRS) \
$$(addsuffix /modules/$2, $$(PHASE_MAKEDIRS)) \
) \
MODULE=$2 $$($1_EXTRA_ARGS) \
)
endif
+($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) \
-f ModuleWrapper.gmk -I $$(TOPDIR)/make/common/modules \
$$(addprefix -I, $$(PHASE_MAKEDIRS) \
$$(addsuffix /modules/$2, $$(PHASE_MAKEDIRS)) \
) \
MODULE=$2 MAKEFILE_PREFIX=$$($1_FILE_PREFIX) $$($1_EXTRA_ARGS))

endef

Expand Down Expand Up @@ -198,7 +187,6 @@ endef
# TARGET_SUFFIX : Suffix of target to create for recipe
# MAKE_SUBDIR : Subdir for this build phase
# FILE_PREFIX : File prefix for this build phase
# USE_WRAPPER : Set to true to use ModuleWrapper.gmk
# CHECK_MODULES : List of modules to try
# MULTIPLE_MAKEFILES : Set to true to handle makefiles for the same module and
# phase in multiple repos
Expand Down
4 changes: 0 additions & 4 deletions make/common/modules/GensrcCommonJdk.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
# questions.
#

default: all

include $(SPEC)
include MakeBase.gmk
include Execute.gmk
include JavaCompilation.gmk
include NativeCompilation.gmk
Expand Down
9 changes: 1 addition & 8 deletions make/common/modules/GensrcCommonLangtools.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 All @@ -22,12 +22,6 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#

# This must be the first rule
default: all

include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk

################################################################################
Expand Down Expand Up @@ -131,4 +125,3 @@ define SetupParseProperties
$$(strip $1) += $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE)/_the_parsed_props
endef

################################################################################
22 changes: 9 additions & 13 deletions make/modules/java.base/Gensrc.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ include gensrc/GensrcVarHandles.gmk
include gensrc/GensrcModuleLoaderMap.gmk
include gensrc/GensrcEmojiData.gmk

# GensrcLocaleData.gmk does not set TARGETS, so we must choose which targets
# to include.
TARGETS += $(GENSRC_BASELOCALEDATA)

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

CLDR_DATA_DIR := $(TOPDIR)/make/data/cldr/common
Expand All @@ -61,7 +65,7 @@ $(CLDR_GEN_DONE): $(wildcard $(CLDR_DATA_DIR)/dtd/*.dtd) \
-tzdatadir $(TZ_DATA_DIR))
$(TOUCH) $@

GENSRC_JAVA_BASE += $(CLDR_GEN_DONE)
TARGETS += $(CLDR_GEN_DONE)

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

Expand All @@ -77,7 +81,7 @@ $(eval $(call SetupCompileProperties, SUN_UTIL, \
CLASS := sun.util.resources.LocaleNamesBundle, \
))

GENSRC_JAVA_BASE += $(LIST_RESOURCE_BUNDLE) $(SUN_UTIL)
TARGETS += $(LIST_RESOURCE_BUNDLE) $(SUN_UTIL)

# Some resources bundles are already present as java files but still need to be
# copied to zh_HK locale.
Expand All @@ -86,7 +90,7 @@ $(eval $(call SetupCopy-zh_HK,COPY_ZH_HK, \
sun/security/util/AuthResources_zh_TW.java \
sun/security/util/Resources_zh_TW.java)))

GENSRC_JAVA_BASE += $(COPY_ZH_HK)
TARGETS += $(COPY_ZH_HK)

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

Expand All @@ -96,7 +100,7 @@ $(GENSRC_LSREQUIVMAPS): $(TOPDIR)/make/data/lsrdata/language-subtag-registry.txt
$(call MakeDir, $(@D))
$(TOOL_GENERATELSREQUIVMAPS) $< $@

GENSRC_JAVA_BASE += $(GENSRC_LSREQUIVMAPS)
TARGETS += $(GENSRC_LSREQUIVMAPS)

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

Expand All @@ -111,12 +115,4 @@ $(INTPOLY_GEN_DONE): $(INTPLOY_HEADER) $(BUILD_TOOLS_JDK)
$(GENSRC_DIR)) $(LOG_DEBUG)
$(TOUCH) $@

GENSRC_JAVA_BASE += $(INTPOLY_GEN_DONE)

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

java.base: $(GENSRC_JAVA_BASE)

all: java.base

.PHONY: all java.base
TARGETS += $(INTPOLY_GEN_DONE)
5 changes: 3 additions & 2 deletions make/modules/java.base/gensrc/GensrcBuffer.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 @@ -378,4 +378,5 @@ $(eval $(call SetupGenBuffer,ByteBufferAsDoubleBufferRL,$(BYTE_X_BUF), type:=dou
###

$(GENSRC_BUFFER): $(BUILD_TOOLS_JDK)
GENSRC_JAVA_BASE += $(GENSRC_BUFFER)

TARGETS += $(GENSRC_BUFFER)
3 changes: 2 additions & 1 deletion make/modules/java.base/gensrc/GensrcCharacterData.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/%.java: $(CHARACTERDATA)/%.java.

GENSRC_CHARACTERDATA += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataUndefined.java \
$(SUPPORT_OUTPUTDIR)/gensrc/java.base/java/lang/CharacterDataPrivateUse.java
GENSRC_JAVA_BASE += $(GENSRC_CHARACTERDATA)

$(GENSRC_CHARACTERDATA): $(BUILD_TOOLS_JDK)

TARGETS += $(GENSRC_CHARACTERDATA)
5 changes: 3 additions & 2 deletions make/modules/java.base/gensrc/GensrcCharsetCoder.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 @@ -100,8 +100,9 @@ $(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java: $(GENSRC_CHARSETCODER_TEMPLATE)
$(MV) [email protected] $@

GENSRC_CHARSETCODER += $(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java
GENSRC_JAVA_BASE += $(GENSRC_CHARSETCODER)

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

$(GENSRC_CHARSETCODER): $(BUILD_TOOLS_JDK)

TARGETS += $(GENSRC_CHARSETCODER)
4 changes: 2 additions & 2 deletions make/modules/java.base/gensrc/GensrcCharsetMapping.gmk
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 Down Expand Up @@ -53,4 +53,4 @@ $(CHARSET_DONE_BASE)-stdcs: $(CHARSET_DATA_DIR)/charsets \
$(LOG_DEBUG)
$(TOUCH) '$@'

GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-stdcs
TARGETS += $(CHARSET_DONE_BASE)-stdcs
3 changes: 1 addition & 2 deletions make/modules/java.base/gensrc/GensrcEmojiData.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,4 @@ $(GENSRC_EMOJIDATA): $(BUILD_TOOLS_JDK) $(EMOJIDATATEMP) $(UNICODEDATA)/emoji/em
$(UNICODEDATA) \
$(GENSRC_EMOJIDATA)

GENSRC_JAVA_BASE += $(GENSRC_EMOJIDATA)

TARGETS += $(GENSRC_EMOJIDATA)
5 changes: 3 additions & 2 deletions make/modules/java.base/gensrc/GensrcExceptions.gmk
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 Down Expand Up @@ -41,6 +41,7 @@ $(GENSRC_EXCEPTIONS_DST)/_the.%.marker: $(GENSRC_EXCEPTIONS_SRC)/%/exceptions \
$(TOUCH) $@

GENSRC_EXCEPTIONS += $(foreach D,$(GENSRC_EXCEPTIONS_SRC_DIRS),$(GENSRC_EXCEPTIONS_DST)/_the.$(D).marker)
GENSRC_JAVA_BASE += $(GENSRC_EXCEPTIONS)

$(GENSRC_EXCEPTIONS): $(BUILD_TOOLS_JDK)

TARGETS += $(GENSRC_EXCEPTIONS)
8 changes: 4 additions & 4 deletions make/modules/java.base/gensrc/GensrcLocaleData.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 @@ -147,7 +147,7 @@ $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonBaseLo
GENSRC_BASELOCALEDATA := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/util/locale/provider/BaseLocaleDataMetaInfo.java
GENSRC_LOCALEDATA := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.localedata/sun/util/resources/provider/NonBaseLocaleDataMetaInfo.java

GENSRC_JAVA_BASE += $(GENSRC_BASELOCALEDATA)
GENSRC_JDK_LOCALEDATA += $(GENSRC_LOCALEDATA)

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

# This file is included twice, by java.base and jdk.localedata. The includer must
# add either GENSRC_BASELOCALEDATA or GENSRC_LOCALEDATA to TARGETS.
12 changes: 6 additions & 6 deletions make/modules/java.base/gensrc/GensrcMisc.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 @@ -50,7 +50,7 @@ $(eval $(call SetupTextFileProcessing, BUILD_VERSION_JAVA, \
@@VENDOR_URL_VM_BUG@@ => $(VENDOR_URL_VM_BUG), \
))

GENSRC_JAVA_BASE += $(BUILD_VERSION_JAVA)
TARGETS += $(BUILD_VERSION_JAVA)

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

Expand Down Expand Up @@ -88,7 +88,7 @@ $(GENSRC_SOR_FILE): \
$(TOPDIR)/src/java.base/share/classes/sun/nio/ch/SocketOptionRegistry.java.template
$(generate-preproc-src)

GENSRC_JAVA_BASE += $(GENSRC_SOR_FILE)
TARGETS += $(GENSRC_SOR_FILE)

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

Expand All @@ -100,7 +100,7 @@ ifeq ($(call isTargetOs, windows), false)
$(TOPDIR)/src/java.base/unix/classes/sun/nio/fs/UnixConstants.java.template
$(generate-preproc-src)

GENSRC_JAVA_BASE += $(GENSRC_UC_FILE)
TARGETS += $(GENSRC_UC_FILE)

endif

Expand All @@ -114,7 +114,7 @@ ifeq ($(call isTargetOs, solaris), true)
$(TOPDIR)/src/java.base/solaris/classes/sun/nio/fs/SolarisConstants.java.template
$(generate-preproc-src)

GENSRC_JAVA_BASE += $(GENSRC_SC_FILE)
TARGETS += $(GENSRC_SC_FILE)

endif

Expand All @@ -135,5 +135,5 @@ ifneq ($(wildcard $(TOPDIR)/src/java.base/share/classes/javax/crypto/JceSecurity
@@JCE_DEFAULT_POLICY@@ => $(JCE_DEFAULT_POLICY), \
))

GENSRC_JAVA_BASE += $(BUILD_JCESECURITY_JAVA)
TARGETS += $(BUILD_JCESECURITY_JAVA)
endif
4 changes: 2 additions & 2 deletions make/modules/java.base/gensrc/GensrcModuleLoaderMap.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2018, 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 @@ -52,6 +52,6 @@ $(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/module/ModuleLoaderMap.java:
-platform $(PLATFORM_MODULES_LIST) -o [email protected] $<
$(MV) [email protected] $@

GENSRC_JAVA_BASE += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/module/ModuleLoaderMap.java
TARGETS += $(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/module/ModuleLoaderMap.java

################################################################################
2 changes: 1 addition & 1 deletion make/modules/java.base/gensrc/GensrcVarHandles.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,4 @@ VARHANDLES_MEMORY_ADDRESS_TYPES := Byte Short Char Int Long Float Double
$(foreach t, $(VARHANDLES_MEMORY_ADDRESS_TYPES), \
$(eval $(call GenerateVarHandleMemoryAddress,VAR_HANDLE_MEMORY_ADDRESS_$t,$t)))

GENSRC_JAVA_BASE += $(GENSRC_VARHANDLES)
TARGETS += $(GENSRC_VARHANDLES)
10 changes: 1 addition & 9 deletions make/modules/java.desktop/Gensrc.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,4 @@ $(eval $(call SetupCompileProperties, COMPILE_PROPERTIES, \
CLASS := ListResourceBundle, \
))

GENSRC_JAVA_DESKTOP += $(COMPILE_PROPERTIES)

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

java.desktop: $(GENSRC_JAVA_DESKTOP)

all: java.desktop

.PHONY: all java.desktop
TARGETS += $(COMPILE_PROPERTIES)
4 changes: 2 additions & 2 deletions make/modules/java.desktop/gensrc/GensrcIcons.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ endef

$(foreach I, $(GENSRC_AWT_ICONS_SRC), $(eval $(call SetupGensrcAWTIcon,$(notdir $(I)),$(dir $(I)))))

GENSRC_JAVA_DESKTOP += $(GENSRC_AWT_ICONS)
TARGETS += $(GENSRC_AWT_ICONS)

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

Expand All @@ -123,5 +123,5 @@ ifeq ($(call isTargetOs, macosx), true)
$(ECHO) "};" >> [email protected]
$(MV) [email protected] $@

GENSRC_JAVA_DESKTOP += $(GENSRC_OSX_ICONS)
TARGETS += $(GENSRC_OSX_ICONS)
endif
4 changes: 2 additions & 2 deletions make/modules/java.desktop/gensrc/GensrcSwing.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, 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 @@ -40,4 +40,4 @@ $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_nimbus: $(NIMBUS_SKIN_FI

GENSRC_SWING_NIMBUS := $(SUPPORT_OUTPUTDIR)/gensrc/java.desktop/_the.generated_nimbus

GENSRC_JAVA_DESKTOP += $(GENSRC_SWING_NIMBUS)
TARGETS += $(GENSRC_SWING_NIMBUS)
4 changes: 2 additions & 2 deletions make/modules/java.desktop/gensrc/GensrcX11Wrappers.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 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 @@ -44,4 +44,4 @@ $(eval $(call SetupExecute, gen_x11wrappers, \
$(OPENJDK_TARGET_CPU_BITS), \
))

GENSRC_JAVA_DESKTOP += $(gen_x11wrappers_TARGET)
TARGETS += $(gen_x11wrappers_TARGET)
Loading

0 comments on commit 1cb7df6

Please sign in to comment.