diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-26 22:36:30 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-26 22:36:30 +0000 |
commit | 17222f8fdc6cb6f17efe391cbab0c357a5f93081 (patch) | |
tree | 5dcafe9c66fec2ae691bda2a4f86237c6ad81c39 /src | |
parent | 08bdb8f6123c057475b23c717402cea50b887864 (diff) | |
download | hercules-17222f8fdc6cb6f17efe391cbab0c357a5f93081.tar.gz hercules-17222f8fdc6cb6f17efe391cbab0c357a5f93081.tar.bz2 hercules-17222f8fdc6cb6f17efe391cbab0c357a5f93081.tar.xz hercules-17222f8fdc6cb6f17efe391cbab0c357a5f93081.zip |
* Normalized makefiles:
- 3 sections: variables, public targets, private/support targets
- object files always in a *_OBJ variable
- header files always in a *_H variable
- object files always generated to an obj* subfolder
- all Makefiles can be executed individually, calling other makefiles if necessary
- generic object targets when possible
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11812 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/char/Makefile.in | 29 | ||||
-rw-r--r-- | src/char_sql/Makefile.in | 39 | ||||
-rw-r--r-- | src/common/Makefile.in | 57 | ||||
-rw-r--r-- | src/ladmin/Makefile.in | 26 | ||||
-rw-r--r-- | src/login/Makefile.in | 21 | ||||
-rw-r--r-- | src/login_sql/Makefile.in | 23 | ||||
-rw-r--r-- | src/map/Makefile.in | 133 | ||||
-rw-r--r-- | src/plugins/Makefile.in | 34 | ||||
-rw-r--r-- | src/tool/Makefile.in | 14 | ||||
-rw-r--r-- | src/txt-converter/Makefile.in | 58 |
10 files changed, 221 insertions, 213 deletions
diff --git a/src/char/Makefile.in b/src/char/Makefile.in index 78d2cb2c8..334265819 100644 --- a/src/char/Makefile.in +++ b/src/char/Makefile.in @@ -1,3 +1,4 @@ + COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \ ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \ ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/utils.o \ @@ -9,18 +10,22 @@ COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/strlib.h ../common/grfio.h \ ../common/mapindex.h ../common/ers.h -CHAR_OBJ = char.o inter.o int_party.o int_guild.o int_storage.o int_status.o int_pet.o int_homun.o +CHAR_OBJ = obj/char.o obj/inter.o obj/int_party.o obj/int_guild.o \ + obj/int_storage.o obj/int_status.o obj/int_pet.o obj/int_homun.o +CHAR_H = char.h inter.h int_party.h int_guild.h int_storage.h int_status.h int_pet.h int_homun.h + +@SET_MAKE@ ##################################################################### .PHONY : all char-server clean help all: char-server -char-server: $(CHAR_OBJ) $(COMMON_OBJ) +char-server: obj $(CHAR_OBJ) $(COMMON_OBJ) @CC@ @LDFLAGS@ -o ../../char-server@EXEEXT@ $(CHAR_OBJ) $(COMMON_OBJ) @LIBS@ clean: - rm -f *.o ../../char-server@EXEEXT@ + rm -rf *.o obj ../../char-server@EXEEXT@ help: @echo "possible targets are 'char-server' 'all' 'clean' 'help'" @@ -31,16 +36,12 @@ help: ##################################################################### -%.o: %.c - @CC@ @CFLAGS@ -DTXT_ONLY @CPPFLAGS@ -c $(OUTPUT_OPTION) $< +obj: + -mkdir obj -# DO NOT DELETE +obj/%.o: %.c $(CHAR_H) $(COMMON_H) + @CC@ @CFLAGS@ -DTXT_ONLY @CPPFLAGS@ -c $(OUTPUT_OPTION) $< -char.o: char.c char.h inter.h int_pet.h $(COMMON_H) -inter.o: inter.c inter.h int_party.h int_guild.h int_storage.h int_pet.h char.h $(COMMON_H) -int_party.o: int_party.c int_party.h inter.h char.h $(COMMON_H) -int_guild.o: int_guild.c int_guild.h int_storage.h inter.h char.h $(COMMON_H) -int_storage.o: int_storage.c int_storage.h int_guild.h inter.h char.h $(COMMON_H) -int_status.o: int_status.c int_status.h char.h $(COMMON_H) -int_pet.o: int_pet.c int_pet.h inter.h char.h $(COMMON_H) -int_homun.o: int_homun.c int_homun.h inter.h char.h $(COMMON_H) +# missing common object files +../common/obj/%.o: + @$(MAKE) -C ../common txt diff --git a/src/char_sql/Makefile.in b/src/char_sql/Makefile.in index 685d4286d..8162511d5 100644 --- a/src/char_sql/Makefile.in +++ b/src/char_sql/Makefile.in @@ -1,33 +1,41 @@ + COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \ ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \ ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/utils.o \ ../common/obj/strlib.o ../common/obj/grfio.o \ - ../common/obj/mapindex.o ../common/obj/ers.o ../common/obj_sql/sql.o + ../common/obj/mapindex.o ../common/obj/ers.o COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h \ ../common/version.h ../common/db.h ../common/plugins.h ../common/lock.h \ ../common/malloc.h ../common/showmsg.h ../common/utils.h \ ../common/strlib.h ../common/grfio.h \ - ../common/mapindex.h ../common/ers.h ../common/sql.h + ../common/mapindex.h ../common/ers.h + +COMMON_SQL_OBJ = ../common/obj_sql/sql.o +COMMON_H = ../common/sql.h -CHAR_OBJ = char.o inter.o int_party.o int_guild.o int_storage.o int_pet.o int_homun.o int_mail.o +CHAR_OBJ = obj/char.o obj/inter.o obj/int_party.o obj/int_guild.o \ + obj/int_storage.o obj/int_pet.o obj/int_homun.o obj/int_mail.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 HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) - CHAR_SERVER_SQL_DEPENDS=$(CHAR_OBJ) $(COMMON_OBJ) + CHAR_SERVER_SQL_DEPENDS=obj $(CHAR_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ) else CHAR_SERVER_SQL_DEPENDS=needs_mysql endif +@SET_MAKE@ + ##################################################################### .PHONY : all char-server_sql clean help all: char-server_sql char-server_sql: $(CHAR_SERVER_SQL_DEPENDS) - @CC@ @LDFLAGS@ -o ../../char-server_sql@EXEEXT@ $(CHAR_OBJ) $(COMMON_OBJ) @LIBS@ @MYSQL_LIBS@ + @CC@ @LDFLAGS@ -o ../../char-server_sql@EXEEXT@ $(CHAR_OBJ) $(COMMON_OBJ) $(COMMON_SQL_OBJ) @LIBS@ @MYSQL_LIBS@ clean: - rm -f *.o ../../char-server_sql@EXEEXT@ + rm -rf *.o obj ../../char-server_sql@EXEEXT@ help: @echo "possible targets are 'char-server_sql' 'all' 'clean' 'help'" @@ -42,16 +50,15 @@ needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 -%.o: %.c +obj: + -mkdir obj + +obj/%.o: %.c $(CHAR_H) $(COMMON_H) $(COMMON_SQL_H) @CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< -# DO NOT DELETE +# missing common object files +../common/obj/%.o: + @$(MAKE) -C ../common sql -char.o: char.c char.h $(COMMON_H) -inter.o: inter.c inter.h int_party.h int_guild.h int_storage.h int_pet.h int_homun.h $(COMMON_H) -int_party.o: int_party.c int_party.h inter.h $(COMMON_H) -int_guild.o: int_guild.c int_guild.h inter.h $(COMMON_H) -int_storage.o: int_storage.c int_storage.h char.h $(COMMON_H) -int_pet.o: int_pet.c int_pet.h inter.h char.h $(COMMON_H) -int_homun.o: int_homun.c int_homun.h inter.h char.h $(COMMON_H) -int_mail.o: int_mail.c int_mail.h inter.h char.h $(COMMON_H)
\ No newline at end of file +../common/obj_sql/%.o: + @$(MAKE) -C ../common sql diff --git a/src/common/Makefile.in b/src/common/Makefile.in index 94f42a956..89bb8a75a 100644 --- a/src/common/Makefile.in +++ b/src/common/Makefile.in @@ -1,18 +1,33 @@ + +COMMON_OBJ = obj/core.o obj/socket.o obj/timer.o obj/db.o obj/plugins.o obj/lock.o \ + obj/nullpo.o obj/malloc.o obj/showmsg.o obj/strlib.o obj/utils.o \ + obj/grfio.o obj/mapindex.o obj/ers.o obj/md5calc.o \ + obj/minicore.o obj/minisocket.o obj/minimalloc.o +COMMON_H = svnversion.h mmo.h plugin.h version.h \ + core.h socket.h timer.h db.h plugins.h lock.h \ + nullpo.h malloc.h showmsg.h strlib.h utils.h \ + grfio.h mapindex.h ers.h md5calc.h + +COMMON_SQL_OBJ = obj_sql/sql.o +COMMON_SQL_H = sql.h + HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) ALL_DEPENDS=txt sql - SQL_DEPENDS=txt obj_sql common_sql + SQL_DEPENDS=common common_sql else ALL_TARGET=txt SQL_DEPENDS=needs_mysql endif +@SET_MAKE@ + ##################################################################### .PHONY : all txt sql clean help all: $(ALL_DEPENDS) -txt: obj common +txt: common sql: $(SQL_DEPENDS) @@ -39,21 +54,18 @@ obj: obj_sql: -mkdir obj_sql -common: obj/core.o obj/socket.o obj/timer.o obj/db.o obj/plugins.o obj/lock.o \ - obj/nullpo.o obj/malloc.o obj/showmsg.o obj/strlib.o obj/utils.o \ - obj/grfio.o obj/minicore.o obj/minisocket.o obj/minimalloc.o \ - obj/mapindex.o obj/ers.o obj/md5calc.o +common: obj $(COMMON_OBJ) -common_sql: obj_sql/sql.o +common_sql: obj_sql $(COMMON_SQL_OBJ) -obj/%.o: %.c +obj/%.o: %.c $(COMMON_H) @CC@ @CFLAGS@ @LDFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< -obj/mini%.o: %.c +obj/mini%.o: %.c $(COMMON_H) @CC@ @CFLAGS@ -DMINICORE @LDFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< -obj_sql/%.o: %.c +obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) @CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< @@ -68,28 +80,3 @@ else svnversion.h: @printf "\n" > svnversion.h endif - -obj/minicore.o: core.c core.h -obj/minisocket.o: socket.c socket.h -obj/minimalloc.o: malloc.c malloc.h - -# DO NOT DELETE - -obj/core.o: core.c core.h showmsg.h svnversion.h -obj/db.o: db.c db.h showmsg.h ers.h -obj/ers.o: ers.c ers.h cbasetypes.h -obj/grfio.o: grfio.c grfio.h -obj/lock.o: lock.c lock.h showmsg.h -obj/malloc.o: malloc.c malloc.h showmsg.h -obj/mapindex.o: mapindex.c mapindex.h -obj/md5calc.o: md5calc.c md5calc.h -obj/nullpo.o: nullpo.c nullpo.h showmsg.h -obj/plugins.o: plugins.c plugins.h plugin.h -obj/showmsg.o: showmsg.c showmsg.h -obj/socket.o: socket.c socket.h mmo.h showmsg.h plugins.h -obj/strlib.o: strlib.c strlib.h utils.h -obj/timer.o: timer.c timer.h showmsg.h -obj/utils.o: utils.c utils.h malloc.h showmsg.h mmo.h -obj_sql/sql.o: sql.c sql.h cbasetypes.h malloc.h showmsg.h utils.h -mmo.h: cbasetypes.h - @touch mmo.h diff --git a/src/ladmin/Makefile.in b/src/ladmin/Makefile.in index f1f7bff23..87cc2ad49 100644 --- a/src/ladmin/Makefile.in +++ b/src/ladmin/Makefile.in @@ -1,20 +1,26 @@ + COMMON_OBJ = ../common/obj/minicore.o ../common/obj/minisocket.o ../common/obj/timer.o \ ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/strlib.o \ ../common/obj/utils.o ../common/obj/md5calc.o COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h \ ../common/version.h ../common/malloc.h ../common/showmsg.h ../common/strlib.h \ - ../common/utils.h ../common/md5calc.h + ../common/utils.h ../common/md5calc.h ../common/cbasetypes.h + +LADMIN_OBJ = obj/ladmin.o +LADMIN_H = ladmin.h + +@SET_MAKE@ ##################################################################### .PHONY : all ladmin clean help all: ladmin -ladmin: ladmin.o $(COMMON_OBJ) - @CC@ @LDFLAGS@ -o ../../ladmin@EXEEXT@ ladmin.o $(COMMON_OBJ) @LIBS@ +ladmin: obj $(LADMIN_OBJ) $(COMMON_OBJ) + @CC@ @LDFLAGS@ -o ../../ladmin@EXEEXT@ $(LADMIN_OBJ) $(COMMON_OBJ) @LIBS@ clean: - rm -f *.o ../../ladmin@EXEEXT@ + rm -rf *.o obj ../../ladmin@EXEEXT@ help: @echo "possible targets are 'ladmin' 'all' 'clean' 'help'" @@ -25,7 +31,15 @@ help: ##################################################################### -# DO NOT DELETE +obj: + -mkdir obj -ladmin.o: ladmin.c ladmin.h $(COMMON_H) +obj/%.o: %.c $(LADMIN_H) $(COMMON_H) @CC@ @CFLAGS@ @LDFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + +# missing common object files +../common/obj/%.o: + @$(MAKE) -C ../common txt + +../common/obj/mini%.o: + @$(MAKE) -C ../common txt diff --git a/src/login/Makefile.in b/src/login/Makefile.in index c0fdcc8e3..187a3eaf0 100644 --- a/src/login/Makefile.in +++ b/src/login/Makefile.in @@ -1,3 +1,4 @@ + COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \ ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \ ../common/obj/malloc.o ../common/obj/showmsg.o ../common/obj/utils.o \ @@ -9,16 +10,21 @@ COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/grfio.h ../common/mapindex.h \ ../common/ers.h ../common/md5calc.h +LOGIN_OBJ = obj/login.o +LOGIN_H = login.h + +@SET_MAKE@ + ##################################################################### .PHONY : all login-server clean help all: login-server -login-server: login.o $(COMMON_OBJ) - @CC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ login.o $(COMMON_OBJ) @LIBS@ +login-server: obj $(LOGIN_OBJ) $(COMMON_OBJ) + @CC@ @LDFLAGS@ -o ../../login-server@EXEEXT@ $(LOGIN_OBJ) $(COMMON_OBJ) @LIBS@ clean: - rm -f *.o ../../login-server@EXEEXT@ + rm -rf *.o obj ../../login-server@EXEEXT@ help: @echo "possible targets are 'login-server' 'all' 'clean' 'help'" @@ -29,7 +35,12 @@ help: ##################################################################### -# DO NOT DELETE +obj: + -mkdir obj -login.o: login.c login.h $(COMMON_H) +obj/%.o: %.c $(LOGIN_H) $(COMMON_H) @CC@ @CFLAGS@ -DTXT_ONLY @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + +# missing common object files +../common/obj/%.o: + @$(MAKE) -C ../common sql diff --git a/src/login_sql/Makefile.in b/src/login_sql/Makefile.in index d10b49b5f..22a1437b3 100644 --- a/src/login_sql/Makefile.in +++ b/src/login_sql/Makefile.in @@ -9,23 +9,28 @@ COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/grfio.h ../common/mapindex.h \ ../common/ers.h ../common/md5calc.h ../common/sql.h +LOGIN_OBJ = obj/login.o +LOGIN_H = login.h + HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) - LOGIN_SERVER_SQL_DEPENDS=login.o $(COMMON_OBJ) + LOGIN_SERVER_SQL_DEPENDS=obj $(LOGIN_OBJ) $(COMMON_OBJ) else LOGIN_SERVER_SQL_DEPENDS=needs_mysql endif +@SET_MAKE@ + ##################################################################### .PHONY : all login-server_sql clean help all: login-server_sql login-server_sql: $(LOGIN_SERVER_SQL_DEPENDS) - @CC@ @LDFLAGS@ -o ../../login-server_sql@EXEEXT@ login.o $(COMMON_OBJ) @LIBS@ @MYSQL_LIBS@ + @CC@ @LDFLAGS@ -o ../../login-server_sql@EXEEXT@ $(LOGIN_OBJ) $(COMMON_OBJ) @LIBS@ @MYSQL_LIBS@ clean: - rm -f *.o ../../login-server_sql@EXEEXT@ + rm -rf *.o obj ../../login-server_sql@EXEEXT@ help: @echo "possible targets are 'login-server_sql' 'all' 'clean' 'help'" @@ -40,7 +45,15 @@ needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 -# DO NOT DELETE +obj: + -mkdir obj -login.o: login.c login.h $(COMMON_H) +obj/%.o: %.c $(LOGIN_H) $(COMMON_H) @CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< + +# missing common object files +../common/obj/%.o: + @$(MAKE) -C ../common sql + +../common/obj_sql/%.o: + @$(MAKE) -C ../common sql diff --git a/src/map/Makefile.in b/src/map/Makefile.in index 1be112d9a..31c0fc3f1 100644 --- a/src/map/Makefile.in +++ b/src/map/Makefile.in @@ -1,8 +1,33 @@ +COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \ + ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \ + ../common/obj/nullpo.o ../common/obj/malloc.o ../common/obj/showmsg.o \ + ../common/obj/utils.o ../common/obj/strlib.o ../common/obj/grfio.o \ + ../common/obj/mapindex.o ../common/obj/ers.o +COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h \ + ../common/db.h ../common/plugins.h ../common/lock.h \ + ../common/nullpo.h ../common/malloc.h ../common/showmsg.h \ + ../common/utils.h ../common/strlib.h ../common/grfio.h \ + ../common/mapindex.h ../common/ers.h + +COMMON_SQL_OBJ = ../common/obj_sql/sql.o +COMMON_SQL_H = ../common/sql.h + +MAP_OBJ = obj/map.o obj/chrif.o obj/clif.o obj/pc.o obj/status.o obj/npc.o \ + obj/npc_chat.o obj/chat.o obj/path.o obj/itemdb.o obj/mob.o obj/script.o \ + obj/storage.o obj/skill.o obj/atcommand.o obj/charcommand.o obj/battle.o \ + obj/intif.o obj/trade.o obj/party.o obj/vending.o obj/guild.o obj/pet.o \ + obj/log.o obj/mail.o obj/date.o obj/irc.o obj/unit.o obj/mercenary.o +MAP_H = map.h chrif.h clif.h pc.h status.h npc.h \ + chat.h itemdb.h mob.h script.h \ + storage.h skill.h atcommand.h charcommand.h battle.h \ + intif.h trade.h party.h vending.h guild.h pet.h \ + log.h mail.h date.h irc.h unit.h mercenary.h + HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) ALL_DEPENDS=txt sql - SQL_DEPENDS=obj_sql map-server_sql + SQL_DEPENDS=map-server_sql else ALL_TARGET=txt SQL_DEPENDS=needs_mysql @@ -15,18 +40,19 @@ else PCRE_CFLAGS= endif +@SET_MAKE@ ##################################################################### .PHONY : all txt sql clean help all: $(ALL_DEPENDS) -txt: obj_txt map-server +txt: map-server sql: $(SQL_DEPENDS) clean: - rm -rf *.o ../../map-server@EXEEXT@ ../../map-server_sql@EXEEXT@ obj_txt obj_sql + rm -rf *.o obj_txt obj_sql ../../map-server@EXEEXT@ ../../map-server_sql@EXEEXT@ help: ifeq ($(HAVE_MYSQL),yes) @@ -46,103 +72,30 @@ needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 +# object directories obj_txt: -mkdir obj_txt obj_sql: -mkdir obj_sql -COMMON_OBJ = ../common/obj/core.o ../common/obj/socket.o ../common/obj/timer.o \ - ../common/obj/db.o ../common/obj/plugins.o ../common/obj/lock.o \ - ../common/obj/nullpo.o ../common/obj/malloc.o ../common/obj/showmsg.o \ - ../common/obj/utils.o ../common/obj/strlib.o ../common/obj/grfio.o \ - ../common/obj/mapindex.o ../common/obj/ers.o - -COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h \ - ../common/db.h ../common/plugins.h ../common/lock.h \ - ../common/nullpo.h ../common/malloc.h ../common/showmsg.h \ - ../common/utils.h ../common/strlib.h ../common/grfio.h \ - ../common/mapindex.h ../common/ers.h - -COMMON_SQL_OBJ = $(COMMON_OBJ) ../common/obj_sql/sql.o - -COMMON_SQL_H = $(COMMON_H) ../common/sql.h - -MAP_OBJ = obj/map.o obj/chrif.o obj/clif.o obj/pc.o obj/status.o obj/npc.o \ - obj/npc_chat.o obj/chat.o obj/path.o obj/itemdb.o obj/mob.o obj/script.o \ - obj/storage.o obj/skill.o obj/atcommand.o obj/charcommand.o obj/battle.o \ - obj/intif.o obj/trade.o obj/party.o obj/vending.o obj/guild.o obj/pet.o \ - obj/log.o obj/mail.o obj/date.o obj/irc.o obj/unit.o obj/mercenary.o - -map-server: $(MAP_OBJ:obj/%=obj_txt/%) $(COMMON_OBJ) +# executables +map-server: obj_txt $(MAP_OBJ:obj/%=obj_txt/%) $(COMMON_OBJ) @CC@ @LDFLAGS@ -o ../../map-server@EXEEXT@ $(MAP_OBJ:obj/%=obj_txt/%) $(COMMON_OBJ) @LIBS@ @PCRE_LIBS@ -map-server_sql: $(MAP_OBJ:obj/%=obj_sql/%) $(COMMON_SQL_OBJ) - @CC@ @LDFLAGS@ -o ../../map-server_sql@EXEEXT@ $(MAP_OBJ:obj/%=obj_sql/%) $(COMMON_SQL_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ +map-server_sql: obj_sql $(MAP_OBJ:obj/%=obj_sql/%) $(COMMON_OBJ) $(COMMON_SQL_OBJ) + @CC@ @LDFLAGS@ -o ../../map-server_sql@EXEEXT@ $(MAP_OBJ:obj/%=obj_sql/%) $(COMMON_OBJ) $(COMMON_SQL_OBJ) @LIBS@ @PCRE_LIBS@ @MYSQL_LIBS@ -obj_txt/%.o: %.c +# map object files +obj_txt/%.o: %.c $(MAP_H) $(COMMON_H) @CC@ @CFLAGS@ $(PCRE_CFLAGS) -DTXT_ONLY @CPPFLAGS@ -c $(OUTPUT_OPTION) $< -obj_sql/%.o: %.c +obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(COMMON_SQL_H) @CC@ @CFLAGS@ $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $< -# DO NOT DELETE - -obj_txt/map.o: map.c map.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb.h storage.h party.h pet.h atcommand.h irc.h $(COMMON_H) -obj_txt/chrif.o: chrif.c map.h battle.h chrif.h clif.h intif.h pc.h npc.h $(COMMON_H) -obj_txt/clif.o: clif.c map.h chrif.h clif.h mob.h intif.h pc.h npc.h itemdb.h chat.h script.h storage.h party.h guild.h atcommand.h pet.h charcommand.h irc.h $(COMMON_H) -obj_txt/pc.o: pc.c map.h clif.h intif.h pc.h npc.h mob.h itemdb.h battle.h skill.h script.h party.h guild.h pet.h trade.h storage.h chat.h vending.h $(COMMON_H) -obj_txt/status.o: status.c pc.h map.h clif.h status.h mob.h itemdb.h battle.h skill.h script.h pet.h guild.h $(COMMON_H) -obj_txt/npc.o: npc.c map.h npc.h clif.h pc.h script.h mob.h itemdb.h battle.h $(COMMON_H) -obj_txt/npc_chat.o: npc_chat.c map.h npc.h clif.h pc.h script.h mob.h itemdb.h battle.h $(COMMON_H) -obj_txt/chat.o: chat.c map.h clif.h pc.h chat.h $(COMMON_H) -obj_txt/path.o: path.c map.h battle.h $(COMMON_H) -obj_txt/itemdb.o: itemdb.c map.h battle.h itemdb.h $(COMMON_H) -obj_txt/mob.o: mob.c map.h clif.h intif.h pc.h mob.h skill.h battle.h npc.h itemdb.h date.h irc.h $(COMMON_H) -obj_txt/script.o: script.c itemdb.h map.h pc.h mob.h clif.h intif.h npc.h script.h storage.h skill.h pet.h battle.h log.h irc.h $(COMMON_H) -obj_txt/storage.o: storage.c itemdb.h pc.h clif.h intif.h storage.h guild.h $(COMMON_H) -obj_txt/skill.o: skill.c skill.h map.h clif.h pc.h mob.h battle.h itemdb.h script.h date.h $(COMMON_H) -obj_txt/atcommand.o: atcommand.c atcommand.h itemdb.h pc.h map.h skill.h clif.h mob.h intif.h battle.h storage.h guild.h pet.h log.h $(COMMON_H) -obj_txt/battle.o: battle.c battle.h skill.h map.h mob.h pc.h pet.h guild.h $(COMMON_H) -obj_txt/intif.o: intif.c intif.h chrif.h clif.h party.h guild.h storage.h map.h battle.h pet.h $(COMMON_H) -obj_txt/trade.o: trade.c trade.h clif.h itemdb.h map.h pc.h npc.h $(COMMON_H) -obj_txt/party.o: party.c party.h clif.h intif.h pc.h map.h battle.h $(COMMON_H) -obj_txt/vending.o: vending.c vending.h clif.h itemdb.h map.h pc.h irc.h $(COMMON_H) -obj_txt/guild.o: guild.c guild.h storage.h battle.h clif.h intif.h pc.h npc.h map.h $(COMMON_H) -obj_txt/pet.o: pet.c pet.h map.h clif.h chrif.h intif.h pc.h itemdb.h battle.h mob.h npc.h script.h $(COMMON_H) -obj_txt/log.o: log.c log.h map.h $(COMMON_H) -obj_txt/charcommand.o: charcommand.c charcommand.h itemdb.h pc.h map.h skill.h clif.h mob.h intif.h battle.h storage.h guild.h pet.h log.h $(COMMON_H) -obj_txt/date.o: date.c date.h $(COMMON_H) -obj_txt/irc.o: irc.c irc.h map.h pc.h $(COMMON_H) -obj_txt/unit.o: unit.c unit.h $(COMMON_H) -obj_txt/mercenary.o: mercenary.c mercenary.h $(COMMON_H) - -obj_sql/map.o: map.c map.h chrif.h clif.h npc.h pc.h mob.h chat.h skill.h itemdb.h storage.h party.h pet.h atcommand.h log.h irc.h $(COMMON_SQL_H) -obj_sql/chrif.o: chrif.c map.h battle.h chrif.h clif.h intif.h pc.h npc.h $(COMMON_SQL_H) -obj_sql/clif.o: clif.c map.h chrif.h clif.h mob.h intif.h pc.h npc.h itemdb.h chat.h script.h storage.h party.h guild.h atcommand.h pet.h charcommand.h $(COMMON_SQL_H) -obj_sql/pc.o: pc.c map.h clif.h intif.h pc.h npc.h mob.h itemdb.h battle.h skill.h script.h party.h guild.h pet.h trade.h storage.h chat.h vending.h log.h $(COMMON_SQL_H) -obj_sql/status.o: status.c pc.h map.h clif.h status.h mob.h itemdb.h battle.h skill.h script.h pet.h guild.h $(COMMON_SQL_H) -obj_sql/npc.o: npc.c map.h npc.h clif.h pc.h script.h mob.h itemdb.h battle.h $(COMMON_SQL_H) -obj_sql/npc_chat.o: npc_chat.c map.h npc.h clif.h pc.h script.h mob.h itemdb.h battle.h $(COMMON_SQL_H) -obj_sql/chat.o: chat.c map.h clif.h pc.h chat.h $(COMMON_SQL_H) -obj_sql/path.o: path.c map.h battle.h $(COMMON_SQL_H) -obj_sql/itemdb.o: itemdb.c map.h battle.h itemdb.h $(COMMON_SQL_H) -obj_sql/mob.o: mob.c map.h clif.h intif.h pc.h mob.h skill.h battle.h npc.h itemdb.h log.h date.h irc.h $(COMMON_SQL_H) -obj_sql/script.o: script.c itemdb.h map.h pc.h mob.h clif.h intif.h npc.h script.h storage.h skill.h pet.h battle.h log.h irc.h $(COMMON_SQL_H) -obj_sql/storage.o: storage.c itemdb.h pc.h clif.h intif.h storage.h guild.h $(COMMON_SQL_H) -obj_sql/skill.o: skill.c skill.h map.h clif.h pc.h mob.h battle.h itemdb.h script.h log.h date.h $(COMMON_SQL_H) -obj_sql/atcommand.o: atcommand.c atcommand.h itemdb.h pc.h map.h skill.h clif.h mob.h intif.h battle.h storage.h guild.h pet.h log.h $(COMMON_SQL_H) -obj_sql/battle.o: battle.c battle.h skill.h map.h mob.h pc.h pet.h guild.h $(COMMON_SQL_H) -obj_sql/intif.o: intif.c intif.h chrif.h clif.h party.h guild.h storage.h map.h battle.h pet.h $(COMMON_SQL_H) -obj_sql/trade.o: trade.c trade.h clif.h itemdb.h map.h pc.h npc.h log.h $(COMMON_SQL_H) -obj_sql/party.o: party.c party.h clif.h intif.h pc.h map.h battle.h $(COMMON_SQL_H) -obj_sql/vending.o: vending.c vending.h clif.h itemdb.h map.h pc.h log.h irc.h $(COMMON_SQL_H) -obj_sql/guild.o: guild.c guild.h storage.h battle.h clif.h intif.h pc.h npc.h map.h irc.h $(COMMON_SQL_H) -obj_sql/pet.o: pet.c pet.h map.h clif.h chrif.h intif.h pc.h itemdb.h battle.h mob.h npc.h script.h $(COMMON_SQL_H) -obj_sql/mail.o: mail.c mail.h $(COMMON_SQL_H) -obj_sql/log.o: log.c log.h map.h $(COMMON_SQL_H) -obj_sql/charcommand.o: charcommand.c charcommand.h itemdb.h pc.h map.h skill.h clif.h mob.h intif.h battle.h storage.h guild.h pet.h log.h $(COMMON_SQL_H) -obj_sql/date.o: date.c date.h $(COMMON_SQL_H) -obj_sql/irc.o: irc.c irc.h map.h pc.h $(COMMON_SQL_H) -obj_sql/unit.o: unit.c unit.h $(COMMON_SQL_H) -obj_sql/mercenary.o: mercenary.c mercenary.h $(COMMON_SQL_H) +# missing common object files +../common/obj/%.o: + @$(MAKE) -C ../common txt + +../common/obj_sql/%.o: + @$(MAKE) -C ../common sql diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index 769771aca..00493a7c9 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -1,8 +1,13 @@ -@SET_MAKE@ + +COMMON_OBJ = ../common/obj/showmsg.o ../common/obj/utils.o ../common/obj/strlib.o \ + ../common/obj/minimalloc.o +COMMON_H = ../common/plugin.h ../common/cbasetypes.h \ + ../common/showmsg.h ../common/utils.h ../common/strlib.h \ + ../common/malloc.h PLUGINS = sample sig pid gui upnp console -COMMON_H = ../common/plugin.h ../common/cbasetypes.h +@SET_MAKE@ ##################################################################### .PHONY : all $(PLUGINS) clean help @@ -41,27 +46,18 @@ help: %@DLLEXT@: %.c @CC@ @CFLAGS@ @CPPFLAGS@ -shared -o ../../plugins/$@ $< -sig@DLLEXT@: sig.c - @$(MAKE) -C ../common txt - @CC@ @CFLAGS@ @CPPFLAGS@ -shared -o ../../plugins/$@ $< \ - ../common/obj/showmsg.o ../common/obj/utils.o ../common/obj/strlib.o \ - ../common/obj/minimalloc.o - gui@DLLEXT@: ../../plugins/gui.conf upnp@DLLEXT@: ../../plugins/upnp.conf +sig@DLLEXT@: sig.c $(COMMON_OBJ) + @CC@ @CFLAGS@ @CPPFLAGS@ -shared -o ../../plugins/$@ $< $(COMMON_OBJ) + ../../plugins/%.conf: %.txt cp -r $< $@ -../../plugins/gui.conf: gui.txt -../../plugins/upnp.conf: upnp.txt - -# DO NOT DELETE +# missing common object files +../common/obj/%.o: ../common/%.c $(COMMON_H) + @$(MAKE) -C ../common txt -sample@DLLEXT@: sample.c $(COMMON_H) -sig@DLLEXT@: sig.c $(COMMON_H) -pid@DLLEXT@: pid.c $(COMMON_H) -gui@DLLEXT@: gui.c $(COMMON_H) -#TODO where is upnp.c? [FlavioJS] -#upnp@DLLEXT@: upnp.c $(COMMON_H) -console@DLLEXT@: console.c $(COMMON_H) +../common/obj/mini%.o: ../common/%.c $(COMMON_H) + @$(MAKE) -C ../common txt diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in index 7c0d1e1ee..277ff4c68 100644 --- a/src/tool/Makefile.in +++ b/src/tool/Makefile.in @@ -1,3 +1,6 @@ + +@SET_MAKE@ + ##################################################################### .PHONY : all adduser convert mapcache clean help @@ -9,12 +12,12 @@ adduser: convert: @CC@ -o ../../tools/convert@EXEEXT@ convert.c -mapcache: - @CC@ -c -o grfio.o grfio.c - @CC@ -o ../../mapcache@EXEEXT@ mapcache.c grfio.o -lz +mapcache: obj + @CC@ -c -o obj/grfio.o grfio.c + @CC@ -o ../../mapcache@EXEEXT@ mapcache.c obj/grfio.o -lz clean: - rm -rf *.o ../../tools/adduser@EXEEXT@ ../../tools/convert@EXEEXT@ ../../mapcache@EXEEXT@ + rm -rf *.o obj ../../tools/adduser@EXEEXT@ ../../tools/convert@EXEEXT@ ../../mapcache@EXEEXT@ help: @echo "possible targets are 'adduser' 'convert' 'mapcache' 'all' 'clean' 'help'" @@ -26,3 +29,6 @@ help: @echo "'help' - outputs this message" ##################################################################### + +obj: + -mkdir obj diff --git a/src/txt-converter/Makefile.in b/src/txt-converter/Makefile.in index 31d593743..59d3a6641 100644 --- a/src/txt-converter/Makefile.in +++ b/src/txt-converter/Makefile.in @@ -1,25 +1,42 @@ -LOGIN_CONVERTER_OBJ = login-converter.o ../common/obj/minicore.o \ + +LOGIN_CONVERTER_OBJ = obj_login/login-converter.o ../common/obj/minicore.o \ ../common/obj/malloc.o ../common/obj/strlib.o ../common/obj/showmsg.o \ ../common/obj/utils.o ../common/obj/ers.o ../common/obj/db.o \ ../common/obj_sql/sql.o -CHAR_CONVERTER_OBJ = char-converter.o ../common/obj/minicore.o \ +LOGIN_CONVERTER_H = ../common/cbasetypes.h ../common/mmo.h ../common/core.h \ + ../common/malloc.h ../common/strlib.h ../common/showmsg.h \ + ../common/utils.h ../common/ers.h ../common/db.h \ + ../common/sql.h + +CHAR_CONVERTER_OBJ = obj_char/char-converter.o \ + obj_char/txt-char.o obj_char/txt-int_pet.o obj_char/txt-int_storage.o obj_char/txt-inter.o \ + obj_char/txt-int_party.o obj_char/txt-int_guild.o \ + obj_char/sql-char.o obj_char/sql-int_pet.o obj_char/sql-int_storage.o \ + obj_char/sql-inter.o obj_char/sql-int_party.o obj_char/sql-int_guild.o \ + ../common/obj/minicore.o \ ../common/obj/malloc.o ../common/obj/strlib.o ../common/obj/showmsg.o \ ../common/obj/utils.o ../common/obj/ers.o ../common/obj/mapindex.o \ - ../common/obj_sql/sql.o \ - obj_txt/char.o obj_txt/int_pet.o obj_txt/int_storage.o obj_txt/inter.o \ - obj_txt/int_party.o obj_txt/int_guild.o \ - obj_sql/char.o obj_sql/int_pet.o obj_sql/int_storage.o \ - obj_sql/inter.o obj_sql/int_party.o obj_sql/int_guild.o + ../common/obj_sql/sql.o +CHAR_CONVERTER_H = ../char/char.h ../char/int_pet.h ../char/int_storage.h ../char/inter.h \ + ../char/int_party.h ../char/int_guild.h \ + ../char_sql/char.h ../char_sql/int_pet.h ../char_sql/int_storage.h \ + ../char_sql/inter.h ../char_sql/int_party.h ../char_sql/int_guild.h \ + ../common/cbasetypes.h ../common/mmo.h ../common/core.h \ + ../common/malloc.h ../common/strlib.h ../common/showmsg.h \ + ../common/utils.h ../common/ers.h ../common/mapindex.h \ + ../common/sql.h HAVE_MYSQL=@HAVE_MYSQL@ ifeq ($(HAVE_MYSQL),yes) - LOGIN_CONVERTER_DEPENDS=$(LOGIN_CONVERTER_OBJ) - CHAR_CONVERTER_DEPENDS=obj $(CHAR_CONVERTER_OBJ) + LOGIN_CONVERTER_DEPENDS=obj_login $(LOGIN_CONVERTER_OBJ) + CHAR_CONVERTER_DEPENDS=obj_char $(CHAR_CONVERTER_OBJ) else LOGIN_CONVERTER_DEPENDS=needs_mysql CHAR_CONVERTER_DEPENDS=needs_mysql endif +@SET_MAKE@ + ##################################################################### .PHONY : all login-converter char-converter clean help @@ -32,7 +49,7 @@ char-converter: $(CHAR_CONVERTER_DEPENDS) @CC@ @LDFLAGS@ -o ../../tools/char-converter@EXEEXT@ $(CHAR_CONVERTER_OBJ) @LIBS@ @MYSQL_LIBS@ clean: - rm -rf *.o obj_txt obj_sql ../../tools/login-converter@EXEEXT@ ../../tools/char-converter@EXEEXT@ + rm -rf *.o obj_login obj_char ../../tools/login-converter@EXEEXT@ ../../tools/char-converter@EXEEXT@ help: @echo "possible targets are 'login-converter' 'char-converter' 'all' 'clean' 'help'" @@ -48,21 +65,24 @@ needs_mysql: @echo "MySQL not found or disabled by the configure script" @exit 1 -obj: - -mkdir obj_txt - -mkdir obj_sql +obj_login: + -mkdir obj_login +obj_char: + -mkdir obj_char -# DO NOT DELETE +obj_login/%.o: %.c $(LOGIN_CONVERTER_H) + @CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -DTXT_SQL_CONVERT -c $(OUTPUT_OPTION) $< -%.o: %.c +obj_char/%.o: %.c $(CHAR_CONVERTER_H) @CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -DTXT_SQL_CONVERT -c $(OUTPUT_OPTION) $< -obj_txt/%.o: ../char/%.c +obj_char/txt-%.o: ../char/%.c $(CHAR_CONVERTER_H) @CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -DTXT_SQL_CONVERT -c $(OUTPUT_OPTION) $< -obj_sql/%.o: ../char_sql/%.c +obj_char/sql-%.o: ../char_sql/%.c $(CHAR_CONVERTER_H) @CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -DTXT_SQL_CONVERT -c $(OUTPUT_OPTION) $< -char-converter.o: char-converter.c -login-converter.o: login-converter.c +# missing common object files +../common/obj/%.o: + @$(MAKE) -C ../common sql |