summaryrefslogtreecommitdiff
path: root/gen-deps.sh
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-08-04 17:51:17 -0700
committerJoshua Haberman <joshua@reverberate.org>2009-08-04 17:51:17 -0700
commit2aaea5390a841e2682a318746e90aebbe8a955b9 (patch)
tree7fb416aafcf8d84d2d3b73344b4b68f21f3d01f5 /gen-deps.sh
parentf03c8bd7dddb17f51e6baeacd68e4c0172411e82 (diff)
Makefile is much improved ("make deps" works again, etc).
Diffstat (limited to 'gen-deps.sh')
-rwxr-xr-xgen-deps.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/gen-deps.sh b/gen-deps.sh
new file mode 100755
index 0000000..6f7b4af
--- /dev/null
+++ b/gen-deps.sh
@@ -0,0 +1,17 @@
+#!/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).
+
+rm -f deps
+for file in $@; do
+ gcc -MM $file -MT ${file%.*}.o -Idescriptor -Isrc -I. >> deps
+done
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback