From d7b69831347bab507a9634382f20654bbe5d0d6b Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Sat, 17 Oct 2009 02:11:00 -0700 Subject: Makefile: get rid of some 'make clean' errors When doing "make clean" for contribs, don't give an error if a submodule isn't checked out, or if the module's makefile has a 'clean' target but not a 'distclean' target. --- crawl-ref/source/contrib/Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/contrib/Makefile') diff --git a/crawl-ref/source/contrib/Makefile b/crawl-ref/source/contrib/Makefile index 77e97e5778..42cbc4b81c 100644 --- a/crawl-ref/source/contrib/Makefile +++ b/crawl-ref/source/contrib/Makefile @@ -5,16 +5,16 @@ all: lua sqlite sdl sdl-image freetype libpng pcre zlib .PHONY: lua sqlite sdl sdl-image freetype libpng pcre zlib +# Only clean submodules we actually posses. Some makefiles don't have +# 'distclean' target, so try both 'clean' and 'distclean', and discard +# any errors. clean: rm -rf $(PREFIX) - -make -C freetype distclean - -make -C libpng distclean - -make -C lua clean - -make -C sdl distclean - -make -C sdl-image distclean - -make -C sqlite clean - -make -C pcre clean - -make -C zlib distclean + @for a in freetype libpng lua sdl sdl-image sqlite pcre zlib; do \ + if [ -f $$a/Makefile ] || [ -f $$a/makefile ] ; then \ + make -k -C $$a clean distclean 2> /dev/null; \ + fi \ + done # # Check for GNU Make >=3.80 -- cgit v1.2.3-54-g00ecf