Skip to content

Commit

Permalink
Added 'buildclean' target to all makefiles
Browse files Browse the repository at this point in the history
- By invoking 'make buildclean', you can clean up all the build
  intermediate (object) files, without deleting any of the built
  executables and plugins.
- To delete everything, use 'make clean', as you've always done.

Signed-off-by: Haru <haru@dotalux.com>
  • Loading branch information
MishimaHaruna committed Oct 5, 2013
1 parent 62c5e65 commit d6965a8
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 45 deletions.
17 changes: 10 additions & 7 deletions 3rdparty/libconfig/Makefile.in
Expand Up @@ -8,19 +8,22 @@ CC = @CC@
export CC

#####################################################################
.PHONY: all clean help
.PHONY: all clean buildclean help

all: $(LIBCONFIG_OBJ)

clean:
@echo " CLEAN libconfig"
buildclean:
@echo " CLEAN libconfig (build temp files)"
@rm -rf *.o

clean: buildclean
@echo " CLEAN libconfig"

help:
@echo "possible targets are 'all' 'clean' 'help'"
@echo "'all' - builds $(LIBCONFIG_OBJ)"
@echo "'clean' - deletes $(LIBCONFIG_OBJ)"
@echo "'help' - outputs this message"
@echo "possible targets are 'all' 'clean' 'buildclean' 'help'"
@echo "'all' - builds $(LIBCONFIG_OBJ)"
@echo "'clean', 'buildclean' - deletes $(LIBCONFIG_OBJ)"
@echo "'help' - outputs this message"

#####################################################################

Expand Down
17 changes: 10 additions & 7 deletions 3rdparty/mt19937ar/Makefile.in
Expand Up @@ -8,19 +8,22 @@ CC = @CC@
export CC

#####################################################################
.PHONY: all clean help
.PHONY: all clean buildclean help

all: $(MT19937AR_OBJ)

clean:
@echo " CLEAN mt19937ar"
buildclean:
@echo " CLEAN mt19937ar (build temp files)"
@rm -rf *.o

clean: buildclean
@echo " CLEAN mt19937ar"

help:
@echo "possible targets are 'all' 'clean' 'help'"
@echo "'all' - builds $(MT19937AR_OBJ)"
@echo "'clean' - deletes $(MT19937AR_OBJ)"
@echo "'help' - outputs this message"
@echo "possible targets are 'all' 'clean' 'buildclean' 'help'"
@echo "'all' - builds $(MT19937AR_OBJ)"
@echo "'clean', 'buildclean' - deletes $(MT19937AR_OBJ)"
@echo "'help' - outputs this message"

#####################################################################

Expand Down
8 changes: 6 additions & 2 deletions Makefile.in
Expand Up @@ -46,6 +46,8 @@ export CC
import \
test \
clean \
buildclean \
distclean \
help

all: $(ALL_DEPENDS)
Expand Down Expand Up @@ -111,7 +113,7 @@ import: Makefile
@if test ! -d conf/import ; then mkdir conf/import ; fi
@for f in $$(ls conf/import-tmpl) ; do if test ! -e conf/import/$$f ; then cp conf/import-tmpl/$$f conf/import ; fi ; done

clean: $(MF_TARGETS)
clean buildclean: $(MF_TARGETS)
@$(MAKE) -C src/common $@
@$(MAKE) -C 3rdparty/mt19937ar $@
@$(MAKE) -C 3rdparty/libconfig $@
Expand Down Expand Up @@ -140,7 +142,9 @@ help: Makefile
@echo "'sql' - builds sql servers (targets 'common_sql' 'login_sql' 'char_sql'"
@echo " 'map_sql' and 'import')"
@echo "'test' - builds tests"
@echo "'clean' - cleans builds and objects"
@echo "'clean' - cleans executables and objects"
@echo "'buildclean' - cleans build temporary (object) files, without deleting the"
@echo " executables"
@echo "'distclean' - cleans files generated by ./configure"
@echo "'help' - outputs this message"

Expand Down
12 changes: 9 additions & 3 deletions src/char/Makefile.in
Expand Up @@ -34,21 +34,27 @@ CC = @CC@
export CC

#####################################################################
.PHONY: all sql char-server clean help
.PHONY: all sql char-server clean buildclean help

all: sql

sql: char-server

clean:
buildclean:
@echo " CLEAN char (build temp files)"
@rm -rf *.o obj_sql

clean: buildclean
@echo " CLEAN char"
@rm -rf *.o obj_sql ../../char-server@EXEEXT@
@rm -rf ../../char-server@EXEEXT@

help:
@echo "possible targets are 'char-server' 'all' 'clean' 'help'"
@echo "'char-server' - char server"
@echo "'all' - builds all above targets"
@echo "'clean' - cleans builds and objects"
@echo "'buildclean' - cleans build temporary (object) files, without deleting the"
@echo " executables"
@echo "'help' - outputs this message"

#####################################################################
Expand Down
17 changes: 10 additions & 7 deletions src/common/Makefile.in
Expand Up @@ -40,22 +40,25 @@ CC = @CC@
export CC

#####################################################################
.PHONY: all sql common common_sql common_mini clean help
.PHONY: all sql common common_sql common_mini clean buildclean help

all: sql

sql: $(SQL_DEPENDS)

clean:
@echo " CLEAN common"
buildclean:
@echo " CLEAN common (build temp files)"
@rm -rf *.o obj_all obj_sql

clean: buildclean
@echo " CLEAN common"

