mirror of
https://github.com/dgibson/dtc.git
synced 2026-04-11 16:37:42 -04:00
Add automatic dependency generation.
This commit is contained in:
parent
5a446b0cd8
commit
1cb934b3aa
1 changed files with 8 additions and 5 deletions
13
Makefile
13
Makefile
|
|
@ -6,13 +6,13 @@ BISON = bison
|
|||
OBJS = dtc.o livetree.o flattree.o data.o treesource.o fstree.o \
|
||||
dtc-parser.tab.o lex.yy.o
|
||||
|
||||
all: $(TARGETS)
|
||||
DEPFILES = $(OBJS:.o=.d)
|
||||
|
||||
all: $(DEPFILES) $(TARGETS)
|
||||
|
||||
dtc: $(OBJS)
|
||||
$(LINK.c) -o $@ $^
|
||||
|
||||
$(OBJS): dtc.h
|
||||
|
||||
dtc-parser.tab.c dtc-parser.tab.h dtc-parser.output: dtc-parser.y
|
||||
$(BISON) -d -v $<
|
||||
|
||||
|
|
@ -21,8 +21,6 @@ lex.yy.c: dtc-lexer.l
|
|||
|
||||
lex.yy.o: lex.yy.c dtc-parser.tab.h
|
||||
|
||||
livetree.o: flat_dt.h
|
||||
|
||||
check: all
|
||||
cd tests && $(MAKE) check
|
||||
|
||||
|
|
@ -30,5 +28,10 @@ clean:
|
|||
rm -f *~ *.o a.out core $(TARGETS)
|
||||
rm -f *.tab.[ch] lex.yy.c
|
||||
rm -f *.i *.output vgcore.*
|
||||
rm -f *.d
|
||||
cd tests && $(MAKE) clean
|
||||
|
||||
%.d: %.c
|
||||
$(CC) -MM -MG -MT "$*.o $@" $< > $@
|
||||
|
||||
-include $(DEPFILES)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue