From aa18b2208e6d9c964bf4276ab10cbf4d7be1fa4f Mon Sep 17 00:00:00 2001 From: "Keith W. Campbell" Date: Fri, 31 May 2024 16:19:18 -0400 Subject: [PATCH] Revert "Simplify and improve module dependency management" This reverts commit e1ae8a5615d4c03b2172669a5d423e5d389bf152. Signed-off-by: Keith W. Campbell --- closed/{custom/Main-post.gmk => GensrcJ9JCL.gmk} | 13 ++++++++----- closed/OpenJ9.gmk | 1 + closed/autoconf/custom-spec.gmk.in | 1 + closed/custom/Main.gmk | 10 +++++++++- closed/custom/common/Modules.gmk | 15 ++++++++++++++- 5 files changed, 33 insertions(+), 7 deletions(-) rename closed/{custom/Main-post.gmk => GensrcJ9JCL.gmk} (93%) diff --git a/closed/custom/Main-post.gmk b/closed/GensrcJ9JCL.gmk similarity index 93% rename from closed/custom/Main-post.gmk rename to closed/GensrcJ9JCL.gmk index f4f4410c7c1..1f63911def5 100644 --- a/closed/custom/Main-post.gmk +++ b/closed/GensrcJ9JCL.gmk @@ -1,5 +1,5 @@ # =========================================================================== -# (c) Copyright IBM Corp. 2020, 2024 All Rights Reserved +# (c) Copyright IBM Corp. 2020, 2023 All Rights Reserved # =========================================================================== # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as @@ -18,6 +18,12 @@ # 2 along with this work; if not, see . # =========================================================================== +.PHONY : all + +all : + +include $(SPEC) +include $(TOPDIR)/make/common/MakeBase.gmk include $(TOPDIR)/closed/JPP.gmk RecursiveWildcard = $(foreach dir,$(wildcard $1/*),$(call RecursiveWildcard,$(dir),$2) $(filter $(subst *,%,$2),$(dir))) @@ -54,8 +60,6 @@ $(eval $(call SetupCopyFiles,COPY_OVERLAY_FILES, \ IncludeIfUnsure := -includeIfUnsure -noWarnIncludeIf -J9JCL_SOURCES_DONEFILE := $(MAKESUPPORT_OUTPUTDIR)/j9jcl.done - $(J9JCL_SOURCES_DONEFILE) : \ $(foreach dir, $(JppSourceDirs), $(call RecursiveWildcard,$(dir),*)) \ $(COPY_OVERLAY_FILES) @@ -77,5 +81,4 @@ $(J9JCL_SOURCES_DONEFILE) : \ @$(MKDIR) -p $(@D) @$(TOUCH) $@ -# Force (re-)generation of module dependencies after preprocessing OpenJ9 source files. -$(MODULE_DEPS_MAKEFILE) : $(J9JCL_SOURCES_DONEFILE) +all : $(J9JCL_SOURCES_DONEFILE) diff --git a/closed/OpenJ9.gmk b/closed/OpenJ9.gmk index 39db32be18a..715d8948b75 100644 --- a/closed/OpenJ9.gmk +++ b/closed/OpenJ9.gmk @@ -27,6 +27,7 @@ ifeq (,$(wildcard $(SPEC))) endif include $(SPEC) include $(TOPDIR)/make/common/MakeBase.gmk +include $(TOPDIR)/closed/JPP.gmk ifeq (,$(BUILD_ID)) BUILD_ID := 000000 diff --git a/closed/autoconf/custom-spec.gmk.in b/closed/autoconf/custom-spec.gmk.in index b161a726ab0..ddb2a52f088 100644 --- a/closed/autoconf/custom-spec.gmk.in +++ b/closed/autoconf/custom-spec.gmk.in @@ -180,6 +180,7 @@ $(foreach var, \ $(eval $(var) += -I$(SUPPORT_OUTPUTDIR)/openj9_include)) J9JCL_SOURCES_DIR := $(SUPPORT_OUTPUTDIR)/j9jcl +J9JCL_SOURCES_DONEFILE := $(MAKESUPPORT_OUTPUTDIR)/j9jcl.done # Required by OpenJCEPlus. BUILD_OPENJCEPLUS := @BUILD_OPENJCEPLUS@ diff --git a/closed/custom/Main.gmk b/closed/custom/Main.gmk index cc02302e056..03de59d28f5 100644 --- a/closed/custom/Main.gmk +++ b/closed/custom/Main.gmk @@ -1,5 +1,5 @@ # =========================================================================== -# (c) Copyright IBM Corp. 2017, 2024 All Rights Reserved +# (c) Copyright IBM Corp. 2017, 2023 All Rights Reserved # =========================================================================== # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as @@ -35,6 +35,14 @@ PHASE_MAKEDIRS := $(TOPDIR)/closed/make $(PHASE_MAKEDIRS) OPENJ9_MAKE := $(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/closed/OpenJ9.gmk +# An early part of the build process involves computing the list of main targets. +# Those targets include {module}-java, {module}-jmod, etc. which requires that the +# set of module names be known. We must build and run the preprocessor to ensure the +# modules specific to OpenJ9 will be found and included in that set. The next two +# rules make that happen. + +create-main-targets-include java.base-gensrc : generate-j9jcl-sources + j9vm-build : buildtools-langtools ifeq ($(BUILD_OPENSSL),yes) @+$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/closed/openssl.gmk diff --git a/closed/custom/common/Modules.gmk b/closed/custom/common/Modules.gmk index 1a10f342467..394236b8885 100644 --- a/closed/custom/common/Modules.gmk +++ b/closed/custom/common/Modules.gmk @@ -1,5 +1,5 @@ # =========================================================================== -# (c) Copyright IBM Corp. 2017, 2024 All Rights Reserved +# (c) Copyright IBM Corp. 2017, 2023 All Rights Reserved # =========================================================================== # This code is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2 only, as @@ -59,3 +59,16 @@ TOP_SRC_DIRS += \ ifeq (true,$(BUILD_OPENJCEPLUS)) TOP_SRC_DIRS += $(OPENJCEPLUS_TOPDIR)/src/main endif + +.PHONY : generate-j9jcl-sources + +generate-j9jcl-sources $(J9JCL_SOURCES_DONEFILE) : + @+$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/closed/GensrcJ9JCL.gmk + +# When building multiple configurations at once (e.g. 'make CONF= images') +# the 'create-main-targets-include' target will only be considered for the +# first configuration; J9JCL source generation will be delayed for other +# configurations. In order to produce a complete module-deps.gmk, we need +# to ensure that the J9JCL source has been generated. + +-include $(J9JCL_SOURCES_DONEFILE)