How NOT to generate an empty dependency file if fails? For example,
TOP = $(HOME)
%.d: %.c
$(CC) -M $< | sed "s/$(TOP)/$$(TOP)/" > $@
if $(CC) -M fails, it generates an empty .d file.
.DELETE_ON_ERROR:
does not seem to help.
I could try
%.d: %.c
if [ "`$(CC) -M $<`" ]; then \
$(CC) -M $< | sed "s/$(TOP)/$$(TOP)/" > $@; \
else \
echo "Error"; \
fi
but it excutes $(CC) -M twice and not efficient.
Thanks for help.
James
_______________________________________________
help-gnu-utils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gnu-utils