瀏覽代碼

Fixed %.d:%.c rule to fail if the target file was not created or is empty

Ondrej Martinek 17 年之前
父節點
當前提交
bcf9e57952
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Makefile.rules

+ 3 - 3
Makefile.rules

@@ -27,9 +27,9 @@
 	$(CC) $(CFLAGS) $(INCLUDES) $(DEFS) -c $< -o $@
 
 %.d: %.c $(ALLDEP)
-	@set -e; $(MKDEP) $(CFLAGS) $(INCLUDES) $(DEFS) $< \
-	|  sed 's#\(\($(*D)/\)\{0,1\}$(*F)\)\.o[ :]*#$*.o $@ : #g' > $@; \
-	[ -s $@ ] || rm -f $@
+	$(MKDEP) $(CFLAGS) $(INCLUDES) $(DEFS) $< \
+	    |  sed 's#\(\($(*D)/\)\{0,1\}$(*F)\)\.o[ :]*#$*.o $@ : #g' > $@; \
+	    test -s $@ || { rm -f $@; false; }
 
 # use RPATH and SER_LIBS if needed (make install and the module depends
 # on some ser libs)