diff --git a/closed/CopySupport.gmk b/closed/CopySupport.gmk index 0efde722a8..d3d35dabad 100644 --- a/closed/CopySupport.gmk +++ b/closed/CopySupport.gmk @@ -24,76 +24,54 @@ endif EXE_DST_DIR := $(call FindExecutableDirForModule, $(MODULE)) +# openj9_debuginfo_sources +# ------------------------ +# $1 - representative path ifeq (macosx,$(OPENJDK_TARGET_OS)) - DEBUGINFO_SRC_SUFFIX := .dSYM + openj9_debuginfo_sources = $(wildcard $1.dSYM/Contents/Info.plist $1.dSYM/Contents/Resources/DWARF/$(notdir $1)) else ifeq (windows,$(OPENJDK_TARGET_OS)) - DEBUGINFO_SRC_SUFFIX := .pdb + openj9_debuginfo_sources = $(wildcard $(addprefix $(basename $1),.map .pdb)) else - DEBUGINFO_SRC_SUFFIX := .debuginfo + openj9_debuginfo_sources = $(wildcard $(basename $1).debuginfo) endif ifeq (true,$(ZIP_EXTERNAL_DEBUG_SYMBOLS)) - DEBUGINFO_DST_SUFFIX := .diz -else - DEBUGINFO_DST_SUFFIX := $(DEBUGINFO_SRC_SUFFIX) -endif -# openj9_make_debuginfo_paths -# --------------------------- -# $1 - required suffix -# $2 - input paths -openj9_make_debuginfo_paths = \ - $(if $(filter .dSYM, $1), \ - $(addsuffix .dSYM, $2), \ - $(foreach path, $2, $(path:$(suffix $(path))=$1))) - -# openj9_copy_debuginfo_rule -# -------------------------- -# $1 - source file path -# $2 - target file path -define openj9_copy_debuginfo_rule - TARGETS += $2 - $2 : $1 - ifneq (,$(and $(filter %$(DEBUGINFO_SRC_SUFFIX),$1),$(filter %.diz,$2))) +# openj9_copy_debuginfos +# ---------------------- +# $1 - sequence of file paths +openj9_copy_debuginfos = \ + $(if $(call openj9_debuginfo_sources,$(word 1,$1)), \ + $(eval $(call openj9_zip_files,$(dir $(word 1,$1)),$(call openj9_debuginfo_sources,$(word 1,$1)),$(basename $(word 2,$1)).diz)) \ + $(if $(word 3,$1),$(call openj9_copy_files,,$(addsuffix .diz,$(basename $(wordlist 2,$(words $1),$1)))))) + +# openj9_zip_files +# ---------------- +# $1 - working directory +# $2 - source file paths +# $3 - target file path +define openj9_zip_files + TARGETS += $3 + $3 : $2 $(call MakeTargetDir) - ($(CD) $$(