Fold gen-deps.sh into Makefile.

pull/13171/head
Joshua Haberman 13 years ago
parent adb6580d97
commit 6c6013e51e
  1. 8
      Makefile
  2. 18
      gen-deps.sh

@ -66,9 +66,13 @@ endif
# of the scheme we use that compiles the same source file multiple times with
# different -D options, which can include different header files.
ALLSRC=$(shell find . -name '*.c' -print | grep -v perf-tmp)
deps: gen-deps.sh Makefile $(ALLSRC)
$(Q) CPPFLAGS="$(CPPFLAGS)" ./gen-deps.sh $(ALLSRC)
deps: Makefile $(ALLSRC)
$(E) Regenerating dependencies for upb/...
@set -e
@rm -f deps
@for file in $(ALLSRC); do \
gcc -MM $$file -MT $${file%.*}.o $(CPPFLAGS) -I. >> deps; \
done
# Source files. ###############################################################

@ -1,18 +0,0 @@
#!/bin/sh
# This script wraps gcc -MM, which unhelpfully strips the directory
# off of the input filename. In other words, if you run:
#
# $ gcc -MM src/upb_parse.c
#
# ...the emitted dependency information looks like:
#
# upb_parse.o: src/upb_parse.h [...]
#
# Since upb_parse.o is actually in src, the dependency information is
# not used. To remedy this, we use the -MT flag (see gcc docs).
set -e
rm -f deps
for file in $@; do
gcc -MM $file -MT ${file%.*}.o $CPPFLAGS -I. >> deps
done
Loading…
Cancel
Save