OSDN Git Service

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