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/login_sql/Makefile.in | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/login_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 -- cgit v1.2.3-70-g09d2