summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/contrib/Makefile
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-10-17 02:11:00 -0700
committerMatthew Cline <zelgadis@sourceforge.net>2009-10-17 02:11:00 -0700
commitd7b69831347bab507a9634382f20654bbe5d0d6b (patch)
tree287a643b33b052941224fff85c45f95c9773e45b /crawl-ref/source/contrib/Makefile
parent4860bed3833463977ede631f24cb3cb553ee0fa6 (diff)
downloadcrawl-ref-d7b69831347bab507a9634382f20654bbe5d0d6b.tar.gz
crawl-ref-d7b69831347bab507a9634382f20654bbe5d0d6b.zip
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.
Diffstat (limited to 'crawl-ref/source/contrib/Makefile')
-rw-r--r--crawl-ref/source/contrib/Makefile16
1 files changed, 8 insertions, 8 deletions
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