diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-01-13 00:28:03 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2010-01-13 00:36:34 +0000 |
commit | 39348d22cfd3d74db30b27ed532b0d0868071ca3 (patch) | |
tree | d0951af9bb9ff604d97c9e1769f594a328dcfebe | |
parent | 14cec891e98eb39780f67e89a1b821a839c7e370 (diff) |
Add cruft.mak file that can be included from modules to check for cruft
When plugins get renamed, moved or removed we often leave behind unwanted
left-overs in our source tree, since no one runs 'make clean' before every
git update. This can cause problems and be confusing, so add a little
Makefile rule to include to print a warning for if any of the files or
directories specified in CRUFT_FILES and/or CRUFT_DIRS are still present
in our uninstalled tree.
-rw-r--r-- | cruft.mak | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/cruft.mak b/cruft.mak new file mode 100644 index 0000000..ca59440 --- /dev/null +++ b/cruft.mak @@ -0,0 +1,39 @@ +# checks for left-over files in the (usually uninstalled) tree, ie. for +# stuff that best be deleted to avoid problems like having old plugin binaries +# lying around. +# +# set CRUFT_FILES and/or CRUFT_DIRS in your Makefile.am when you include this + +check-cruft: + cruft_files=""; cruft_dirs=""; \ + for f in $(CRUFT_FILES); do \ + if test -e $$f; then \ + cruft_files="$$cruft_files $$f"; \ + fi \ + done; \ + for d in $(CRUFT_DIRS); do \ + if test -e $$d; then \ + cruft_dirs="$$cruft_dirs $$d"; \ + fi \ + done; \ + if test "x$$cruft_files$$cruft_dirs" != x; then \ + echo; \ + echo "**** CRUFT ALERT *****"; \ + echo; \ + echo "The following files and directories may not be needed any "; \ + echo "longer (usually because a plugin has been merged into "; \ + echo "another plugin, moved to a different module, or been "; \ + echo "renamed), and you probably want to clean them up if you "; \ + echo "don't have local changes: "; \ + echo; \ + for f in $$cruft_files; do echo "file $$f"; done; \ + echo; \ + for d in $$cruft_dirs; do echo "directory $$d"; done; \ + echo; \ + fi + + +# also might want to add this to your Makefile.am: +# +# all-local: check-cruft + |