1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-16 19:15:20 +02:00

b2/Makefile: add dependency generation (.d method)

This commit is contained in:
Werner Almesberger 2012-04-19 20:06:02 -03:00
parent e804e02abf
commit 9d5c6989e2

View File

@ -9,6 +9,8 @@
# (at your option) any later version.
#
SHELL = /bin/bash
CFLAGS = -Wall $(shell pkg-config --cflags glib-2.0)
SLOPPY = -Wno-unused -Wno-implicit-function-declaration
OBJS = boom.o chr.o comp.o db.o eval.o param.o util.o lex.yy.o y.tab.o
@ -61,6 +63,16 @@ y.tab.c y.tab.h: lang.y
y.tab.o: y.tab.c
$(CC) -c $(CFLAGS) $(SLOPPY) y.tab.c
%.o: %.c
$(CC) -c $(CFLAGS) $*.c -o $*.o
$(DEPEND) $*.c | \
sed -e \
'/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \
-e '$${g;p;}' -e d >$*.d; \
[ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; }
-include $(OBJS:.o=.d)
clean:
rm -f $(OBJS)
rm -f $(OBJS) $(OBJS:.o=.d)
rm -f lex.yy.c y.tab.c y.tab.h