linuxでsedコマンドのエラーが発生する現象を回避
authorj8takagi <j8takagi@nifty.com>
Fri, 4 Mar 2011 23:56:00 +0000 (08:56 +0900)
committerj8takagi <j8takagi@nifty.com>
Fri, 4 Mar 2011 23:56:00 +0000 (08:56 +0900)
sedの-iコマンド指定方法が、BSD版とGNU版で異なることが原因。-iコマンドは使わないことで現象を回避

template/Test.mk

index 11d4065..8bc9828 100644 (file)
@@ -49,7 +49,7 @@ define exec_cmd
     if test ! -x $1; then $(CHMOD) u+x $1; fi
     ./$1 >>$2 2>$3
     if test -s $3; then $(CAT) $3 >>$2; fi
-    $(SED) -i '' -e "s%$(CURRDIR)%\$$PWD%g" $2
+    $(CAT) $2 | ($(RM) $2; $(SED) -e "s%$(CURRDIR)%\$$PWD%g" >$2)
     $(call rm_null,$3)
 endef