diff --git a/make/Bundles.gmk b/make/Bundles.gmk index ba8ec0c864b..cf3b77e4e52 100644 --- a/make/Bundles.gmk +++ b/make/Bundles.gmk @@ -301,7 +301,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), ) $(call LogWarn, Signing $(JDK_BUNDLE_NAME)) $(CODESIGN) -s "$(MACOSX_CODESIGN_IDENTITY)" \ --timestamp --options runtime --deep --force \ - $(JDK_MACOSX_BUNDLE_DIR_SIGNED)/$(JDK_MACOSX_BUNDLE_TOP_DIR) $(LOG_DEBUG) + $(JDK_MACOSX_BUNDLE_DIR_SIGNED)/$(JDK_MACOSX_BUNDLE_TOP_SUBDIR) $(LOG_DEBUG) $(TOUCH) $@ $(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \ @@ -330,7 +330,7 @@ ifneq ($(filter product-bundles% legacy-bundles, $(MAKECMDGOALS)), ) $(call LogWarn, Signing $(JRE_BUNDLE_NAME)) $(CODESIGN) -s "$(MACOSX_CODESIGN_IDENTITY)" \ --timestamp --options runtime --deep --force \ - $(JRE_MACOSX_BUNDLE_DIR_SIGNED)/$(JRE_MACOSX_BUNDLE_TOP_DIR) $(LOG_DEBUG) + $(JRE_MACOSX_BUNDLE_DIR_SIGNED)/$(JRE_MACOSX_BUNDLE_TOP_SUBDIR) $(LOG_DEBUG) $(TOUCH) $@ $(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \ diff --git a/make/autoconf/spec.gmk.template b/make/autoconf/spec.gmk.template index e3345940101..ab6bb51c27e 100644 --- a/make/autoconf/spec.gmk.template +++ b/make/autoconf/spec.gmk.template @@ -898,12 +898,14 @@ JDK_MACOSX_BUNDLE_DIR = $(IMAGES_OUTPUTDIR)/$(JDK_MACOSX_BUNDLE_SUBDIR) JRE_MACOSX_BUNDLE_DIR = $(IMAGES_OUTPUTDIR)/$(JRE_MACOSX_BUNDLE_SUBDIR) JDK_MACOSX_BUNDLE_DIR_SIGNED = $(IMAGES_OUTPUTDIR)/$(JDK_MACOSX_BUNDLE_SUBDIR_SIGNED) JRE_MACOSX_BUNDLE_DIR_SIGNED = $(IMAGES_OUTPUTDIR)/$(JRE_MACOSX_BUNDLE_SUBDIR_SIGNED) -JDK_MACOSX_BUNDLE_TOP_DIR = jdk-$(VERSION_NUMBER).jdk -JRE_MACOSX_BUNDLE_TOP_DIR = jre-$(VERSION_NUMBER).jre -JDK_MACOSX_CONTENTS_SUBDIR = $(JDK_MACOSX_BUNDLE_TOP_DIR)/Contents -JRE_MACOSX_CONTENTS_SUBDIR = $(JRE_MACOSX_BUNDLE_TOP_DIR)/Contents +JDK_MACOSX_BUNDLE_TOP_SUBDIR = jdk-$(VERSION_NUMBER).jdk +JRE_MACOSX_BUNDLE_TOP_SUBDIR = jre-$(VERSION_NUMBER).jre +JDK_MACOSX_CONTENTS_SUBDIR = $(JDK_MACOSX_BUNDLE_TOP_SUBDIR)/Contents +JRE_MACOSX_CONTENTS_SUBDIR = $(JRE_MACOSX_BUNDLE_TOP_SUBDIR)/Contents JDK_MACOSX_CONTENTS_DIR = $(JDK_MACOSX_BUNDLE_DIR)/$(JDK_MACOSX_CONTENTS_SUBDIR) JRE_MACOSX_CONTENTS_DIR = $(JRE_MACOSX_BUNDLE_DIR)/$(JRE_MACOSX_CONTENTS_SUBDIR) +JDK_MACOSX_BUNDLE_TOP_DIR = $(JDK_MACOSX_BUNDLE_DIR)/$(JDK_MACOSX_BUNDLE_TOP_SUBDIR) +JRE_MACOSX_BUNDLE_TOP_DIR = $(JRE_MACOSX_BUNDLE_DIR)/$(JRE_MACOSX_BUNDLE_TOP_SUBDIR) # Bundle names ifneq ($(VERSION_BUILD), ) diff --git a/make/common/Execute.gmk b/make/common/Execute.gmk index 1ee3c28261b..4199e8f13b7 100644 --- a/make/common/Execute.gmk +++ b/make/common/Execute.gmk @@ -82,6 +82,8 @@ ifeq ($(INCLUDE), true) # INFO : Message to display at LOG=info level when running command (optional) # WARN : Message to display at LOG=warn level when running command (optional) # DEPS : Dependencies for the execution to take place +# DRYRUN : Set to true to perform everything but executing the command \ +# (defaults to false, primarily intended for debugging) # # Setup make rules for copying files, with an option to do more complex @@ -161,8 +163,13 @@ define SetupExecuteBody $$(TOUCH) $$@ $$($1_EXEC_RESULT): $$($1_PRE_MARKER) - $$(call ExecuteWithLog, $$($1_BASE)_exec, \ - cd $$($1_WORKING_DIR) && $$($1_COMMAND)) + ifneq ($$($1_DRYRUN), true) + $$(call ExecuteWithLog, $$($1_BASE)_exec, \ + cd $$($1_WORKING_DIR) && $$($1_COMMAND)) + else + $$(call LogWarn, DRYRUN enabled for $1, not actually running command) + $$(TOUCH) $$@ + endif ifeq ($$($1_EXEC_RESULT), $$($1_EXEC_MARKER)) $$(TOUCH) $$@ endif @@ -177,8 +184,13 @@ define SetupExecuteBody $$(call LogInfo, $$($1_INFO)) endif $$(call MakeDir, $$(call EncodeSpace, $$($1_WORKING_DIR)) $$(call EncodeSpace, $$($1_SUPPORT_DIR)) $$(call EncodeSpace, $$($1_OUTPUT_DIR))) - $$(call ExecuteWithLog, $$($1_BASE)_exec, \ - cd $$($1_WORKING_DIR) && $$($1_COMMAND)) + ifneq ($$($1_DRYRUN), true) + $$(call ExecuteWithLog, $$($1_BASE)_exec, \ + cd $$($1_WORKING_DIR) && $$($1_COMMAND)) + else + $$(call LogWarn, DRYRUN enabled for $1, not actually running command) + $$(TOUCH) $$@ + endif ifeq ($$($1_EXEC_RESULT), $$($1_EXEC_MARKER)) $$(TOUCH) $$@ endif diff --git a/test/make/TestExecute.gmk b/test/make/TestExecute.gmk index f71a402502e..5d57d244c39 100644 --- a/test/make/TestExecute.gmk +++ b/test/make/TestExecute.gmk @@ -60,10 +60,30 @@ $(eval $(call SetupExecute, EXEC_2, \ run-test2: $(EXEC_2) test -f $(OUTPUT_DIR)/exec_2/special/specialfile +$(eval $(call SetupExecute, EXEC_3, \ + INFO := Testing that SetupExecute with DRYRUN does nothing, \ + OUTPUT_DIR := $(OUTPUT_DIR)/exec_3, \ + DRYRUN := true, \ + COMMAND := $(ECHO) "This should not happen" > $(OUTPUT_DIR)/exec_3/dryrunfile, \ +)) -TEST_TARGETS += run-test1 run-test2 +run-test3: $(EXEC_3) + test ! -f $(OUTPUT_DIR)/exec_3/dryrunfile -.PHONY: run-test1 run-test2 +$(eval $(call SetupExecute, EXEC_4, \ + INFO := Testing that SetupExecute with DRYRUN does nothing but touches output file, \ + OUTPUT_FILE := $(OUTPUT_DIR)/exec_4/output, \ + DRYRUN := true, \ + COMMAND := $(ECHO) "This should not happen" > $(OUTPUT_DIR)/exec_4/dryrunfile, \ +)) + +run-test4: $(EXEC_4) + test ! -f $(OUTPUT_DIR)/exec_4/dryrunfile + test -f $(OUTPUT_DIR)/exec_4/output + +TEST_TARGETS += run-test1 run-test2 run-test3 run-test4 + +.PHONY: run-test1 run-test2 run-test3 run-test4 ################################################################################