From f44e72db13c0e9b60d2050093e1d843f77ecee3f Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Wed, 14 Oct 2009 02:09:19 -0700 Subject: makefiles: 'clean'/'distclean' now do RM on all intermediates at once Signed-off-by: Steven Noonan --- crawl-ref/source/makefile | 22 +++++++--------------- crawl-ref/source/util/Makefile | 7 +++---- crawl-ref/source/util/lua/src/Makefile | 4 ++-- crawl-ref/source/util/sqlite/Makefile | 7 +++---- 4 files changed, 15 insertions(+), 25 deletions(-) diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile index 81c1b9accb..a6246b1b0a 100644 --- a/crawl-ref/source/makefile +++ b/crawl-ref/source/makefile @@ -39,10 +39,11 @@ CFWARN := -Wall AR = ar rcu CC = $(GCC) CXX = $(GXX) -DELETE = rm -f +RM = rm -f COPY = cp export AR +export RM export CC export CXX export CFLAGS @@ -644,8 +645,7 @@ endif clean: +$(MAKE) -C $(UTIL) clean - $(DELETE) *.o - $(DELETE) *.ixx + $(RM) *.o *.ixx clean-lua: +$(MAKE) -C $(LUASRC) clean @@ -654,15 +654,7 @@ clean-sql: +$(MAKE) -C $(SQLSRC) clean distclean: clean clean-lua clean-sql clean-rltiles - $(DELETE) bones.* - $(DELETE) morgue.txt - $(DELETE) scores - $(DELETE) $(GAME) - $(DELETE) *.sav - $(DELETE) core - $(DELETE) *.0* - $(DELETE) *.lab - $(DELETE) $(DEPENDENCY_MKF) + $(RM) bones.* morgue.txt scores $(GAME) *.sav core *.0* *.lab $(DEPENDENCY_MKF) $(GAME): $(GAME_DEPENDS) $(QUIET_LINK)$(CXX) $(LDFLAGS) $(EXTRA_OBJECTS) $(OBJECTS) -o $(GAME) $(LIB) @@ -746,11 +738,11 @@ package-source: distclean prebuildyacc pkgtidy depend removeold vlink \ pkgtarbz2 pkgzip pkgtidy: - $(DELETE) $(PKG_TIDY_LIST) + $(RM) $(PKG_TIDY_LIST) removeold: - if [ -f ../../$(SRC_PKG_TAR) ]; then $(DELETE) ../../$(SRC_PKG_TAR); fi - if [ -f ../../$(SRC_PKG_ZIP) ]; then $(DELETE) ../../$(SRC_PKG_ZIP); fi + if [ -f ../../$(SRC_PKG_TAR) ]; then $(RM) ../../$(SRC_PKG_TAR); fi + if [ -f ../../$(SRC_PKG_ZIP) ]; then $(RM) ../../$(SRC_PKG_ZIP); fi # [ds] Existing directory names could produce a bad package! vlink: diff --git a/crawl-ref/source/util/Makefile b/crawl-ref/source/util/Makefile index 2e61683b21..d138a640ce 100644 --- a/crawl-ref/source/util/Makefile +++ b/crawl-ref/source/util/Makefile @@ -1,5 +1,6 @@ YACC := bison -y -LEX := flex +LEX := flex +RM ?= rm -f ifneq ($(findstring $(MAKEFLAGS),s),s) ifndef V @@ -12,9 +13,7 @@ endif all: levcomp.tab.cc levcomp.lex.cc clean: - rm -f levcomp.tab.cc levcomp.tab.h - rm -f levcomp.lex.cc - rm -f *.o + $(RM) levcomp.tab.cc levcomp.tab.h levcomp.lex.cc *.o %.tab.cc: %.tab.c @mv $< $@ diff --git a/crawl-ref/source/util/lua/src/Makefile b/crawl-ref/source/util/lua/src/Makefile index c67263f4f9..7e9cd10f2f 100644 --- a/crawl-ref/source/util/lua/src/Makefile +++ b/crawl-ref/source/util/lua/src/Makefile @@ -20,9 +20,9 @@ endif CC ?= gcc CFLAGS ?= -O2 -Wall -AR = ar rcu +AR ?= ar rcu RANLIB = ranlib -RM = rm -f +RM ?= rm -f LIBS = -lm $(MYLIBS) MYCFLAGS= diff --git a/crawl-ref/source/util/sqlite/Makefile b/crawl-ref/source/util/sqlite/Makefile index b4f71dcfc9..6eb8c70a3a 100644 --- a/crawl-ref/source/util/sqlite/Makefile +++ b/crawl-ref/source/util/sqlite/Makefile @@ -9,10 +9,10 @@ endif endif LIBSQL = libsqlite3.a -AR = ar rcu +AR ?= ar rcu CC ?= gcc RANLIB = ranlib -RM_F = rm -f +RM ?= rm -f # Omit SQLite features we don't need. CFLAGS ?= -O2 @@ -38,8 +38,7 @@ CFLAGS +=-DSQLITE_OMIT_AUTHORIZATION \ all: $(LIBSQL) clean: - $(RM_F) *.o - $(RM_F) *.a + $(RM) *.o *.a $(LIBSQL): sqlite3.o $(QUIET_AR)$(AR) $@ $^ -- cgit v1.2.3-54-g00ecf