summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-09-18 05:11:10 +0200
committerHaru <haru@dotalux.com>2013-09-18 16:29:18 +0200
commitbabdf60b0339ac4249072a4ba13d27052e0b2fc5 (patch)
treeadfc85bbae73830081098ae7dc56325448b8cfc7 /src
parent78c7c6bf04a6c96d92524ae37ad165e65f599eb8 (diff)
downloadhercules-babdf60b0339ac4249072a4ba13d27052e0b2fc5.tar.gz
hercules-babdf60b0339ac4249072a4ba13d27052e0b2fc5.tar.bz2
hercules-babdf60b0339ac4249072a4ba13d27052e0b2fc5.tar.xz
hercules-babdf60b0339ac4249072a4ba13d27052e0b2fc5.zip
Makefiles improvements and cleanup
This should resolve #138 (please reopen or comment on it if it's not the case). Special thanks to Takkun for helping to reproduce the issue. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/char/Makefile.in76
-rw-r--r--src/common/Makefile.in65
-rw-r--r--src/login/Makefile.in62
-rw-r--r--src/map/Makefile.in103
-rw-r--r--src/plugins/Makefile.in2
-rw-r--r--src/test/Makefile.in34
-rw-r--r--src/tool/Makefile.in40
7 files changed, 201 insertions, 181 deletions
diff --git a/src/char/Makefile.in b/src/char/Makefile.in
index 0c4034a53..b2cee3f88 100644
--- a/src/char/Makefile.in
+++ b/src/char/Makefile.in
@@ -1,27 +1,29 @@
COMMON_H = $(shell ls ../common/*.h)
-
-MT19937AR_OBJ = ../../3rdparty/mt19937ar/mt19937ar.o
-MT19937AR_H = ../../3rdparty/mt19937ar/mt19937ar.h
-MT19937AR_INCLUDE = -I../../3rdparty/mt19937ar
-
-LIBCONFIG_OBJ = ../../3rdparty/libconfig/libconfig.o ../../3rdparty/libconfig/grammar.o \
- ../../3rdparty/libconfig/scanctx.o ../../3rdparty/libconfig/scanner.o ../../3rdparty/libconfig/strbuf.o
-LIBCONFIG_H = ../../3rdparty/libconfig/libconfig.h ../../3rdparty/libconfig/grammar.h \
- ../../3rdparty/libconfig/parsectx.h ../../3rdparty/libconfig/scanctx.h ../../3rdparty/libconfig/scanner.h \
- ../../3rdparty/libconfig/strbuf.h ../../3rdparty/libconfig/wincompat.h
-LIBCONFIG_INCLUDE = -I../../3rdparty/libconfig
-
-COMMON_SQL_OBJ = ../common/obj_sql/sql.o
-COMMON_H = ../common/sql.h
-
-CHAR_OBJ = obj_sql/char.o obj_sql/inter.o obj_sql/int_party.o obj_sql/int_guild.o \
- obj_sql/int_storage.o obj_sql/int_pet.o obj_sql/int_homun.o obj_sql/int_mail.o obj_sql/int_auction.o obj_sql/int_quest.o obj_sql/int_mercenary.o obj_sql/int_elemental.o obj_sql/pincode.o
-CHAR_H = char.h inter.h int_party.h int_guild.h int_storage.h int_pet.h int_homun.h int_mail.h int_auction.h int_quest.h int_mercenary.h int_elemental.h pincode.h
+CONFIG_H = $(shell ls ../config/*.h ../config/*/*.h)
+
+MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
+MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
+MT19937AR_INCLUDE = -I$(MT19937AR_D)
+
+LIBCONFIG_D = ../../3rdparty/libconfig
+LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
+ scanner.o strbuf.o)
+LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.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)
+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
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- CHAR_SERVER_SQL_DEPENDS=obj_sql $(CHAR_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ)
+ CHAR_SERVER_SQL_DEPENDS=$(CHAR_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ)
else
CHAR_SERVER_SQL_DEPENDS=needs_mysql
endif
@@ -32,13 +34,11 @@ CC = @CC@
export CC
#####################################################################
-.PHONY : all char-server clean help
+.PHONY: all sql char-server clean help
-all: char-server
+all: sql
-char-server: $(CHAR_SERVER_SQL_DEPENDS)
- @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@
+sql: char-server
clean:
@echo " CLEAN char"
@@ -46,10 +46,10 @@ clean:
help:
@echo "possible targets are 'char-server' 'all' 'clean' 'help'"
- @echo "'char-server' - char server (SQL version)"
- @echo "'all' - builds all above targets"
- @echo "'clean' - cleans builds and objects"
- @echo "'help' - outputs this message"
+ @echo "'char-server' - char server"
+ @echo "'all' - builds all above targets"
+ @echo "'clean' - cleans builds and objects"
+ @echo "'help' - outputs this message"
#####################################################################
@@ -57,23 +57,37 @@ needs_mysql:
@echo "MySQL not found or disabled by the configure script"
@exit 1
+# object directories
+
obj_sql:
@echo " MKDIR obj_sql"
@-mkdir obj_sql
-obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(COMMON_SQL_H) $(MT19937AR_H) $(LIBCONFIG_H)
+# executables
+
+char-server: $(CHAR_SERVER_SQL_DEPENDS)
+ @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@
+
+# char object files
+
+obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
@$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
../common/obj_all/common.a:
+ @echo " MAKE $@"
@$(MAKE) -C ../common sql
../common/obj_sql/common_sql.a:
+ @echo " MAKE $@"
@$(MAKE) -C ../common sql
$(MT19937AR_OBJ):
- @$(MAKE) -C ../../3rdparty/mt19937ar
+ @echo " MAKE $@"
+ @$(MAKE) -C $(MT19937AR_D)
$(LIBCONFIG_OBJ):
- @$(MAKE) -C ../../3rdparty/libconfig
+ @echo " MAKE $@"
+ @$(MAKE) -C $(LIBCONFIG_D)
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index 313db8ccc..7efad9e45 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -1,30 +1,32 @@
-COMMON_OBJ = obj_all/core.o obj_all/socket.o obj_all/timer.o obj_all/db.o obj_all/HPM.o \
- obj_all/nullpo.o obj_all/malloc.o obj_all/showmsg.o obj_all/strlib.o obj_all/utils.o \
- obj_all/grfio.o obj_all/mapindex.o obj_all/ers.o obj_all/md5calc.o \
- obj_all/minicore.o obj_all/minisocket.o obj_all/minimalloc.o obj_all/random.o obj_all/des.o \
- obj_all/conf.o obj_all/thread.o obj_all/mutex.o obj_all/raconf.o obj_all/mempool.o obj_all/console.o \
- obj_all/miniconsole.o
-
-COMMON_H = $(shell ls ../common/*.h)
+MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
+MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
+MT19937AR_INCLUDE = -I$(MT19937AR_D)
+
+LIBCONFIG_D = ../../3rdparty/libconfig
+LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
+ scanner.o strbuf.o)
+LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
+ scanctx.h scanner.h strbuf.h wincompat.h)
+LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
+
+COMMON_OBJ = $(addprefix obj_all/, conf.o console.o core.o db.o des.o ers.o \
+ grfio.o HPM.o malloc.o mapindex.o md5calc.o mempool.o \
+ miniconsole.o minicore.o minimalloc.o minisocket.o mutex.o \
+ nullpo.o raconf.o random.o showmsg.o socket.o strlib.o thread.o \
+ timer.o utils.o)
+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
COMMON_SQL_OBJ = obj_sql/sql.o
COMMON_SQL_H = sql.h
-MT19937AR_OBJ = ../../3rdparty/mt19937ar/mt19937ar.o
-MT19937AR_H = ../../3rdparty/mt19937ar/mt19937ar.h
-MT19937AR_INCLUDE = -I../../3rdparty/mt19937ar
-
-LIBCONFIG_OBJ = ../../3rdparty/libconfig/libconfig.o ../../3rdparty/libconfig/grammar.o \
- ../../3rdparty/libconfig/scanctx.o ../../3rdparty/libconfig/scanner.o ../../3rdparty/libconfig/strbuf.o
-LIBCONFIG_H = ../../3rdparty/libconfig/libconfig.h ../../3rdparty/libconfig/grammar.h \
- ../../3rdparty/libconfig/parsectx.h ../../3rdparty/libconfig/scanctx.h ../../3rdparty/libconfig/scanner.h \
- ../../3rdparty/libconfig/strbuf.h ../../3rdparty/libconfig/wincompat.h
-LIBCONFIG_INCLUDE = -I../../3rdparty/libconfig
-
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- ALL_DEPENDS=sql
SQL_DEPENDS=common common_sql
else
SQL_DEPENDS=needs_mysql
@@ -36,9 +38,9 @@ CC = @CC@
export CC
#####################################################################
-.PHONY : all sql clean help
+.PHONY: all sql common common_sql clean help
-all: $(ALL_DEPENDS)
+all: sql
sql: $(SQL_DEPENDS)
@@ -59,6 +61,8 @@ needs_mysql:
@echo "MySQL not found or disabled by the configure script"
@exit 1
+# object directories
+
obj_all:
@echo " MKDIR obj_all"
@-mkdir obj_all
@@ -74,28 +78,29 @@ obj_all/common.a: $(COMMON_OBJ)
obj_sql/common_sql.a: $(COMMON_SQL_OBJ)
@echo " AR $@"
@@AR@ rcs obj_sql/common_sql.a $(COMMON_SQL_OBJ)
-
-common: obj_all $(COMMON_OBJ) $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) obj_all/common.a
+common: $(COMMON_OBJ) $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) obj_all/common.a
-common_sql: obj_sql $(COMMON_SQL_OBJ) obj_sql/common_sql.a
+common_sql: $(COMMON_SQL_OBJ) obj_sql/common_sql.a
-obj_all/%.o: %.c $(COMMON_H) $(MT19937AR_H) $(LIBCONFIG_H)
+obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_all
@echo " CC $<"
@$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
-obj_all/mini%.o: %.c $(COMMON_H) $(MT19937AR_H) $(LIBCONFIG_H)
+obj_all/mini%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_all
@echo " CC $<"
@$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
-obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) $(LIBCONFIG_H)
+obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
@$(CC) @CFLAGS@ $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(MT19937AR_OBJ):
- @$(MAKE) -C ../../3rdparty/mt19937ar
+ @echo " MAKE $@"
+ @$(MAKE) -C $(MT19937AR_D)
$(LIBCONFIG_OBJ):
- @$(MAKE) -C ../../3rdparty/libconfig
+ @echo " MAKE $@"
+ @$(MAKE) -C $(LIBCONFIG_D)
diff --git a/src/login/Makefile.in b/src/login/Makefile.in
index 5014d667a..125f4fb7a 100644
--- a/src/login/Makefile.in
+++ b/src/login/Makefile.in
@@ -1,25 +1,26 @@
COMMON_H = $(shell ls ../common/*.h)
-
-MT19937AR_OBJ = ../../3rdparty/mt19937ar/mt19937ar.o
-MT19937AR_H = ../../3rdparty/mt19937ar/mt19937ar.h
-MT19937AR_INCLUDE = -I../../3rdparty/mt19937ar
-
-LIBCONFIG_OBJ = ../../3rdparty/libconfig/libconfig.o ../../3rdparty/libconfig/grammar.o \
- ../../3rdparty/libconfig/scanctx.o ../../3rdparty/libconfig/scanner.o ../../3rdparty/libconfig/strbuf.o
-LIBCONFIG_H = ../../3rdparty/libconfig/libconfig.h ../../3rdparty/libconfig/grammar.h \
- ../../3rdparty/libconfig/parsectx.h ../../3rdparty/libconfig/scanctx.h ../../3rdparty/libconfig/scanner.h \
- ../../3rdparty/libconfig/strbuf.h ../../3rdparty/libconfig/wincompat.h
-LIBCONFIG_INCLUDE = -I../../3rdparty/libconfig
-
-LOGIN_OBJ = login.o
-LOGIN_SQL_OBJ = $(LOGIN_OBJ:%=obj_sql/%) \
- obj_sql/account_sql.o obj_sql/ipban_sql.o obj_sql/loginlog_sql.o
+CONFIG_H = $(shell ls ../config/*.h ../config/*/*.h)
+
+MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
+MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
+MT19937AR_INCLUDE = -I$(MT19937AR_D)
+
+LIBCONFIG_D = ../../3rdparty/libconfig
+LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
+ scanner.o strbuf.o)
+LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.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)
LOGIN_H = login.h account.h ipban.h loginlog.h
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- LOGIN_SERVER_SQL_DEPENDS=obj_sql $(LOGIN_SQL_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ)
+ LOGIN_SERVER_SQL_DEPENDS=$(LOGIN_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ)
else
LOGIN_SERVER_SQL_DEPENDS=needs_mysql
endif
@@ -30,22 +31,22 @@ CC = @CC@
export CC
#####################################################################
-.PHONY :all sql clean help
+.PHONY: all sql login-server clean help
all: sql
-sql: obj_sql login-server
+sql: login-server
clean:
@echo " CLEAN login"
@rm -rf *.o obj_sql ../../login-server@EXEEXT@
help:
- @echo "possible targets are 'sql' 'all' 'clean' 'help'"
- @echo "'sql' - login server (SQL version)"
- @echo "'all' - builds all above targets"
- @echo "'clean' - cleans builds and objects"
- @echo "'help' - outputs this message"
+ @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 "'help' - outputs this message"
#####################################################################
@@ -59,28 +60,31 @@ obj_sql:
@echo " MKDIR obj_sql"
@-mkdir obj_sql
-#executables
+# executables
login-server: $(LOGIN_SERVER_SQL_DEPENDS)
@echo " LD $@"
- @$(CC) @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_SQL_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/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @MYSQL_LIBS@
# login object files
-obj_sql/%.o: %.c $(LOGIN_H) $(COMMON_H) $(MT19937AR_H) $(LIBCONFIG_H)
+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) $<
# missing object files
../common/obj_all/common.a:
+ @echo " MAKE $@"
@$(MAKE) -C ../common sql
../common/obj_sql/common_sql.a:
+ @echo " MAKE $@"
@$(MAKE) -C ../common sql
$(MT19937AR_OBJ):
- @$(MAKE) -C ../../3rdparty/mt19937ar
+ @echo " MAKE $@"
+ @$(MAKE) -C $(MT19937AR_D)
$(LIBCONFIG_OBJ):
- @$(MAKE) -C ../../3rdparty/libconfig
+ @echo " MAKE $@"
+ @$(MAKE) -C $(LIBCONFIG_D)
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index 588d19eae..ed1b9a79d 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -1,43 +1,38 @@
COMMON_H = $(shell ls ../common/*.h)
-
-MT19937AR_OBJ = ../../3rdparty/mt19937ar/mt19937ar.o
-MT19937AR_H = ../../3rdparty/mt19937ar/mt19937ar.h
-MT19937AR_INCLUDE = -I../../3rdparty/mt19937ar
-
-LIBCONFIG_OBJ = ../../3rdparty/libconfig/libconfig.o ../../3rdparty/libconfig/grammar.o \
- ../../3rdparty/libconfig/scanctx.o ../../3rdparty/libconfig/scanner.o ../../3rdparty/libconfig/strbuf.o
-LIBCONFIG_H = ../../3rdparty/libconfig/libconfig.h ../../3rdparty/libconfig/grammar.h \
- ../../3rdparty/libconfig/parsectx.h ../../3rdparty/libconfig/scanctx.h ../../3rdparty/libconfig/scanner.h \
- ../../3rdparty/libconfig/strbuf.h ../../3rdparty/libconfig/wincompat.h
-LIBCONFIG_INCLUDE = -I../../3rdparty/libconfig
-
-MAP_OBJ = map.o chrif.o clif.o pc.o status.o npc.o \
- npc_chat.o chat.o path.o itemdb.o mob.o script.o \
- storage.o skill.o atcommand.o battle.o battleground.o \
- intif.o trade.o party.o vending.o guild.o pet.o \
- log.o mail.o date.o unit.o homunculus.o mercenary.o quest.o instance.o \
- buyingstore.o searchstore.o duel.o pc_groups.o elemental.o irc-bot.o HPMmap.o
-MAP_SQL_OBJ = $(MAP_OBJ:%=obj_sql/%) \
- obj_sql/mapreg_sql.o
-MAP_H = map.h chrif.h clif.h pc.h status.h npc.h \
- chat.h itemdb.h mob.h script.h path.h \
- storage.h skill.h atcommand.h battle.h battleground.h \
- intif.h trade.h party.h vending.h guild.h pet.h \
- log.h mail.h date.h unit.h homunculus.h mercenary.h quest.h instance.h mapreg.h \
- buyingstore.h searchstore.h duel.h pc_groups.h \
- ../config/core.h ../config/renewal.h ../config/secure.h ../config/const.h \
- ../config/classes/general.h elemental.h packets.h packets_struct.h irc-bot.h HPMmap.h
+CONFIG_H = $(shell ls ../config/*.h ../config/*/*.h)
+
+MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
+MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
+MT19937AR_INCLUDE = -I$(MT19937AR_D)
+
+LIBCONFIG_D = ../../3rdparty/libconfig
+LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
+ scanner.o strbuf.o)
+LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.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)
+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
HAVE_MYSQL=@HAVE_MYSQL@
ifeq ($(HAVE_MYSQL),yes)
- ALL_DEPENDS=txt sql
- SQL_DEPENDS=map-server
+ MAP_SERVER_SQL_DEPENDS=$(MAP_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ)
else
- ALL_TARGET=txt
- SQL_DEPENDS=needs_mysql
+ MAP_SERVER_SQL_DEPENDS=needs_mysql
endif
-TXT_DEPENDS=map-server
HAVE_PCRE=@HAVE_PCRE@
ifeq ($(HAVE_PCRE),yes)
@@ -52,29 +47,22 @@ CC = @CC@
export CC
#####################################################################
-.PHONY : all txt sql clean help
-
-all: $(ALL_DEPENDS)
+.PHONY: all sql map-server clean help
-txt: $(TXT_DEPENDS)
+all: sql
-sql: $(SQL_DEPENDS)
+sql: map-server
clean:
@echo " CLEAN map"
- @rm -rf *.o obj_txt obj_sql ../../map-server@EXEEXT@
+ @rm -rf *.o obj_sql ../../map-server@EXEEXT@
help:
-ifeq ($(HAVE_MYSQL),yes)
- @echo "possible targets are 'sql' 'txt' 'all' 'clean' 'help'"
- @echo "'sql' - map server (SQL version)"
-else
- @echo "possible targets are 'txt' 'all' 'clean' 'help'"
-endif
- @echo "'txt' - map server (TXT version)"
- @echo "'all' - builds all above targets"
- @echo "'clean' - cleans builds and objects"
- @echo "'help' - outputs this message"
+ @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 "'help' - outputs this message"
#####################################################################
@@ -83,9 +71,6 @@ needs_mysql:
@exit 1
# object directories
-obj_txt:
- @echo " MKDIR obj_txt"
- @-mkdir obj_txt
obj_sql:
@echo " MKDIR obj_sql"
@@ -93,25 +78,29 @@ obj_sql:
# executables
-map-server: obj_sql $(MAP_SQL_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a
+map-server: $(MAP_SERVER_SQL_DEPENDS)
@echo " LD $@"
- @$(CC) @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_SQL_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/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ) $(LIBCONFIG_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@
# map object files
-obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(MT19937AR_H) $(LIBCONFIG_H)
+obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
@$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
../common/obj_all/common.a:
+ @echo " MAKE $@"
@$(MAKE) -C ../common sql
../common/obj_sql/common_sql.a:
+ @echo " MAKE $@"
@$(MAKE) -C ../common sql
$(MT19937AR_OBJ):
- @$(MAKE) -C ../../3rdparty/mt19937ar
+ @echo " MAKE $@"
+ @$(MAKE) -C $(MT19937AR_D)
$(LIBCONFIG_OBJ):
- @$(MAKE) -C ../../3rdparty/libconfig
+ @echo " MAKE $@"
+ @$(MAKE) -C $(LIBCONFIG_D)
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
index 98f18f4d4..5ed421abf 100644
--- a/src/plugins/Makefile.in
+++ b/src/plugins/Makefile.in
@@ -9,7 +9,7 @@ CC = @CC@
export CC
#####################################################################
-.PHONY : all $(PLUGINS) sample db2sql clean help
+.PHONY: all $(PLUGINS) sample db2sql clean help
all: $(PLUGINS)
diff --git a/src/test/Makefile.in b/src/test/Makefile.in
index 56cbfefc9..f17c43202 100644
--- a/src/test/Makefile.in
+++ b/src/test/Makefile.in
@@ -1,20 +1,22 @@
COMMON_H = $(shell ls ../common/*.h)
+CONFIG_H = $(shell ls ../config/*.h ../config/*/*.h)
-MT19937AR_OBJ = ../../3rdparty/mt19937ar/mt19937ar.o
-MT19937AR_H = ../../3rdparty/mt19937ar/mt19937ar.h
-MT19937AR_INCLUDE = -I../../3rdparty/mt19937ar
+MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
+MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
+MT19937AR_INCLUDE = -I$(MT19937AR_D)
-LIBCONFIG_OBJ = ../../3rdparty/libconfig/libconfig.o ../../3rdparty/libconfig/grammar.o \
- ../../3rdparty/libconfig/scanctx.o ../../3rdparty/libconfig/scanner.o ../../3rdparty/libconfig/strbuf.o
-LIBCONFIG_H = ../../3rdparty/libconfig/libconfig.h ../../3rdparty/libconfig/grammar.h \
- ../../3rdparty/libconfig/parsectx.h ../../3rdparty/libconfig/scanctx.h ../../3rdparty/libconfig/scanner.h \
- ../../3rdparty/libconfig/strbuf.h ../../3rdparty/libconfig/wincompat.h
-LIBCONFIG_INCLUDE = -I../../3rdparty/libconfig
+LIBCONFIG_D = ../../3rdparty/libconfig
+LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
+ scanner.o strbuf.o)
+LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
+ scanctx.h scanner.h strbuf.h wincompat.h)
+LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
TEST_SPINLOCK_OBJ=obj/test_spinlock.o
TEST_SPINLOCK_H=
-TEST_SPINLOCK_DEPENDS=obj $(TEST_SPINLOCK_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ)
+TEST_SPINLOCK_DEPENDS=$(TEST_SPINLOCK_OBJ) ../common/obj_sql/common_sql.a ../common/obj_all/common.a $(MT19937AR_OBJ)
@SET_MAKE@
@@ -22,7 +24,7 @@ CC = @CC@
export CC
#####################################################################
-.PHONY :all test_spinlock
+.PHONY: all test_spinlock
all: test_spinlock
@@ -46,19 +48,23 @@ test_spinlock: $(TEST_SPINLOCK_DEPENDS)
# login object files
-obj/%.o: %.c $(COMMON_H) $(MT19937AR_H) $(LIBCONFIG_H)
+obj/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj
@echo " CC $<"
@$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
../common/obj_all/common.a:
+ @echo " MAKE $@"
@$(MAKE) -C ../common sql
../common/obj_sql/common_sql.a:
+ @echo " MAKE $@"
@$(MAKE) -C ../common sql
$(MT19937AR_OBJ):
- @$(MAKE) -C ../../3rdparty/mt19937ar
+ @echo " MAKE $@"
+ @$(MAKE) -C $(MT19937AR_D)
$(LIBCONFIG_OBJ):
- @$(MAKE) -C ../../3rdparty/libconfig
+ @echo " MAKE $@"
+ @$(MAKE) -C $(LIBCONFIG_D)
diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in
index de4607dc3..4fa527ffc 100644
--- a/src/tool/Makefile.in
+++ b/src/tool/Makefile.in
@@ -1,19 +1,18 @@
-COMMON_OBJ = ../common/obj_all/minicore.o ../common/obj_all/malloc.o \
- ../common/obj_all/showmsg.o ../common/obj_all/strlib.o \
- ../common/obj_all/utils.o ../common/obj_all/des.o ../common/obj_all/grfio.o ../common/obj_all/miniconsole.o
-COMMON_H = ../common/core.h ../common/mmo.h \
- ../common/malloc.h ../common/showmsg.h ../common/strlib.h \
- ../common/utils.h ../common/cbasetypes.h ../common/des.h ../common/grfio.h ../common/console.h ../config/renewal.h
-
-LIBCONFIG_OBJ = ../../3rdparty/libconfig/libconfig.o ../../3rdparty/libconfig/grammar.o \
- ../../3rdparty/libconfig/scanctx.o ../../3rdparty/libconfig/scanner.o ../../3rdparty/libconfig/strbuf.o
-LIBCONFIG_H = ../../3rdparty/libconfig/libconfig.h ../../3rdparty/libconfig/grammar.h \
- ../../3rdparty/libconfig/parsectx.h ../../3rdparty/libconfig/scanctx.h ../../3rdparty/libconfig/scanner.h \
- ../../3rdparty/libconfig/strbuf.h ../../3rdparty/libconfig/wincompat.h
-LIBCONFIG_INCLUDE = -I../../3rdparty/libconfig
-
-OTHER_H = ../config/renewal.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)
+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)
+
+LIBCONFIG_D = ../../3rdparty/libconfig
+LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
+ scanner.o strbuf.o)
+LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.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
@@ -23,11 +22,11 @@ CC = @CC@
export CC
#####################################################################
-.PHONY : all mapcache clean help
+.PHONY: all mapcache clean help
all: mapcache
-mapcache: obj_all $(MAPCACHE_OBJ) $(COMMON_OBJ) $(LIBCONFIG_OBJ)
+mapcache: $(MAPCACHE_OBJ) $(COMMON_OBJ) $(LIBCONFIG_OBJ)
@echo " LD $@"
@$(CC) @LDFLAGS@ $(LIBCONFIG_INCLUDE) -o ../../mapcache@EXEEXT@ $(MAPCACHE_OBJ) $(COMMON_OBJ) $(LIBCONFIG_OBJ) @LIBS@
@@ -48,16 +47,19 @@ obj_all:
@echo " MKDIR obj_all"
@-mkdir obj_all
-obj_all/%.o: %.c $(COMMON_H) $(OTHER_H) $(LIBCONFIG_H)
+obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(LIBCONFIG_H) | obj_all
@echo " CC $<"
@$(CC) @CFLAGS@ $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing common object files
../common/obj_all/%.o:
+ @echo " MAKE $@"
@$(MAKE) -C ../common sql
../common/obj_all/mini%.o:
+ @echo " MAKE $@"
@$(MAKE) -C ../common sql
$(LIBCONFIG_OBJ):
- @$(MAKE) -C ../../3rdparty/libconfig
+ @echo " MAKE $@"
+ @$(MAKE) -C $(LIBCONFIG_D)