summaryrefslogtreecommitdiff
path: root/src/Makefile.am
blob: 7488e03e7fab320f8319b547997c17479892af45 (plain) (blame)
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
AUTOMAKE_OPTIONS = subdir-objects

CHAR_SRC = echar/char.c \
    echar/char.h \
    echar/config.c \
    echar/config.h \
    echar/init.c \
    ecommon/config.c \
    ecommon/config.h \
    ecommon/init.c \
    ecommon/init.h \
    ecommon/serverversion.h

LOGIN_SRC = elogin/config.c \
    elogin/config.h \
    elogin/init.c \
    elogin/login.c \
    elogin/login.h \
    elogin/md5calc.c \
    elogin/md5calc.h \
    elogin/mt_rand.c \
    elogin/mt_rand.h \
    elogin/parse.c \
    elogin/parse.h \
    elogin/send.c \
    elogin/send.h \
    ecommon/config.c \
    ecommon/config.h \
    ecommon/init.c \
    ecommon/init.h \
    ecommon/serverversion.h

MAP_SRC = emap/atcommand.c \
    emap/atcommand.h \
    emap/battleground.c \
    emap/battleground.h \
    emap/clif.c \
    emap/clif.h \
    emap/craft.c \
    emap/craft.h \
    emap/craftconf.c \
    emap/craftconf.h \
    emap/horse.c \
    emap/horse.h \
    emap/init.c \
    emap/itemdb.c \
    emap/itemdb.h \
    emap/lang.c \
    emap/lang.h \
    emap/mail.c \
    emap/mail.h \
    emap/map.c \
    emap/map.h \
    emap/mob.c \
    emap/mob.h \
    emap/npc.c \
    emap/npc.h \
    emap/packets_struct.h \
    emap/parse.c \
    emap/parse.h \
    emap/pc.c \
    emap/pc.h \
    emap/permission.c \
    emap/permission.h \
    emap/quest.c \
    emap/quest.h \
    emap/script.c \
    emap/script.h \
    emap/scriptdefines.h \
    emap/send.c \
    emap/send.h \
    emap/skill.c \
    emap/skill.h \
    emap/status.c \
    emap/status.h \
    emap/unit.c \
    emap/unit.h \
    emap/const/craft.h \
    emap/data/bgd.c \
    emap/data/bgd.h \
    emap/data/itemd.c \
    emap/data/itemd.h \
    emap/data/mapd.c \
    emap/data/mapd.h \
    emap/data/mobd.c \
    emap/data/mobd.h \
    emap/data/npcd.c \
    emap/data/npcd.h \
    emap/data/session.c \
    emap/data/session.h \
    emap/struct/bgdext.h \
    emap/struct/craft.h \
    emap/struct/itemdext.h \
    emap/struct/mapdext.h \
    emap/struct/mobdext.h \
    emap/struct/npcdext.h \
    emap/struct/sessionext.h \
    emap/utils/formatutils.c \
    emap/utils/formatutils.h \
    ecommon/config.c \
    ecommon/config.h \
    ecommon/init.c \
    ecommon/init.h \
    ecommon/serverversion.h \
    ecommon/struct/strutildata.h \
    ecommon/utils/strutil.c \
    ecommon/utils/strutil.h

# need remove -Wno-unused

SHARED_CFLAGS = -pipe -ffast-math -fvisibility=hidden -rdynamic -std=gnu90 -Wall -Wextra -Wno-sign-compare -Wno-unused \
    -DPCRE_SUPPORT -I../../.. -I../../../../3rdparty -DPACKETVER=20150000
SHARED_LDFLAGS = -avoid-version -Wl,--no-undefined

if ENABLE_SANITIZE
#skip -fsanitize=alignment
SHARED_CFLAGS += -fsanitize=address \
-fsanitize=shift -fsanitize=integer-divide-by-zero -fsanitize=unreachable \
-fsanitize=vla-bound -fsanitize=null -fsanitize=return \
-fsanitize=signed-integer-overflow -fsanitize=bounds \
-fsanitize=object-size -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow \
-fsanitize=nonnull-attribute -fsanitize=returns-nonnull-attribute -fsanitize=bool \
-fsanitize=enum -fsanitize=vptr
SHARED_LDFLAGS += -lasan -lubsan -fsanitize=address \
-fsanitize=shift -fsanitize=integer-divide-by-zero -fsanitize=unreachable \
-fsanitize=vla-bound -fsanitize=null -fsanitize=return \
-fsanitize=signed-integer-overflow -fsanitize=bounds \
-fsanitize=object-size -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow \
-fsanitize=nonnull-attribute -fsanitize=returns-nonnull-attribute -fsanitize=bool \
-fsanitize=enum -fsanitize=vptr
endif

if ENABLE_STATIC
SHARED_CFLAGS += "-static-libgcc"
endif

if ENABLE_GPROF
SHARED_CFLAGS += "-pg"
endif

lib_LTLIBRARIES = libevol_char.la libevol_login.la libevol_map.la
libevol_char_la_SOURCES = ${CHAR_SRC}
libevol_char_la_LDFLAGS = ${SHARED_LDFLAGS}
libevol_char_la_CFLAGS = ${SHARED_CFLAGS}
libevol_login_la_SOURCES = ${LOGIN_SRC}
libevol_login_la_LDFLAGS = ${SHARED_LDFLAGS}
libevol_login_la_CFLAGS = ${SHARED_CFLAGS}
libevol_map_la_SOURCES = ${MAP_SRC}
libevol_map_la_LDFLAGS = ${SHARED_LDFLAGS}
libevol_map_la_CFLAGS = ${SHARED_CFLAGS} -Wno-strict-aliasing

all-local: libevol_char.la libevol_login.la libevol_map.la
	@cp .libs/*.so ../../../../plugins || cp .libs/*.so ../../../plugins || cp .libs/*.so ../../../server-code/plugins || cp .libs/*.so ../../server-code/plugins
	@cp .libs/*.so ../../../../../server-data/plugins || cp .libs/*.so ../../../../server-data/plugins || cp .libs/*.so ../../../server-data/plugins || cp .libs/*.so ../../server-data/plugins