-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
34 lines (26 loc) · 1.09 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
CC=gcc
CPP=g++
SHELL=bash
SQLITE_BUILD=../sqlite/build
INCLUDES=-I${SQLITE_BUILD} -I/usr/include/hiredis
LDFLAGS=-L${SQLITE_BUILD}/.libs
LDLIBS=-l:libsqlite3.a -ldl -lpthread -lhiredis
#CPPFLAGS=-Wall -O2 -ggdb ${INCLUDES}
CPPFLAGS=-Wall -ggdb ${INCLUDES}
default: sqlitedis redisvfs.so static-sqlitedis static-redisvfs.o
clean:
rm -f redisvfs.so sqlitedis static-sqlitedis static-sqldis.o
# sqlite extension module
redisvfs.so: redisvfs.c redisvfs.h
gcc ${CPPFLAGS} ${INCLUDES} -fPIC -shared redisvfs.c -l hiredis -o redisvfs.so
# test tool with statically linked redisvfs
static-sqlitedis: CFLAGS=-Wall -ggdb -DSTATIC_REDISVFS
static-sqlitedis: CPPFLAGS=${CFLAGS}
static-sqlitedis: sqlitedis.cc redisvfs.c redisvfs.h
gcc ${CFLAGS} ${INCLUDES} -o static-redisvfs.o -c redisvfs.c
g++ $(CPPFLAGS) $(INCLUDES) $(LDFLAGS) -o static-sqlitedis static-redisvfs.o sqlitedis.cc $(LDLIBS)
# Link vfsstat module
# (of limited use as it uses the VFS it's shadowing to write it's log)
vfsstat.so: SQLITE_SRC=../sqlite
vfsstat.so:
gcc ${CPPFLAGS} ${INCLUDES} -fPIC -shared ${SQLITE_SRC}/ext/misc/vfsstat.c -o vfsstat.so