From: Ben Pfaff Date: Thu, 6 Dec 2012 20:48:48 +0000 (-0800) Subject: Makefile.am: Add a build check that every .c file #includes . X-Git-Tag: sliver-openvswitch-1.9.90-3~10^2~109 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=9e4ba0085713535c8c75d2af00f77d3491f58de9;p=sliver-openvswitch.git Makefile.am: Add a build check that every .c file #includes . This can find mysterious build problems. Signed-off-by: Ben Pfaff Acked-by: Ed Maste --- 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 . +ALL_LOCAL += config-h-check +config-h-check: + @cd $(srcdir); \ + if test -e .git && (git --version) >/dev/null 2>&1 && \ + git grep -L '#include ' `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 ."; \ + exit 1; \ + fi +.PHONY: config-h-check + # Check that "struct vlog_ratelimit" is always declared "static". ALL_LOCAL += rate-limit-check rate-limit-check: