diff --git a/closed/GensrcJ9JCL.gmk b/closed/GensrcJ9JCL.gmk index 8b9b1b75ef3..4cfe82477da 100644 --- a/closed/GensrcJ9JCL.gmk +++ b/closed/GensrcJ9JCL.gmk @@ -61,7 +61,7 @@ $(J9JCL_SOURCES_DONEFILE) : \ @$(MKDIR) -p $(J9TOOLS_DIR) $(MAKE) $(MAKE_ARGS) -C $(OPENJ9_TOPDIR)/sourcetools -f buildj9tools.mk \ BOOT_JDK=$(BOOT_JDK) \ - DEST_DIR=$(call FixPath,$(J9TOOLS_DIR)) \ + DEST_DIR=$(call MixedPath,$(J9TOOLS_DIR)) \ JAVA_HOME=$(BOOT_JDK) \ preprocessor @$(ECHO) Generating J9JCL sources diff --git a/closed/JPP.gmk b/closed/JPP.gmk index cc95d6261fd..a9474f2916f 100644 --- a/closed/JPP.gmk +++ b/closed/JPP.gmk @@ -36,28 +36,17 @@ endif # OPENJ9_ENABLE_INLINE_TYPES # $3 - destination subdirectory # $4 - more options (optional) define RunJPP - @$(ECHO) $(BOOT_JDK)/bin/java \ - -cp "$(call FixPath,$(JPP_JAR))" \ + $(call EchoAndRun, $(BOOT_JDK)/bin/java \ + -cp "$(call MixedPath,$(JPP_JAR))" \ -Dfile.encoding=US-ASCII \ com.ibm.jpp.commandline.CommandlineBuilder \ -verdict \ -config $1 \ - -baseDir "$(call FixPath,$(dir $2))" \ + -baseDir "$(call MixedPath,$(dir $2))" \ -srcRoot $(notdir $2)/ \ - -xml "$(call FixPath,$(OPENJ9_TOPDIR)/jcl/jpp_configuration.xml)" \ - -dest "$(call FixPath,$(SUPPORT_OUTPUTDIR)$(strip $3))" \ + -xml "$(call MixedPath,$(OPENJ9_TOPDIR)/jcl/jpp_configuration.xml)" \ + -dest "$(call MixedPath,$(SUPPORT_OUTPUTDIR)$(strip $3))" \ -tag:define "$(subst $(SPACE),;,$(sort $(JPP_TAGS)))" \ - $4 - @$(BOOT_JDK)/bin/java \ - -cp "$(call FixPath,$(JPP_JAR))" \ - -Dfile.encoding=US-ASCII \ - com.ibm.jpp.commandline.CommandlineBuilder \ - -verdict \ - -config $1 \ - -baseDir "$(call FixPath,$(dir $2))" \ - -srcRoot $(notdir $2)/ \ - -xml "$(call FixPath,$(OPENJ9_TOPDIR)/jcl/jpp_configuration.xml)" \ - -dest "$(call FixPath,$(SUPPORT_OUTPUTDIR)$(strip $3))" \ - -tag:define "$(subst $(SPACE),;,$(sort $(JPP_TAGS)))" \ - $4 + $4 \ + ) endef # RunJPP diff --git a/closed/OpenJ9.gmk b/closed/OpenJ9.gmk index 7de6de33042..83d937eb37b 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 @@ -318,8 +319,6 @@ $(foreach file, \ $(notdir $(wildcard $(OPENJ9_TOPDIR)/buildspecs/*)), \ $(eval $(call openj9_stage_buildspec_file,$(file)))) -J9TOOLS_DIR := $(SUPPORT_OUTPUTDIR)/j9tools - stage-j9 : @$(ECHO) Staging OpenJ9 runtime in $(OUTPUTDIR)/vm $(call openj9_copy_tree,$(OUTPUTDIR)/vm,$(OPENJ9_TOPDIR)/runtime) @@ -484,13 +483,13 @@ run-preprocessors-j9 : stage-j9 +BOOT_JDK=$(BOOT_JDK) $(EXPORT_COMPILER_ENV_VARS) OPENJDK_VERSION_NUMBER_FOUR_POSITIONS=$(VERSION_NUMBER_FOUR_POSITIONS) \ $(MAKE) $(MAKE_ARGS) -C $(OUTPUTDIR)/vm -f $(OPENJ9_TOPDIR)/runtime/buildtools.mk \ BUILD_ID=$(BUILD_ID) \ - DEST_DIR=$(call FixPath,$(J9TOOLS_DIR)) \ + DEST_DIR=$(call MixedPath,$(J9TOOLS_DIR)) \ EXTRA_CONFIGURE_ARGS=$(OMR_EXTRA_CONFIGURE_ARGS) \ FREEMARKER_JAR="$(FREEMARKER_JAR)" \ J9VM_SHA=$(OPENJ9_SHA) \ JAVA_HOME=$(BOOT_JDK) \ OMR_DIR=$(OUTPUTDIR)/vm/omr \ - SOURCETOOLS_DIR=$(call FixPath,$(OPENJ9_TOPDIR))/sourcetools \ + SOURCETOOLS_DIR=$(call MixedPath,$(OPENJ9_TOPDIR))/sourcetools \ SPEC=$(OPENJ9_BUILDSPEC) \ UMA_OPTIONS_EXTRA="-buildDate $(shell date +'%Y%m%d')" \ VERSION_MAJOR=$(VERSION_FEATURE) \ diff --git a/closed/custom/common/MakeBase.gmk b/closed/custom/common/MakeBase.gmk new file mode 100644 index 00000000000..bc55724eefe --- /dev/null +++ b/closed/custom/common/MakeBase.gmk @@ -0,0 +1,34 @@ +# =========================================================================== +# (c) Copyright IBM Corp. 2023, 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 +# published by the Free Software Foundation. +# +# IBM designates this particular file as subject to the "Classpath" exception +# as provided by IBM in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, see . +# =========================================================================== + +# Echo a command and then execute it. +# $1 - the command +define EchoAndRun + @ $(ECHO) $1 + @ $1 +endef + +# On Windows, FixPath yields backslashes which can cause problems, so +# we use PATHTOOL instead for tools (like java) that support both. +ifeq ($(call isTargetOs, windows), true) + MixedPath = $(shell $(PATHTOOL) -m $1) +else + MixedPath = $1 +endif