summaryrefslogblamecommitdiff
path: root/src/common/Makefile.in
blob: 89bb8a75ae1539e64399d841233eee821cdd3ced (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                                    


                           
                                     




                               

          




                                                                     
           



                   
                                           













                                                                     

    



                      
 
                         
 
                                     
 
 
                        
                                                                 
 
                            

                                                                            
                                            
                                                                      
 
 










                                                    
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=common common_sql
else
	ALL_TARGET=txt
	SQL_DEPENDS=needs_mysql
endif

@SET_MAKE@

#####################################################################
.PHONY : all txt sql clean help

all: $(ALL_DEPENDS)

txt: common

sql: $(SQL_DEPENDS)

clean:
	rm -rf *.o obj obj_sql svnversion.h

help:
	@echo "possible targets are 'txt' 'sql' 'all' 'clean' 'help'"
	@echo "'txt'    - builds object files used in txt servers"
	@echo "'sql'    - builds object files used in sql servers"
	@echo "'all'    - builds all above targets"
	@echo "'clean'  - cleans builds and objects"
	@echo "'help'   - outputs this message"

#####################################################################

needs_mysql:
	@echo "MySQL not found or disabled by the configure script"
	@exit 1

obj:
	-mkdir obj

obj_sql:
	-mkdir obj_sql

common: obj $(COMMON_OBJ)

common_sql: obj_sql $(COMMON_SQL_OBJ)


obj/%.o: %.c $(COMMON_H)
	@CC@ @CFLAGS@ @LDFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<

obj/mini%.o: %.c $(COMMON_H)
	@CC@ @CFLAGS@ -DMINICORE @LDFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<

obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H)
	@CC@ @CFLAGS@ @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<


HAVESVN = $(shell which svnversion)

ifeq ($(findstring /,$(HAVESVN)), /)
svnversion.h:
	@printf "#define SVNVERSION " > svnversion.h
	@svnversion . >> svnversion.h
	@printf "\n" >> svnversion.h
else
svnversion.h:
	@printf "\n" > svnversion.h
endif