Date: | 2012-05-22 21:09:22 (11 years 10 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | c9bd26a34d5c8f649109332aa2eea823c783fdcb |
Message: | b2/Makefile: generate dependencies also for YACC- and LEX-generated
files We need explicit rules to compile lex.yy.c and y.tab.c for the relaxed CFLAGS. However, this means that the implicit rule was not used and therefore no dependencies were generated. |
Files: |
b2/Makefile (2 diffs) |
Change Details
b2/Makefile | ||
---|---|---|
46 | 46 | DEPEND = $(DEPEND_quiet) |
47 | 47 | endif |
48 | 48 | |
49 | MKDEP = $(DEPEND) $(1).c | \ | |
50 | sed -e \ | |
51 | '/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \ | |
52 | -e '$${g;p;}' -e d >$(1).d; \ | |
53 | [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $(1).d; exit 1; } | |
54 | ||
49 | 55 | .PHONY: all clean spotless try |
50 | 56 | |
51 | 57 | all: boom |
... | ... | |
58 | 64 | |
59 | 65 | lex.yy.o: lex.yy.c y.tab.h |
60 | 66 | $(CC) -c $(CFLAGS) $(SLOPPY) lex.yy.c |
67 | $(call MKDEP, lex.yy) | |
61 | 68 | |
62 | 69 | y.tab.c y.tab.h: lang.y |
63 | 70 | $(YACC) $(YYFLAGS) -d lang.y |
64 | 71 | |
65 | 72 | y.tab.o: y.tab.c |
66 | 73 | $(CC) -c $(CFLAGS) $(SLOPPY) y.tab.c |
74 | $(call MKDEP, y.tab) | |
67 | 75 | |
68 | 76 | %.o: %.c |
69 | 77 | $(CC) -c $(CFLAGS) $*.c -o $*.o |
70 | $(DEPEND) $*.c | \ | |
71 | sed -e \ | |
72 | '/^\(.*:\)\? */{p;s///;s/ *\\\?$$/ /;s/ */:\n/g;H;}' \ | |
73 | -e '$${g;p;}' -e d >$*.d; \ | |
74 | [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $*.d; exit 1; } | |
78 | $(call MKDEP, $*) | |
75 | 79 | |
76 | 80 | -include $(OBJS:.o=.d) |
77 | 81 |
Branches:
master