我偶然发现一个人在makefile目标中将mv
命令更改为-mv
。有什么区别?
%/install-stamp:
dh_testdir
dh_testroot
dh_prep -p$(subst _,-,$(a))-toolchain
cp -rl $(r) debian/$(subst _,-,$(a))-toolchain
-mv debian/$(subst _,-,$(a))-toolchain/usr/bin/libgcc_s_sjlj-1.dll debian/$(subst _,-,$(a))-toolchain/usr/$(subst \
_,-,$(a))/bin
-mv debian/$(subst _,-,$(a))-toolchain/usr/lib/libiberty.a debian/$(subst _,-,$(a))-toolchain/usr/$(subst _,-,$(a)\
)/lib
rm -f debian/$(subst _,-,$(a))-toolchain/usr/share/man/man1/dllwrap*
rm -f debian/$(subst _,-,$(a))-toolchain/usr/share/man/man7/fsf-funding*
rm -f debian/$(subst _,-,$(a))-toolchain/usr/share/man/man7/gfdl*
rm -f debian/$(subst _,-,$(a))-toolchain/usr/share/man/man7/gpl*
touch $(@)
答案 0 :(得分:8)
在Makefile中的任何命令之前添加“ - ”,如果命令返回非零状态,则告诉make不退出。基本上它是“我不在乎它是否失败”。