From: Vladimir Burian Date: Sun, 24 Jul 2011 19:53:12 +0000 (+0200) Subject: Makefile dependency checking corrected X-Git-Url: https://rtime.felk.cvut.cz/gitweb/fpga/virtex2/msp_motion.git/commitdiff_plain/e6c6a0f0da4b4628d6fb550fcd9c4bd17fb5be6e Makefile dependency checking corrected Dependency checking is corrected and dependency files modified so that no error is risen by GNU make when any source file has been deleted. --- diff --git a/build/Makefile b/build/Makefile index fa08461..c0bd56e 100644 --- a/build/Makefile +++ b/build/Makefile @@ -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|' \ + <$< >$@