summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-11-20 03:52:08 +0100
committerHaru <haru@dotalux.com>2013-11-20 03:52:08 +0100
commit98ad6bc7987e2f96b9b5dda07ccae552ccfb4c86 (patch)
tree572a366a9b81c4d87e1a91f8f21985fcef008092 /src/char
parent1667c050a7a4b2a0dd699d0a174a071a692322dd (diff)
downloadhercules-98ad6bc7987e2f96b9b5dda07ccae552ccfb4c86.tar.gz
hercules-98ad6bc7987e2f96b9b5dda07ccae552ccfb4c86.tar.bz2
hercules-98ad6bc7987e2f96b9b5dda07ccae552ccfb4c86.tar.xz
hercules-98ad6bc7987e2f96b9b5dda07ccae552ccfb4c86.zip
Added support for 'make plugin.pluginname' to compile only 'pluginname'
- Various Makefile optimizations Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char')
-rw-r--r--src/char/Makefile.in61
1 files changed, 33 insertions, 28 deletions
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 $@"