mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-29 20:53:55 +02:00
b2/Makefile: add dependency generation (.d method)
This commit is contained in:
parent
e804e02abf
commit
9d5c6989e2
14
b2/Makefile
14
b2/Makefile
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user