diff --git a/Makefile b/Makefile index 7d7d225f..9459f113 100644 --- a/Makefile +++ b/Makefile @@ -180,12 +180,12 @@ $(APPS): $(LITEOS_TARGET) sysroot prepare: $(HIDE)mkdir -p $(OUT)/musl ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y) - $(HIDE)cp -f $$($(CC) --target=$(LLVM_TARGET) --sysroot=$(SYSROOT_PATH) $(LITEOS_CFLAGS) -print-file-name=libc.so) $(OUT)/musl - $(HIDE)cp -f $$($(GPP) --target=$(LLVM_TARGET) --sysroot=$(SYSROOT_PATH) $(LITEOS_CXXFLAGS) -print-file-name=libc++.so) $(OUT)/musl + $(HIDE)cp -fp $$($(CC) --target=$(LLVM_TARGET) --sysroot=$(SYSROOT_PATH) $(LITEOS_CFLAGS) -print-file-name=libc.so) $(OUT)/musl + $(HIDE)cp -fp $$($(GPP) --target=$(LLVM_TARGET) --sysroot=$(SYSROOT_PATH) $(LITEOS_CXXFLAGS) -print-file-name=libc++.so) $(OUT)/musl else - $(HIDE)cp -f $(LITEOS_COMPILER_PATH)/target/usr/lib/libc.so $(OUT)/musl - $(HIDE)cp -f $(LITEOS_COMPILER_PATH)/arm-linux-musleabi/lib/libstdc++.so.6 $(OUT)/musl - $(HIDE)cp -f $(LITEOS_COMPILER_PATH)/arm-linux-musleabi/lib/libgcc_s.so.1 $(OUT)/musl + $(HIDE)cp -fp $(LITEOS_COMPILER_PATH)/target/usr/lib/libc.so $(OUT)/musl + $(HIDE)cp -fp $(LITEOS_COMPILER_PATH)/arm-linux-musleabi/lib/libstdc++.so.6 $(OUT)/musl + $(HIDE)cp -fp $(LITEOS_COMPILER_PATH)/arm-linux-musleabi/lib/libgcc_s.so.1 $(OUT)/musl $(STRIP) $(OUT)/musl/* endif diff --git a/tools/scripts/make_rootfs/rootfsdir.sh b/tools/scripts/make_rootfs/rootfsdir.sh index a7c571e4..269f097f 100755 --- a/tools/scripts/make_rootfs/rootfsdir.sh +++ b/tools/scripts/make_rootfs/rootfsdir.sh @@ -46,14 +46,14 @@ if [ -d "${BIN_DIR}" ] && [ "$(ls -A "${BIN_DIR}")" != "" ]; then for el in ${NEED_COPYTO_OUTDIR[@]} do if [ -e ${BIN_DIR}/$el ] && [ "${BIN_DIR}/$el" != "${OUT_DIR}/bin/$el" ]; then - cp -f ${BIN_DIR}/$el ${OUT_DIR}/bin/$el + cp -u ${BIN_DIR}/$el ${OUT_DIR}/bin/$el fi done fi cp -f ${LIB_DIR}/* ${ROOTFS_DIR}/lib -cp -f ${LIB_DIR}/* ${OUT_DIR}/libs +cp -u ${LIB_DIR}/* ${OUT_DIR}/libs if [ -e ${ETC_DIR} ]; then cp -f ${ETC_DIR}/.mkshrc ${ROOTFS_DIR}/etc -cp -f ${ETC_DIR}/.mkshrc ${OUT_DIR}/etc +cp -u ${ETC_DIR}/.mkshrc ${OUT_DIR}/etc fi