Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell11
提交
f6b201a7
D
dragonwell11
项目概览
openanolis
/
dragonwell11
通知
7
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell11
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f6b201a7
编写于
11月 15, 2017
作者:
E
erikj
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8190702: JMC packaging causing errors in JDK 10 consolidated repo (macOS)
Reviewed-by: tbell
上级
b1f0a0f5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
46 addition
and
11 deletion
+46
-11
make/common/MakeBase.gmk
make/common/MakeBase.gmk
+26
-9
test/make/TestCopyFiles.gmk
test/make/TestCopyFiles.gmk
+20
-2
未找到文件。
make/common/MakeBase.gmk
浏览文件 @
f6b201a7
...
...
@@ -473,15 +473,32 @@ EncodeSpace = \
$(subst $(SPACE),?,$(strip $1))
################################################################################
# Make directory without forking mkdir if not needed
# Make directory without forking mkdir if not needed.
#
# If a directory with an encoded space is provided, the wildcard function
# sometimes returns false answers (typically if the dir existed when the
# makefile was parsed, but was deleted by a previous rule). In that case, always
# call mkdir regardless of what wildcard says.
#
# 1: List of directories to create
MakeDir = \
$(strip \
$(eval MakeDir_dirs_to_make := $(strip $(foreach d, $1, $(if $(wildcard $d), , \
"$(call DecodeSpace, $d)")))) \
$(eval MakeDir_dirs_to_make := $(strip $(foreach d, $1, \
$(if $(findstring ?, $d), '$(call DecodeSpace, $d)', \
$(if $(wildcard $d), , $d) \
) \
))) \
$(if $(MakeDir_dirs_to_make), $(shell $(MKDIR) -p $(MakeDir_dirs_to_make))) \
)
# Make directory for target file. Should handle spaces in filenames. Just
# calling $(call MakeDir $(@D)) will not work if the directory contains a space
# and the target file already exists. In that case, the target file will have
# its wildcard ? resolved and the $(@D) will evaluate each space separated dir
# part on its own.
MakeTargetDir = \
$(call MakeDir, $(dir $(call EncodeSpace, $@)))
################################################################################
# Assign a variable only if it is empty
# Param 1 - Variable to assign
...
...
@@ -499,7 +516,7 @@ ifeq ($(OPENJDK_TARGET_OS),solaris)
# If the source and target parent directories are the same, recursive copy doesn't work
# so we fall back on regular copy, which isn't preserving symlinks.
define install-file
$(call Make
Dir, $(@D)
)
$(call Make
TargetDir
)
$(RM) '$(call DecodeSpace, $@)'
if [ '$(call DecodeSpace, $(dir $@))' != \
'$(call DecodeSpace, $(dir $(call EncodeSpace, $<)))' ]; then \
...
...
@@ -526,21 +543,21 @@ else ifeq ($(OPENJDK_TARGET_OS),macosx)
# If copying a soft link to a directory, need to delete the target first to avoid
# weird errors.
define install-file
$(call Make
Dir, $(@D)
)
$(call Make
TargetDir
)
$(RM) '$(call DecodeSpace, $@)'
$(CP) -fRP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
if [ -n "`$(XATTR) -ls '$(call DecodeSpace, $@)'`" ]; then $(XATTR) -cs '$(call DecodeSpace, $@)'; fi
endef
else
define install-file
$(call Make
Dir, $(@D)
)
$(call Make
TargetDir
)
$(CP) -fP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
endef
endif
# Variant of install file that does not preserve symlinks
define install-file-nolink
$(call Make
Dir, $(@D)
)
$(call Make
TargetDir
)
$(CP) -f '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
endef
...
...
@@ -590,13 +607,13 @@ RelativePath = \
# careful when using this on Windows since the symlink created is only valid in
# the unix emulation environment.
define link-file-relative
$(call Make
Dir, $(@D)
)
$(call Make
TargetDir
)
$(RM) '$(call DecodeSpace, $@)'
$(LN) -s '$(call DecodeSpace, $(call RelativePath, $<, $(@D)))' '$(call DecodeSpace, $@)'
endef
define link-file-absolute
$(call Make
Dir, $(@D)
)
$(call Make
TargetDir
)
$(RM) '$(call DecodeSpace, $@)'
$(LN) -s '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'
endef
...
...
test/make/TestCopyFiles.gmk
浏览文件 @
f6b201a7
...
...
@@ -44,6 +44,7 @@ SRC_DIR := $(OUTPUT_DIR)/src
DEST_DIR := $(OUTPUT_DIR)/dest
$(OUTPUT_DIR)/_src_created: $(DEPS)
$(RM) -r $(DEST_DIR)
$(RM) -r $(SRC_DIR)
$(MKDIR) -p $(SRC_DIR)
$(MKDIR) -p $(SRC_DIR)/foo
...
...
@@ -51,7 +52,7 @@ $(OUTPUT_DIR)/_src_created: $(DEPS)
$(TOUCH) $(SRC_DIR)/foo/foofile
$(TOUCH) "$(SRC_DIR)/foo/foo file"
# Spaces in directories only works with gnu make 4.0 or later
ifeq (4.0, $(firstword $(sort 4.0 $(MAKE_VERSION))))
ifeq (4.0
dfd
, $(firstword $(sort 4.0 $(MAKE_VERSION))))
$(MKDIR) -p "$(SRC_DIR)/foo bar"
$(TOUCH) "$(SRC_DIR)/foo bar/foobarfile"
$(TOUCH) "$(SRC_DIR)/foo bar/foo bar file"
...
...
@@ -65,15 +66,32 @@ $(eval $(call SetupCopyFiles, COPY_1, \
FILES := $(call CacheFind, $(SRC_DIR)), \
))
# Optionally define a rule that deletes all the target files after the makefile
# has been parsed. GNU make has specific problems with this in combination with
# spaces in directory names.
ifeq ($(DELETE_FIRST), true)
delete-targets:
$(RM) -r $(DEST_DIR)
$(ECHO) '$(DEST_DIR)/foo' '$(wildcard $(DEST_DIR)/foo)'
$(COPY_1): delete-targets
endif
do-copy1: $(COPY_1)
run-test1: $(OUTPUT_DIR)/_src_created
$(ECHO) "Copy 1 first time"
+$(MAKE) -f $(THIS_FILE) do-copy1
$(DIFF) -r $(SRC_DIR) $(DEST_DIR)
# Rerun the copy a second time, with the targets present at make parse
# time, but then deleted by a prerequisite rule.
$(ECHO) "Copy 1 second time"
+$(MAKE) -f $(THIS_FILE) do-copy1 DELETE_FIRST=true
$(DIFF) -r $(SRC_DIR) $(DEST_DIR)
TEST_TARGETS += run-test1
.PHONY: do-copy1 run-test1
.PHONY: do-copy1 run-test1
delete-targets
################################################################################
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录