diff options
author | Ben Pfaff <blp@nicira.com> | 2010-05-27 10:00:03 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-05-27 10:11:51 -0700 |
commit | 87103e1fccd88e0fc8a64d774ddb620deeb90678 (patch) | |
tree | 26cd10110ba73c81297ef6491006588dd0977a70 /Makefile.am | |
parent | 4cdb08c02a3d3067194c659a442d3679cdd8dd35 (diff) |
Add dist-hook to ensure that every file gets distributed.
It's easy to add a file to the repository and forget to make sure that it
is distributed. This commit adds a hook target to the main Makefile that
causes "make dist" to fail if the tree is being built from a Git repository
and some files are not distributed.
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 58b79a4a..37d98f60 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,6 +45,7 @@ EXTRA_DIST = \ bin_PROGRAMS = sbin_PROGRAMS = bin_SCRIPTS = +DIST_HOOKS = dist_man_MANS = dist_pkgdata_DATA = dist_pkgdata_SCRIPTS = @@ -86,6 +87,32 @@ SUFFIXES += .in fi mv $@.tmp $@ +# If we're checked out from a Git repository, make sure that every +# file that is in Git is distributed. +dist-hook-git: + if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \ + rc=0; \ + for d in `cd $(srcdir) && git ls-files`; do \ + if test ! -e $(distdir)/$$d; then \ + case $$d in # ( \ + .gitignore|*/.gitignore) ;; # ( \ + *) \ + if test $$rc = 0; then \ + echo "The distribution is missing the following files:"; \ + rc=1; \ + fi; \ + echo "$$d"; \ + ;; \ + esac; \ + fi \ + done; \ + exit $$rc; \ + fi +DIST_HOOKS += dist-hook-git + +dist-hook: $(DIST_HOOKS) +.PHONY: $(DIST_HOOKS) + include lib/automake.mk include ofproto/automake.mk include utilities/automake.mk @@ -97,3 +124,4 @@ include vswitchd/automake.mk include ovsdb/automake.mk include xenserver/automake.mk include extras/ezio/automake.mk + |