]> rtime.felk.cvut.cz Git - fpga/virtex2/msp_motion.git/commitdiff
Makefile dependency checking corrected
authorVladimir Burian <buriavl2@fel.cvut.cz>
Sun, 24 Jul 2011 19:53:12 +0000 (21:53 +0200)
committerVladimir Burian <buriavl2@fel.cvut.cz>
Sun, 24 Jul 2011 19:53:12 +0000 (21:53 +0200)
Dependency checking is corrected and dependency files modified so that
no error is risen by GNU make when any source file has been deleted.

build/Makefile

index fa08461a8802bebadb368308621100d7ca095b20..c0bd56e728338a69ca92a68e51f1a943aab8f80b 100644 (file)
@@ -95,7 +95,7 @@ all: clean implement
 #===============================================================================
 
 synthesize: $(NGC)
-re-synthesize $(NGC): $(addrefix $(SRC)/,$(PRJ))
+re-synthesize $(NGC): $(addprefix $(SRC)/,$(PRJ))
        echo " \
          run \
          $(addprefix -ifn $(SRC)/,$(PRJ)) \
@@ -160,16 +160,21 @@ clean:
 #===============================================================================
 
 %.d: %.prj
-       @sed -e 's/#.*//' \
-            -e 's/[ \t][ \t]*/ /g' \
-            -e 's/^ //' -e 's/ $$//' \
-            -e '/"/d' \
-            -e '/^$$/d' \
-            -e 's|\(.*\) \(.*\) \(.*\)|$<: $(dir $<)\3|' \
-            <$< >$@
+       @$(MAKEDEPEND)
 
 %.prj:
        touch $@
 
-include $(addprefix $(SRC)/,$(PRJ:.prj=.d))
+-include $(addprefix $(SRC)/,$(PRJ:.prj=.d))
+
+#===============================================================================
+
+MAKEDEPEND = sed \
+  -e 's/\#.*//' \
+  -e 's/[ \t][ \t]*/ /g' \
+  -e 's/^ //' -e 's/ $$//' \
+  -e '/"/d' \
+  -e '/^$$/d' \
+  -e 's|\(.*\) \(.*\) \(.*\)|$<: $(dir $<)\3\n$(dir $<)\3:\n|' \
+  <$< >$@