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
4646    DEPEND = $(DEPEND_quiet)
4747endif
4848
49MKDEP = $(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
4955.PHONY: all clean spotless try
5056
5157all: boom
...... 
5864
5965lex.yy.o: lex.yy.c y.tab.h
6066        $(CC) -c $(CFLAGS) $(SLOPPY) lex.yy.c
67        $(call MKDEP, lex.yy)
6168
6269y.tab.c y.tab.h: lang.y
6370        $(YACC) $(YYFLAGS) -d lang.y
6471
6572y.tab.o: y.tab.c
6673        $(CC) -c $(CFLAGS) $(SLOPPY) y.tab.c
74        $(call MKDEP, y.tab)
6775
6876%.o: %.c
6977        $(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, $*)
7579
7680-include $(OBJS:.o=.d)
7781

Archive Download the corresponding diff file

Branches:
master



interactive