summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2011-08-20 18:55:25 -0700
committerJoshua Haberman <jhaberman@gmail.com>2011-08-20 18:55:25 -0700
commit6c6013e51e196c54df4f0f7db78e31dab59e2bc5 (patch)
treec74bdcd154fd6c87aba3bd339e472538309f973e
parentadb6580d9728c3533faf779812bd7f4c9b27170d (diff)
Fold gen-deps.sh into Makefile.
-rw-r--r--Makefile8
-rwxr-xr-xgen-deps.sh18
2 files changed, 6 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index f929caf..4be4155 100644
--- a/Makefile
+++ b/Makefile
@@ -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. ###############################################################
diff --git a/gen-deps.sh b/gen-deps.sh
deleted file mode 100755
index adb42ef..0000000
--- a/gen-deps.sh
+++ /dev/null
@@ -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
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback