From 17222f8fdc6cb6f17efe391cbab0c357a5f93081 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Mon, 26 Nov 2007 22:36:30 +0000 Subject: * 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 --- src/char/Makefile.in | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'src/char') 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 -- cgit v1.2.3-70-g09d2