-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·58 lines (44 loc) · 1.12 KB
/
Makefile
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
#
# This uses bmake.
#
CC = clang
CFLAGS += -Wall -Wextra -Werror
OS != uname
UMASK = 77
.if ${OS} == Darwin
GROUP = _www
.if exists (/opt/pkg/include/mysql)
CFLAGS += -I/opt/pkg/include/mysql -L/opt/pkg/lib # pkgsrc
.else
CFLAGS += -I/usr/local/Cellar/mysql/5.7.21/include/mysql # homebrew
CFLAGS += -L/usr/local/Cellar/mysql/5.7.21/lib # homebrew
.endif
.elif ${OS} == FreeBSD
GROUP = www
CFLAGS += -I/usr/local/include/mysql -L/usr/local/lib/mysql
.elif ${OS} == Linux
GROUP = www-data
CC = cc
CFLAGS += -I/usr/include/mysql -L/usr/lib/x86_64-linux-gnu
.endif
LIBS = -lmysqlclient
.PHONY: all mysql galera
all: mysql-test
mysql: mysql-test
mysql-test! mysql-test.c
umask ${UMASK} && ${CC} ${CFLAGS} ${LIBS} -D__MYSQL__ -o $@ $<
chmod 600 $<
chmod 710 $@
-chgrp ${GROUP} $@
galera: galera-test
galera-test! galera-test.c
umask ${UMASK} && ${CC} ${CFLAGS} ${LIBS} -D__GALERA__ -o $@ $<
chmod 600 $<
chmod 710 $@
-chgrp ${GROUP} $@
.PHONY: clean clean-mysql clean-galera
clean: clean-mysql clean-galera
clean-mysql:
rm -f mysql-test
clean-galera:
rm -f galera-test