help:
@echo "possible targets are 'sql' 'all' 'clean' 'help'"
@echo "'sql' - builds object files used in sql servers"
@echo "'all' - builds all above targets"
@echo "'clean' - cleans builds and objects"
@echo "'help' - outputs this message"
@echo "'sql' - builds object files used in sql servers"
@echo "'all' - builds all above targets"
@echo "'clean', 'buildclean' - cleans builds and objects"
@echo "'help' - outputs this message"

#####################################################################

Expand Down
12 changes: 9 additions & 3 deletions src/login/Makefile.in
Expand Up @@ -31,21 +31,27 @@ CC = @CC@
export CC

#####################################################################
.PHONY: all sql login-server clean help
.PHONY: all sql login-server clean buildclean help

all: sql

sql: login-server

clean:
buildclean:
@echo " CLEAN login (build temp files)"
@rm -rf *.o obj_sql

clean: buildclean
@echo " CLEAN login"
@rm -rf *.o obj_sql ../../login-server@EXEEXT@
@rm -rf ../../login-server@EXEEXT@

help:
@echo "possible targets are 'login-server' 'all' 'clean' 'help'"
@echo "'login-server' - login server"
@echo "'all' - builds all above targets"
@echo "'clean' - cleans builds and objects"
@echo "'buildclean' - cleans build temporary (object) files, without deleting the"
@echo " executables"
@echo "'help' - outputs this message"

#####################################################################
Expand Down
12 changes: 9 additions & 3 deletions src/map/Makefile.in
Expand Up @@ -47,21 +47,27 @@ CC = @CC@
export CC

#####################################################################
.PHONY: all sql map-server clean help
.PHONY: all sql map-server clean buildclean help

all: sql

sql: map-server

clean:
buildclean:
@echo " CLEAN map (build temp files)"
@rm -rf *.o obj_sql

clean: buildclean
@echo " CLEAN map"
@rm -rf *.o obj_sql ../../map-server@EXEEXT@
@rm -rf ../../map-server@EXEEXT@

help:
@echo "possible targets are 'map-server' 'all' 'clean' 'help'"
@echo "'map-server' - map server"
@echo "'all' - builds all above targets"
@echo "'clean' - cleans builds and objects"
@echo "'buildclean' - cleans build temporary (object) files, without deleting the"
@echo " executables"
@echo "'help' - outputs this message"

#####################################################################
Expand Down
12 changes: 9 additions & 3 deletions src/plugins/Makefile.in
Expand Up @@ -44,8 +44,14 @@ clean: buildclean

help:
@echo "possible targets are $(PLUGINS:%='%') 'all' 'clean' 'help'"
@echo "'sample' - sample plugin"
@echo "'help' - outputs this message"
@echo ""
@echo "$(PLUGINS:%='%')"
@echo " - builds a specific plugin"
@echo "'all' - builds all above targets"
@echo "'clean' - cleans builds and objects"
@echo "'buildclean' - cleans build temporary (object) files, without deleting the"
@echo " compiled plugins"
@echo "'help' - outputs this message"

#####################################################################

Expand All @@ -56,4 +62,4 @@ Makefile: Makefile.in

../../plugins/%@DLLEXT@: %.c $(ALL_H) $$(shell ls %/* 2>/dev/null)
@echo " CC $<"
@$(CC) @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<
@$(CC) @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<
10 changes: 7 additions & 3 deletions src/test/Makefile.in
Expand Up @@ -24,13 +24,17 @@ CC = @CC@
export CC

#####################################################################
.PHONY: all test_spinlock
.PHONY: all test_spinlock clean buildclean

all: test_spinlock Makefile

clean:
buildclean:
@echo " CLEAN test (build temp files)"
@rm -rf *.o obj

clean: buildclean
@echo " CLEAN test"
@rm -rf *.o obj ../../test_spinlock@EXEEXT@
@rm -rf ../../test_spinlock@EXEEXT@

#####################################################################

Expand Down
20 changes: 13 additions & 7 deletions src/tool/Makefile.in
Expand Up @@ -22,7 +22,7 @@ CC = @CC@
export CC

#####################################################################
.PHONY: all mapcache clean help
.PHONY: all mapcache clean buildclean help

all: mapcache Makefile

Expand All @@ -32,16 +32,22 @@ mapcache: ../../mapcache@EXEEXT@
@echo " LD $(notdir $@)"
@$(CC) @LDFLAGS@ $(LIBCONFIG_INCLUDE) -o ../../mapcache@EXEEXT@ $(MAPCACHE_OBJ) $(COMMON_OBJ) $(LIBCONFIG_OBJ) @LIBS@

clean:
buildclean:
@echo " CLEAN tool (build temp files)"
@rm -rf obj_all/*.o

clean: buildclean
@echo " CLEAN tool"
@rm -rf obj_all/*.o ../../mapcache@EXEEXT@
@rm -rf ../../mapcache@EXEEXT@

help:
@echo "possible targets are 'mapcache' 'all' 'clean' 'help'"
@echo "'mapcache' - mapcache generator"
@echo "'all' - builds all above targets"
@echo "'clean' - cleans builds and objects"
@echo "'help' - outputs this message"
@echo "'mapcache' - mapcache generator"
@echo "'all' - builds all above targets"
@echo "'clean' - cleans builds and objects"
@echo "'buildclean' - cleans build temporary (object) files, without deleting the"
@echo " executables"
@echo "'help' - outputs this message"

#####################################################################

Expand Down

0 comments on commit d6965a8

Please sign in to comment.