From beaf3a26a60d5b0429a577b7d58232957d4483e7 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 21 Sep 2013 20:03:52 +0200 Subject: Added Makefile.in change detection (and auto-rebuild) capabilities - If a Makefile.in is changed, ./config.status (or ./configure in case it's not available) will be automatically run to update the Makefiles. - Special thanks to Yommy for the idea. Signed-off-by: Haru --- src/char/Makefile.in | 5 ++++- src/common/Makefile.in | 15 +++++++++------ src/login/Makefile.in | 5 ++++- src/map/Makefile.in | 5 ++++- src/plugins/Makefile.in | 5 ++++- src/test/Makefile.in | 7 +++++-- src/tool/Makefile.in | 7 +++++-- 7 files changed, 35 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/char/Makefile.in b/src/char/Makefile.in index b2cee3f88..e22d3f5a5 100644 --- a/src/char/Makefile.in +++ b/src/char/Makefile.in @@ -57,6 +57,9 @@ needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 +Makefile: Makefile.in + @$(MAKE) -C ../.. src/char/Makefile + # object directories obj_sql: @@ -65,7 +68,7 @@ obj_sql: # executables -char-server: $(CHAR_SERVER_SQL_DEPENDS) +char-server: $(CHAR_SERVER_SQL_DEPENDS) Makefile @echo " LD $@" @$(CC) @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ diff --git a/src/common/Makefile.in b/src/common/Makefile.in index 00d63dd5e..78f9cd0d1 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -59,6 +59,9 @@ help: ##################################################################### +Makefile: Makefile.in + @$(MAKE) -C ../.. src/common/Makefile + needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 @@ -73,23 +76,23 @@ obj_sql: @echo " MKDIR obj_sql" @-mkdir obj_sql -obj_all/common.a: $(COMMON_OBJ) +obj_all/common.a: $(COMMON_OBJ) Makefile @echo " AR $@" @@AR@ rcs obj_all/common.a $(COMMON_OBJ) -obj_all/common_mini.a: $(COMMON_MINI_OBJ) +obj_all/common_mini.a: $(COMMON_MINI_OBJ) Makefile @echo " AR $@" @@AR@ rcs obj_all/common_mini.a $(COMMON_MINI_OBJ) -obj_sql/common_sql.a: $(COMMON_SQL_OBJ) +obj_sql/common_sql.a: $(COMMON_SQL_OBJ) Makefile @echo " AR $@" @@AR@ rcs obj_sql/common_sql.a $(COMMON_SQL_OBJ) -common: $(COMMON_OBJ) $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) obj_all/common.a +common: $(COMMON_OBJ) $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) obj_all/common.a Makefile -common_mini: $(COMMON_MINI_OBJ) $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) obj_all/common_mini.a +common_mini: $(COMMON_MINI_OBJ) $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) obj_all/common_mini.a Makefile -common_sql: $(COMMON_SQL_OBJ) obj_sql/common_sql.a +common_sql: $(COMMON_SQL_OBJ) obj_sql/common_sql.a Makefile obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_all @echo " CC $<" diff --git a/src/login/Makefile.in b/src/login/Makefile.in index 125f4fb7a..681eb5e6f 100644 --- a/src/login/Makefile.in +++ b/src/login/Makefile.in @@ -50,6 +50,9 @@ help: ##################################################################### +Makefile: Makefile.in + @$(MAKE) -C ../.. src/login/Makefile + needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 @@ -62,7 +65,7 @@ obj_sql: # executables -login-server: $(LOGIN_SERVER_SQL_DEPENDS) +login-server: $(LOGIN_SERVER_SQL_DEPENDS) Makefile @echo " LD $@" @$(CC) @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ diff --git a/src/map/Makefile.in b/src/map/Makefile.in index ed1b9a79d..f7e178667 100644 --- a/src/map/Makefile.in +++ b/src/map/Makefile.in @@ -66,6 +66,9 @@ help: ##################################################################### +Makefile: Makefile.in + @$(MAKE) -C ../.. src/map/Makefile + needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 @@ -78,7 +81,7 @@ obj_sql: # executables -map-server: $(MAP_SERVER_SQL_DEPENDS) +map-server: $(MAP_SERVER_SQL_DEPENDS) Makefile @echo " LD $@" @$(CC) @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index 5ed421abf..ff7d5b2e2 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -11,7 +11,7 @@ export CC ##################################################################### .PHONY: all $(PLUGINS) sample db2sql clean help -all: $(PLUGINS) +all: $(PLUGINS) Makefile sample: sample@DLLEXT@ @@ -28,6 +28,9 @@ help: ##################################################################### +Makefile: Makefile.in + @$(MAKE) -C ../.. src/plugins/Makefile + %@DLLEXT@: %.c $(COMMON_H) @echo " CC $<" @$(CC) @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o ../../plugins/$@ $< diff --git a/src/test/Makefile.in b/src/test/Makefile.in index f17c43202..cb99e7004 100644 --- a/src/test/Makefile.in +++ b/src/test/Makefile.in @@ -26,7 +26,7 @@ export CC ##################################################################### .PHONY: all test_spinlock -all: test_spinlock +all: test_spinlock Makefile clean: @echo " CLEAN test" @@ -34,6 +34,9 @@ clean: ##################################################################### +Makefile: Makefile.in + @$(MAKE) -C ../.. src/test/Makefile + # object directories obj: @@ -42,7 +45,7 @@ obj: #executables -test_spinlock: $(TEST_SPINLOCK_DEPENDS) +test_spinlock: $(TEST_SPINLOCK_DEPENDS) Makefile @echo " LD $@" @$(CC) @LDFLAGS@ -o ../../test_spinlock@EXEEXT@ $(TEST_SPINLOCK_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@ diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in index 4fa527ffc..4f9dc7590 100644 --- a/src/tool/Makefile.in +++ b/src/tool/Makefile.in @@ -24,9 +24,9 @@ export CC ##################################################################### .PHONY: all mapcache clean help -all: mapcache +all: mapcache Makefile -mapcache: $(MAPCACHE_OBJ) $(COMMON_OBJ) $(LIBCONFIG_OBJ) +mapcache: $(MAPCACHE_OBJ) $(COMMON_OBJ) $(LIBCONFIG_OBJ) Makefile @echo " LD $@" @$(CC) @LDFLAGS@ $(LIBCONFIG_INCLUDE) -o ../../mapcache@EXEEXT@ $(MAPCACHE_OBJ) $(COMMON_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @@ -43,6 +43,9 @@ help: ##################################################################### +Makefile: Makefile.in + @$(MAKE) -C ../.. src/tool/Makefile + obj_all: @echo " MKDIR obj_all" @-mkdir obj_all -- cgit v1.2.3-70-g09d2