summaryrefslogtreecommitdiff
path: root/src/tool
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/tool
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/tool')
-rw-r--r--src/tool/Makefile.in40
1 files changed, 21 insertions, 19 deletions
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)