Skip to content

Commit 11778a0

Browse files
Release: Don't use cp -l on macOS
`cp` on macOS doesn't support hardlinks and option `-l` which is used on Linux builds, therefore `cp` flags used to copy files locally should be system-dependent. Signed-off-by: Anton Kolesov <[email protected]>
1 parent 5bf5b95 commit 11778a0

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

release.mk

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,11 @@ override WGETFLAGS += -nv
135135

136136
ifneq ($(HOST),macos)
137137
MD5SUM := md5sum
138+
LOCAL_CP := cp -al
138139
else
139140
MD5SUM := md5 -r
141+
# macOS' `cp` doesn't support hardlinks and `-l`.
142+
LOCAL_CP := cp -a
140143
endif
141144

142145
# RELEASE_TAG is a literal Git tag, like arc-2016.09-rc1.
@@ -552,9 +555,9 @@ $O/.stamp_linux_le_hs_built: $O/.stamp_linux_le_700_built $O/.stamp_linux_le_hs3
552555
--release-name "$(RELEASE)" \
553556
--cpu hs38 \
554557
--no-elf32
555-
cp -al $O/$(TOOLS_LINUXLE_700_DIR_LINUX)/arc-snps-linux-uclibc/sysroot \
558+
$(LOCAL_CP) $O/$(TOOLS_LINUXLE_700_DIR_LINUX)/arc-snps-linux-uclibc/sysroot \
556559
$O/$(TOOLS_LINUXLE_HS_DIR_LINUX)/arc-snps-linux-uclibc/sysroot-arc700
557-
cp -al $O/$(TOOLS_LINUXLE_HS38FPU_DIR_LINUX)/arc-snps-linux-uclibc/sysroot \
560+
$(LOCAL_CP) $O/$(TOOLS_LINUXLE_HS38FPU_DIR_LINUX)/arc-snps-linux-uclibc/sysroot \
558561
$O/$(TOOLS_LINUXLE_HS_DIR_LINUX)/arc-snps-linux-uclibc/sysroot-hs38_linux
559562
$(call copy_pdf_doc_file,$O/$(TOOLS_LINUXLE_HS_DIR_LINUX))
560563
touch $@
@@ -575,7 +578,7 @@ $O/.stamp_linux_be_hs_built: $O/.stamp_linux_be_700_built $(TOOLS_ALL_DEPS-y) \
575578
--big-endian \
576579
--cpu hs38 \
577580
--no-elf32
578-
cp -al $O/$(TOOLS_LINUXBE_700_DIR_LINUX)/arceb-snps-linux-uclibc/sysroot \
581+
$(LOCAL_CP) $O/$(TOOLS_LINUXBE_700_DIR_LINUX)/arceb-snps-linux-uclibc/sysroot \
579582
$O/$(TOOLS_LINUXBE_HS_DIR_LINUX)/arceb-snps-linux-uclibc/sysroot-arc700
580583
$(call copy_pdf_doc_file,$O/$(TOOLS_LINUXBE_HS_DIR_LINUX))
581584
touch $@
@@ -766,14 +769,14 @@ $O/.stamp_ide_linux_tar: \
766769
$O/.stamp_ide_linux_eclipse \
767770
$O/.stamp_elf_be_built $O/.stamp_elf_le_built \
768771
$O/.stamp_linux_be_hs_built $O/.stamp_linux_le_hs_built
769-
cp -al $O/$(TOOLS_ELFLE_DIR_LINUX)/* $O/$(IDE_INSTALL_LINUX)
770-
cp -al $O/$(TOOLS_ELFBE_DIR_LINUX)/* $O/$(IDE_INSTALL_LINUX)
771-
cp -al $O/$(TOOLS_LINUXLE_HS_DIR_LINUX)/* $O/$(IDE_INSTALL_LINUX)
772-
cp -al $O/$(TOOLS_LINUXBE_HS_DIR_LINUX)/* $O/$(IDE_INSTALL_LINUX)
772+
$(LOCAL_CP) $O/$(TOOLS_ELFLE_DIR_LINUX)/* $O/$(IDE_INSTALL_LINUX)
773+
$(LOCAL_CP) $O/$(TOOLS_ELFBE_DIR_LINUX)/* $O/$(IDE_INSTALL_LINUX)
774+
$(LOCAL_CP) $O/$(TOOLS_LINUXLE_HS_DIR_LINUX)/* $O/$(IDE_INSTALL_LINUX)
775+
$(LOCAL_CP) $O/$(TOOLS_LINUXBE_HS_DIR_LINUX)/* $O/$(IDE_INSTALL_LINUX)
773776
mkdir -m775 $O/$(IDE_INSTALL_LINUX)/eclipse/jre
774777
tar xf $O/$(JRE_TGZ_LINUX) -C $O/$(IDE_INSTALL_LINUX)/eclipse/jre \
775778
--strip-components=1
776-
cp -al $O/$(OOCD_DIR_LINUX)/* $O/$(IDE_INSTALL_LINUX)
779+
$(LOCAL_CP) $O/$(OOCD_DIR_LINUX)/* $O/$(IDE_INSTALL_LINUX)
777780
tar czf $O/$(IDE_TGZ_LINUX) -C $O $(IDE_INSTALL_LINUX)
778781
touch $@
779782
endif

0 commit comments

Comments
 (0)