forked from rathena/rathena
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.in
118 lines (97 loc) · 3.44 KB
/
Makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@SET_MAKE@
HAVE_MYSQL=@HAVE_MYSQL@
OMAP=@OMAP@
ifeq ($(HAVE_MYSQL),yes)
ALL_DEPENDS=server tools
SERVER_DEPENDS=common login char map import
COMMON_DEPENDS=mt19937ar libconfig
LOGIN_DEPENDS=mt19937ar libconfig common
CHAR_DEPENDS=mt19937ar libconfig common
MAP_DEPENDS=mt19937ar libconfig common
else
ALL_DEPENDS=needs_mysql
SERVER_DEPENDS=needs_mysql
COMMON_DEPENDS=needs_mysql
LOGIN_DEPENDS=needs_mysql
CHAR_DEPENDS=needs_mysql
MAP_DEPENDS=needs_mysql
endif
#####################################################################
.PHONY: all server sql \
common \
mt19937ar \
login \
char \
map \
tools \
import \
clean help \
install uninstall bin-clean \
all: $(ALL_DEPENDS)
sql: $(SERVER_DEPENDS)
@echo "-!- 'make sql' is now deprecated. Please run 'make server' to continue. -!-"
server: $(SERVER_DEPENDS)
common: $(COMMON_DEPENDS)
@$(MAKE) -C src/common server
login: $(LOGIN_DEPENDS)
@$(MAKE) -C src/login server
char: $(CHAR_DEPENDS)
@$(MAKE) -C src/char
map: $(MAP_DEPENDS)
@$(MAKE) -C src/map server
mt19937ar:
@$(MAKE) -C 3rdparty/mt19937ar
libconfig:
@$(MAKE) -C 3rdparty/libconfig
tools:
@$(MAKE) -C src/tool
import:
# 1) create conf/import folder
# 2) add missing files
# 3) remove remaining .svn folder
@echo "building conf/import, conf/msg_conf/import and db/import folder..."
@if test ! -d conf/import ; then mkdir conf/import ; fi
@for f in $$(ls conf/import-tmpl) ; do if test ! -e conf/import/$$f ; then cp conf/import-tmpl/$$f conf/import ; fi ; done
@rm -rf conf/import/.svn
@if test ! -d conf/msg_conf/import ; then mkdir conf/msg_conf/import ; fi
@for f in $$(ls conf/msg_conf/import-tmpl) ; do if test ! -e conf/msg_conf/import/$$f ; then cp conf/msg_conf/import-tmpl/$$f conf/msg_conf/import ; fi ; done
@rm -rf conf/msg_conf/import/.svn
@if test ! -d db/import ; then mkdir db/import ; fi
@for f in $$(ls db/import-tmpl) ; do if test ! -e db/import/$$f ; then cp db/import-tmpl/$$f db/import ; fi ; done
@rm -rf db/import/.svn
clean:
@$(MAKE) -C src/common $@
@$(MAKE) -C 3rdparty/mt19937ar $@
@$(MAKE) -C 3rdparty/libconfig $@
@$(MAKE) -C src/login $@
@$(MAKE) -C src/char $@
@$(MAKE) -C src/map $@
@$(MAKE) -C src/tool $@
help:
@echo "most common targets are 'all' 'server' 'conf' 'clean' 'help'"
@echo "possible targets are:"
@echo "'common' - builds object files used for the three servers"
@echo "'mt19937ar' - builds object file of Mersenne Twister MT19937"
@echo "'libconfig' - builds object files of libconfig"
@echo "'login' - builds login server"
@echo "'char' - builds char server"
@echo "'map' - builds map server"
@echo "'tools' - builds all the tools in src/tools"
@echo "'import' - builds conf/import, conf/msg_conf/import and db/import folders from their template folders (x-tmpl)"
@echo "'all' - builds all the above targets"
@echo "'server' - builds servers (targets 'common' 'login' 'char' 'map' and 'import')"
@echo "'clean' - cleans builds and objects"
@echo "'install' - run installer wich setup rathena in /opt/"
@echo "'bin-clean' - delete binary installed"
@echo "'uninstall' - run uninstaller wich erase all install change"
@echo "'help' - outputs this message"
needs_mysql:
@echo "MySQL not found or disabled by the configure script"
@exit 1
install:
@sh ./install.sh
bin-clean:
@sh ./uninstall.sh bin
uninstall:
@sh ./uninstall.sh all
#####################################################################