summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-12-06 12:48:48 -0800
committerBen Pfaff <blp@nicira.com>2012-12-06 12:48:48 -0800
commit9e4ba0085713535c8c75d2af00f77d3491f58de9 (patch)
tree0cb06b6bd53add67a502fe594a19d28593ec42fc /Makefile.am
parentca6f49f16c7ab9a592a3dd0d482d156cdee45f58 (diff)
downloadopenvswitch-9e4ba0085713535c8c75d2af00f77d3491f58de9.tar.gz
Makefile.am: Add a build check that every .c file #includes <config.h>.
This can find mysterious build problems. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Ed Maste <emaste@freebsd.org>
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index e2e0aa40d..08cf395c0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -169,6 +169,20 @@ CLEANFILES += distfiles
endif
.PHONY: dist-hook-git
+# Check that every .c file includes <config.h>.
+ALL_LOCAL += config-h-check
+config-h-check:
+ @cd $(srcdir); \
+ if test -e .git && (git --version) >/dev/null 2>&1 && \
+ git grep -L '#include <config\.h>' `git ls-files | grep '\.c$$' | \
+ grep -vE '^datapath|^lib/sflow'`; \
+ then \
+ echo "See above for list of violations of the rule that"; \
+ echo "every C source file must #include <config.h>."; \
+ exit 1; \
+ fi
+.PHONY: config-h-check
+
# Check that "struct vlog_ratelimit" is always declared "static".
ALL_LOCAL += rate-limit-check
rate-limit-check: