Skip to content

Commit 7d002c3

Browse files
authored
Merge pull request ibmruntimes#356 from keithc-ca/revert-deps
Revert "Simplify and improve module dependency management"
2 parents 47e14b2 + aa18b22 commit 7d002c3

File tree

5 files changed

+33
-7
lines changed

5 files changed

+33
-7
lines changed

closed/custom/Main-post.gmk renamed to closed/GensrcJ9JCL.gmk

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# (c) Copyright IBM Corp. 2020, 2024 All Rights Reserved
2+
# (c) Copyright IBM Corp. 2020, 2023 All Rights Reserved
33
# ===========================================================================
44
# This code is free software; you can redistribute it and/or modify it
55
# under the terms of the GNU General Public License version 2 only, as
@@ -18,6 +18,12 @@
1818
# 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
1919
# ===========================================================================
2020

21+
.PHONY : all
22+
23+
all :
24+
25+
include $(SPEC)
26+
include $(TOPDIR)/make/common/MakeBase.gmk
2127
include $(TOPDIR)/closed/JPP.gmk
2228

2329
RecursiveWildcard = $(foreach dir,$(wildcard $1/*),$(call RecursiveWildcard,$(dir),$2) $(filter $(subst *,%,$2),$(dir)))
@@ -54,8 +60,6 @@ $(eval $(call SetupCopyFiles,COPY_OVERLAY_FILES, \
5460

5561
IncludeIfUnsure := -includeIfUnsure -noWarnIncludeIf
5662

57-
J9JCL_SOURCES_DONEFILE := $(MAKESUPPORT_OUTPUTDIR)/j9jcl.done
58-
5963
$(J9JCL_SOURCES_DONEFILE) : \
6064
$(foreach dir, $(JppSourceDirs), $(call RecursiveWildcard,$(dir),*)) \
6165
$(COPY_OVERLAY_FILES)
@@ -77,5 +81,4 @@ $(J9JCL_SOURCES_DONEFILE) : \
7781
@$(MKDIR) -p $(@D)
7882
@$(TOUCH) $@
7983

80-
# Force (re-)generation of module dependencies after preprocessing OpenJ9 source files.
81-
$(MODULE_DEPS_MAKEFILE) : $(J9JCL_SOURCES_DONEFILE)
84+
all : $(J9JCL_SOURCES_DONEFILE)

closed/OpenJ9.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ifeq (,$(wildcard $(SPEC)))
2727
endif
2828
include $(SPEC)
2929
include $(TOPDIR)/make/common/MakeBase.gmk
30+
include $(TOPDIR)/closed/JPP.gmk
3031

3132
ifeq (,$(BUILD_ID))
3233
BUILD_ID := 000000

closed/autoconf/custom-spec.gmk.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ $(foreach var, \
180180
$(eval $(var) += -I$(SUPPORT_OUTPUTDIR)/openj9_include))
181181

182182
J9JCL_SOURCES_DIR := $(SUPPORT_OUTPUTDIR)/j9jcl
183+
J9JCL_SOURCES_DONEFILE := $(MAKESUPPORT_OUTPUTDIR)/j9jcl.done
183184

184185
# Required by OpenJCEPlus.
185186
BUILD_OPENJCEPLUS := @BUILD_OPENJCEPLUS@

closed/custom/Main.gmk

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# (c) Copyright IBM Corp. 2017, 2024 All Rights Reserved
2+
# (c) Copyright IBM Corp. 2017, 2023 All Rights Reserved
33
# ===========================================================================
44
# This code is free software; you can redistribute it and/or modify it
55
# under the terms of the GNU General Public License version 2 only, as
@@ -35,6 +35,14 @@ PHASE_MAKEDIRS := $(TOPDIR)/closed/make $(PHASE_MAKEDIRS)
3535

3636
OPENJ9_MAKE := $(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/closed/OpenJ9.gmk
3737

38+
# An early part of the build process involves computing the list of main targets.
39+
# Those targets include {module}-java, {module}-jmod, etc. which requires that the
40+
# set of module names be known. We must build and run the preprocessor to ensure the
41+
# modules specific to OpenJ9 will be found and included in that set. The next two
42+
# rules make that happen.
43+
44+
create-main-targets-include java.base-gensrc : generate-j9jcl-sources
45+
3846
j9vm-build : buildtools-langtools
3947
ifeq ($(BUILD_OPENSSL),yes)
4048
@+$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/closed/openssl.gmk

closed/custom/common/Modules.gmk

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ===========================================================================
2-
# (c) Copyright IBM Corp. 2017, 2024 All Rights Reserved
2+
# (c) Copyright IBM Corp. 2017, 2023 All Rights Reserved
33
# ===========================================================================
44
# This code is free software; you can redistribute it and/or modify it
55
# under the terms of the GNU General Public License version 2 only, as
@@ -59,3 +59,16 @@ TOP_SRC_DIRS += \
5959
ifeq (true,$(BUILD_OPENJCEPLUS))
6060
TOP_SRC_DIRS += $(OPENJCEPLUS_TOPDIR)/src/main
6161
endif
62+
63+
.PHONY : generate-j9jcl-sources
64+
65+
generate-j9jcl-sources $(J9JCL_SOURCES_DONEFILE) :
66+
@+$(MAKE) $(MAKE_ARGS) -f $(TOPDIR)/closed/GensrcJ9JCL.gmk
67+
68+
# When building multiple configurations at once (e.g. 'make CONF= images')
69+
# the 'create-main-targets-include' target will only be considered for the
70+
# first configuration; J9JCL source generation will be delayed for other
71+
# configurations. In order to produce a complete module-deps.gmk, we need
72+
# to ensure that the J9JCL source has been generated.
73+
74+
-include $(J9JCL_SOURCES_DONEFILE)

0 commit comments

Comments
 (0)