summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in6
-rw-r--r--src/char/Makefile.in61
-rw-r--r--src/common/Makefile.in37
-rw-r--r--src/login/Makefile.in38
-rw-r--r--src/map/Makefile.in71
-rw-r--r--src/plugins/Makefile.in14
-rw-r--r--src/test/Makefile.in34
-rw-r--r--src/tool/Makefile.in21
-rw-r--r--tools/HPMHookGen/Makefile.in16
9 files changed, 167 insertions, 131 deletions
diff --git a/Makefile.in b/Makefile.in
index 0047a4c76..d61a885b4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -110,6 +110,10 @@ plugins: $(PLUGIN_DEPENDS) src/plugins/Makefile
@echo " MAKE $@"
@$(MAKE) -C src/plugins
+plugin.%: $(PLUGIN_DEPENDS) src/plugins/Makefile
+ @echo " MAKE $@"
+ @$(MAKE) -C src/plugins $(patsubst plugin.%,%,$@)
+
hooks: tools/HPMHookGen/Makefile
@echo " MAKE $@"
@$(MAKE) -C tools/HPMHookGen
@@ -150,6 +154,8 @@ help: Makefile
@echo "'all' - builds all the above targets"
@echo "'sql' - builds sql servers (targets 'common_sql' 'login_sql' 'char_sql'"
@echo " 'map_sql' and 'import')"
+ @echo "'plugins' - builds all available plugins"
+ @echo "'plugin.Name' - builds plugin named 'Name'"
@echo "'test' - builds tests"
@echo "'clean' - cleans executables and objects"
@echo "'buildclean' - cleans build temporary (object) files, without deleting the"
diff --git a/src/char/Makefile.in b/src/char/Makefile.in
index 4bb7f3fb8..ab1e7c234 100644
--- a/src/char/Makefile.in
+++ b/src/char/Makefile.in
@@ -1,29 +1,33 @@
-COMMON_H = $(shell ls ../common/*.h)
-CONFIG_H = $(shell ls ../config/*.h ../config/*/*.h)
+CONFIG_D = ../config
+CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
-MT19937AR_D = ../../3rdparty/mt19937ar
-MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
-MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
+COMMON_D = ../common
+COMMON_H = $(wildcard $(COMMON_D)/*.h)
LIBCONFIG_D = ../../3rdparty/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
- scanner.o strbuf.o)
+ scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
- scanctx.h scanner.h strbuf.h wincompat.h)
+ scanctx.h scanner.h strbuf.h wincompat.h)
LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-CHAR_OBJ = $(addprefix obj_sql/, char.o inter.o int_auction.o int_elemental.o \
- int_guild.o int_homun.o int_mail.o int_mercenary.o int_party.o \
- int_pet.o int_quest.o int_storage.o pincode.o)
+MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
+MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
+MT19937AR_INCLUDE = -I$(MT19937AR_D)
+
+CHAR_C = char.c inter.c int_auction.c int_elemental.c int_guild.c int_homun.c \
+ int_mail.c int_mercenary.c int_party.c int_pet.c int_quest.c \
+ int_storage.c pincode.c
+CHAR_OBJ = $(addprefix obj_sql/, $(patsubst %.c,%.o,$(CHAR_C)))
CHAR_H = char.h inter.h int_auction.h int_elemental.h int_guild.h int_homun.h \
- int_mail.h int_mercenary.h int_party.h int_pet.h int_quest.h \
- int_storage.h pincode.h
+ int_mail.h int_mercenary.h int_party.h int_pet.h int_quest.h \
+ int_storage.h pincode.h
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- CHAR_SERVER_SQL_DEPENDS=$(CHAR_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ)
+ CHAR_SERVER_SQL_DEPENDS=$(CHAR_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ)
else
CHAR_SERVER_SQL_DEPENDS=needs_mysql
endif
@@ -50,22 +54,22 @@ clean: buildclean
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"
+ @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"
#####################################################################
+Makefile: Makefile.in
+ @$(MAKE) -C ../.. src/char/Makefile
+
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:
@@ -78,7 +82,8 @@ char-server: ../../char-server@EXEEXT@
../../char-server@EXEEXT@: $(CHAR_SERVER_SQL_DEPENDS) Makefile
@echo " LD $(notdir $@)"
- @$(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@
+ @$(CC) @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
+ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# char object files
@@ -87,13 +92,13 @@ obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H)
@$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
-../common/obj_all/common.a:
+$(COMMON_D)/obj_all/common.a:
@echo " MAKE $@"
- @$(MAKE) -C ../common sql
+ @$(MAKE) -C $(COMMON_D) sql
-../common/obj_sql/common_sql.a:
+$(COMMON_D)/obj_sql/common_sql.a:
@echo " MAKE $@"
- @$(MAKE) -C ../common sql
+ @$(MAKE) -C $(COMMON_D) sql
$(MT19937AR_OBJ):
@echo " MAKE $@"
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index 53b7a472e..1e23ab5e8 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -1,31 +1,38 @@
-MT19937AR_D = ../../3rdparty/mt19937ar
-MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
-MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
+CONFIG_D = ../config
+CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
LIBCONFIG_D = ../../3rdparty/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
- scanner.o strbuf.o)
+ scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
- scanctx.h scanner.h strbuf.h wincompat.h)
+ scanctx.h scanner.h strbuf.h wincompat.h)
LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-COMMON_SHARED_OBJ = conf.o db.o des.o ers.o grfio.o HPM.o mapindex.o \
- md5calc.o mempool.o mutex.o nullpo.o raconf.o random.o \
- showmsg.o strlib.o thread.o timer.o utils.o
+MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
+MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
+MT19937AR_INCLUDE = -I$(MT19937AR_D)
+
+COMMON_SHARED_C = conf.c db.c des.c ers.c grfio.c HPM.c mapindex.c md5calc.c \
+ mempool.c mutex.c nullpo.c raconf.c random.c showmsg.c strlib.c \
+ thread.c timer.c utils.c
+COMMON_C = $(COMMON_SHARED_C)
+COMMON_SHARED_OBJ = $(patsubst %.c,%.o,$(COMMON_SHARED_C))
COMMON_OBJ = $(addprefix obj_all/, $(COMMON_SHARED_OBJ) \
- console.o core.o malloc.o socket.o)
+ console.o core.o malloc.o socket.o)
COMMON_MINI_OBJ = $(addprefix obj_all/, $(COMMON_SHARED_OBJ) \
- miniconsole.o minicore.o minimalloc.o minisocket.o)
+ miniconsole.o minicore.o minimalloc.o minisocket.o)
+COMMON_C += console.c core.c malloc.c socket.c
COMMON_H = atomic.h cbasetypes.h conf.h console.h core.h db.h des.h ers.h \
- evdp.h grfio.h HPM.h HPMi.h malloc.h mapindex.h md5calc.h \
- mempool.h mmo.h mutex.h netbuffer.h network.h nullpo.h raconf.h \
- random.h showmsg.h socket.h spinlock.h sql.h strlib.h thread.h \
- timer.h utils.h winapi.h
+ evdp.h grfio.h HPM.h HPMi.h malloc.h mapindex.h md5calc.h \
+ mempool.h mmo.h mutex.h netbuffer.h network.h nullpo.h raconf.h \
+ random.h showmsg.h socket.h spinlock.h sql.h strlib.h \
+ thread.h timer.h utils.h winapi.h
COMMON_SQL_OBJ = obj_sql/sql.o
COMMON_SQL_H = sql.h
+COMMON_C += sql.c
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
diff --git a/src/login/Makefile.in b/src/login/Makefile.in
index a97d17f68..fa5f92105 100644
--- a/src/login/Makefile.in
+++ b/src/login/Makefile.in
@@ -1,26 +1,29 @@
-COMMON_H = $(shell ls ../common/*.h)
-CONFIG_H = $(shell ls ../config/*.h ../config/*/*.h)
+CONFIG_D = ../config
+CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
-MT19937AR_D = ../../3rdparty/mt19937ar
-MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
-MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
+COMMON_D = ../common
+COMMON_H = $(wildcard $(COMMON_D)/*.h)
LIBCONFIG_D = ../../3rdparty/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
- scanner.o strbuf.o)
+ scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
- scanctx.h scanner.h strbuf.h wincompat.h)
+ scanctx.h scanner.h strbuf.h wincompat.h)
LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-LOGIN_OBJ = $(addprefix obj_sql/, account_sql.o ipban_sql.o login.o \
- loginlog_sql.o)
+MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
+MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
+MT19937AR_INCLUDE = -I$(MT19937AR_D)
+
+LOGIN_C = account_sql.c ipban_sql.c login.c loginlog_sql.c
+LOGIN_OBJ = $(addprefix obj_sql/, $(patsubst %.c,%.o,$(LOGIN_C)))
LOGIN_H = login.h account.h ipban.h loginlog.h
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- LOGIN_SERVER_SQL_DEPENDS=$(LOGIN_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ)
+ LOGIN_SERVER_SQL_DEPENDS=$(LOGIN_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ)
else
LOGIN_SERVER_SQL_DEPENDS=needs_mysql
endif
@@ -75,22 +78,23 @@ login-server: ../../login-server@EXEEXT@
../../login-server@EXEEXT@: $(LOGIN_SERVER_SQL_DEPENDS) Makefile
@echo " LD $(notdir $@)"
- @$(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@
+ @$(CC) @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
+ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# login object files
obj_sql/%.o: %.c $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
-../common/obj_all/common.a:
+$(COMMON_D)/obj_all/common.a:
@echo " MAKE $@"
- @$(MAKE) -C ../common sql
+ @$(MAKE) -C $(COMMON_D) sql
-../common/obj_sql/common_sql.a:
+$(COMMON_D)/obj_sql/common_sql.a:
@echo " MAKE $@"
- @$(MAKE) -C ../common sql
+ @$(MAKE) -C $(COMMON_D) sql
$(MT19937AR_OBJ):
@echo " MAKE $@"
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index b516c61ca..e3a47abeb 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -1,35 +1,39 @@
-COMMON_H = $(shell ls ../common/*.h)
-CONFIG_H = $(shell ls ../config/*.h ../config/*/*.h)
+CONFIG_D = ../config
+CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
-MT19937AR_D = ../../3rdparty/mt19937ar
-MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
-MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
+COMMON_D = ../common
+COMMON_H = $(wildcard $(COMMON_D)/*.h)
LIBCONFIG_D = ../../3rdparty/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
- scanner.o strbuf.o)
+ scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
- scanctx.h scanner.h strbuf.h wincompat.h)
+ scanctx.h scanner.h strbuf.h wincompat.h)
LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-MAP_OBJ = $(addprefix obj_sql/, atcommand.o battle.o battleground.o \
- buyingstore.o chat.o chrif.o clif.o date.o duel.o elemental.o \
- guild.o homunculus.o HPMmap.o instance.o intif.o irc-bot.o itemdb.o \
- log.o mail.o map.o mapreg_sql.o mercenary.o mob.o npc.o npc_chat.o \
- party.o path.o pc.o pc_groups.o pet.o quest.o script.o \
- searchstore.o skill.o status.o storage.o trade.o unit.o vending.o)
+MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
+MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
+MT19937AR_INCLUDE = -I$(MT19937AR_D)
+
+MAP_C = atcommand.c battle.c battleground.c buyingstore.c chat.c chrif.c \
+ clif.c date.c duel.c elemental.c guild.c homunculus.c HPMmap.c \
+ instance.c intif.c irc-bot.c itemdb.c log.c mail.c map.c mapreg_sql.c \
+ mercenary.c mob.c npc.c npc_chat.c party.c path.c pc.c pc_groups.c \
+ pet.c quest.c script.c searchstore.c skill.c status.c storage.c \
+ trade.c unit.c vending.c
+MAP_OBJ = $(addprefix obj_sql/, $(patsubst %c,%o,$(MAP_C)))
MAP_H = atcommand.h battle.h battleground.h buyingstore.h chat.h chrif.h \
- clif.h date.h duel.h elemental.h guild.h homunculus.h HPMmap.h \
- instance.h intif.h irc-bot.h itemdb.h log.h mail.h map.h mapreg.h \
- mercenary.h mob.h npc.h packets.h packets_struct.h party.h path.h \
- pc.h pc_groups.h pet.h quest.h script.h searchstore.h skill.h \
- status.h storage.h trade.h unit.h vending.h
+ clif.h date.h duel.h elemental.h guild.h homunculus.h HPMmap.h \
+ instance.h intif.h irc-bot.h itemdb.h log.h mail.h map.h mapreg.h \
+ mercenary.h mob.h npc.h packets.h packets_struct.h party.h path.h \
+ pc.h pc_groups.h pet.h quest.h script.h searchstore.h skill.h \
+ status.h storage.h trade.h unit.h vending.h
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- MAP_SERVER_SQL_DEPENDS=$(MAP_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ)
+ MAP_SERVER_SQL_DEPENDS=$(MAP_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ)
else
MAP_SERVER_SQL_DEPENDS=needs_mysql
endif
@@ -63,12 +67,12 @@ clean: buildclean
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"
+ @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"
#####################################################################
@@ -91,7 +95,8 @@ map-server: ../../map-server@EXEEXT@
../../map-server@EXEEXT@: $(MAP_SERVER_SQL_DEPENDS) Makefile
@echo " LD $(notdir $@)"
- @$(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@
+ @$(CC) @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
+ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@
# map object files
@@ -100,14 +105,14 @@ obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H)
@$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
-../common/obj_all/common.a:
+$(COMMON_D)/obj_all/common.a:
@echo " MAKE $@"
- @$(MAKE) -C ../common sql
-
-../common/obj_sql/common_sql.a:
+ @$(MAKE) -C $(COMMON_D) sql
+
+$(COMMON_D)/obj_sql/common_sql.a:
@echo " MAKE $@"
- @$(MAKE) -C ../common sql
-
+ @$(MAKE) -C $(COMMON_D) sql
+
$(MT19937AR_OBJ):
@echo " MAKE $@"
@$(MAKE) -C $(MT19937AR_D)
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
index 53f44a0b4..ff2e83cf9 100644
--- a/src/plugins/Makefile.in
+++ b/src/plugins/Makefile.in
@@ -15,11 +15,15 @@ MYPLUGINS =
PLUGINS = sample db2sql HPMHooking $(MYPLUGINS)
-COMMON_H = $(shell ls ../common/*.h)
-CONFIG_H = $(shell ls ../config/*.h ../config/*/*.h)
-MAP_H = $(shell ls ../map/*.h)
-CHAR_H = $(shell ls ../char/*.h)
-LOGIN_H = $(shell ls ../login/*.h)
+COMMON_D = ../common
+COMMON_H = $(wildcard $(COMMON_D)/*.h)
+
+CONFIG_D = ../config
+CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
+
+MAP_H = $(wildcard ../map/*.h)
+CHAR_H = $(wildcard ../char/*.h)
+LOGIN_H = $(wildcard ../login/*.h)
ALL_H = $(COMMON_H) $(CONFIG_H) $(MAP_H) $(CHAR_H) $(LOGIN_H)
@SET_MAKE@
diff --git a/src/test/Makefile.in b/src/test/Makefile.in
index 0c6d15c6b..c70997c63 100644
--- a/src/test/Makefile.in
+++ b/src/test/Makefile.in
@@ -1,23 +1,26 @@
-COMMON_H = $(shell ls ../common/*.h)
-CONFIG_H = $(shell ls ../config/*.h ../config/*/*.h)
+CONFIG_D = ../config
+CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
-MT19937AR_D = ../../3rdparty/mt19937ar
-MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
-MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
+COMMON_D = ../common
+COMMON_H = $(wildcard $(COMMON_D)/*.h)
LIBCONFIG_D = ../../3rdparty/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
- scanner.o strbuf.o)
+ scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
- scanctx.h scanner.h strbuf.h wincompat.h)
+ scanctx.h scanner.h strbuf.h wincompat.h)
LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
+MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
+MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
+MT19937AR_INCLUDE = -I$(MT19937AR_D)
+
TEST_SPINLOCK_OBJ=obj/test_spinlock.o
TEST_SPINLOCK_H=
-TEST_SPINLOCK_DEPENDS=$(TEST_SPINLOCK_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ)
-
+TEST_SPINLOCK_DEPENDS=$(TEST_SPINLOCK_OBJ) $(COMMON_D)/obj_sql/common_sql.a $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ)
+
@SET_MAKE@
CC = @CC@
@@ -51,7 +54,8 @@ obj:
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@
+ @$(CC) @LDFLAGS@ -o ../../test_spinlock@EXEEXT@ $(TEST_SPINLOCK_OBJ) $(COMMON_D)/obj_sql/common_sql.a \
+ $(COMMON_D)/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# login object files
@@ -60,13 +64,13 @@ obj/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj
@$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
-../common/obj_all/common.a:
+$(COMMON_D)/obj_all/common.a:
@echo " MAKE $@"
- @$(MAKE) -C ../common sql
+ @$(MAKE) -C $(COMMON_D) sql
-../common/obj_sql/common_sql.a:
+$(COMMON_D)/obj_sql/common_sql.a:
@echo " MAKE $@"
- @$(MAKE) -C ../common sql
+ @$(MAKE) -C $(COMMON_D) sql
$(MT19937AR_OBJ):
@echo " MAKE $@"
diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in
index ee448a16a..307aa6d2c 100644
--- a/src/tool/Makefile.in
+++ b/src/tool/Makefile.in
@@ -1,19 +1,20 @@
+CONFIG_D = ../config
+CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
+
COMMON_D = ../common
COMMON_OBJ = $(addprefix $(COMMON_D)/obj_all/, des.o grfio.o malloc.o \
- miniconsole.o minicore.o showmsg.o strlib.o utils.o)
+ miniconsole.o minicore.o showmsg.o strlib.o utils.o)
COMMON_H = $(addprefix $(COMMON_D)/, cbasetypes.h console.h core.h des.h \
- grfio.h malloc.h mmo.h showmsg.h strlib.h utils.h)
+ grfio.h malloc.h mmo.h showmsg.h strlib.h utils.h)
LIBCONFIG_D = ../../3rdparty/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
- scanner.o strbuf.o)
+ scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
- scanctx.h scanner.h strbuf.h wincompat.h)
+ scanctx.h scanner.h strbuf.h wincompat.h)
LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-CONFIG_H = $(shell ls ../config/*.h ../config/*/*.h)
-
MAPCACHE_OBJ = obj_all/mapcache.o
@SET_MAKE@
@@ -63,13 +64,13 @@ obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(LIBCONFIG_H) | obj_all
@$(CC) @CFLAGS@ $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing common object files
-../common/obj_all/%.o:
+$(COMMON_D)/obj_all/%.o:
@echo " MAKE $@"
- @$(MAKE) -C ../common sql
+ @$(MAKE) -C $(COMMON_D) sql
-../common/obj_all/mini%.o:
+$(COMMON_D)/obj_all/mini%.o:
@echo " MAKE $@"
- @$(MAKE) -C ../common sql
+ @$(MAKE) -C $(COMMON_D) sql
$(LIBCONFIG_OBJ):
@echo " MAKE $@"
diff --git a/tools/HPMHookGen/Makefile.in b/tools/HPMHookGen/Makefile.in
index 10a3c55ba..c89228c7a 100644
--- a/tools/HPMHookGen/Makefile.in
+++ b/tools/HPMHookGen/Makefile.in
@@ -1,13 +1,13 @@
@SET_MAKE@
-COMMON_C = $(shell ls ../../src/common/*.c)
-COMMON_H = $(shell ls ../../src/common/*.h)
-MAP_C = $(shell ls ../../src/map/*.c)
-MAP_H = $(shell ls ../../src/map/*.h)
-CHAR_C = $(shell ls ../../src/char/*.c)
-CHAR_H = $(shell ls ../../src/char/*.h)
-LOGIN_C = $(shell ls ../../src/login/*.c)
-LOGIN_H = $(shell ls ../../src/login/*.h)
+COMMON_C = $(wildcard ../../src/common/*.c)
+COMMON_H = $(wildcard ../../src/common/*.h)
+MAP_C = $(wildcard ../../src/map/*.c)
+MAP_H = $(wildcard ../../src/map/*.h)
+CHAR_C = $(wildcard ../../src/char/*.c)
+CHAR_H = $(wildcard ../../src/char/*.h)
+LOGIN_C = $(wildcard ../../src/login/*.c)
+LOGIN_H = $(wildcard ../../src/login/*.h)
ALL_C = $(COMMON_C) $(MAP_C) $(CHAR_C) $(LOGIN_C)
ALL_H = $(COMMON_H) $(MAP_H) $(CHAR_H) $(LOGIN_H)