-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (36 loc) · 1.01 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
.PHONY: all run
module_name=libredical.so
# override
OSNICK?=$(shell /bin/cat /etc/os-release|/bin/grep -Po '(?<=PRETTY_NAME=")(.*)(?=")'|/bin/tr ' ' '_'|/bin/tr '[:upper:]' '[:lower:]')
ARCH?=x86_64
OS?=Linux
REDISVERSION?=7.2.4
VERSION?=99.99.99
REDIS_SERVER_PATH?=redis/redis-server
TARGETBASEDIR=target
ifdef RELEASE
RELEASEFLAGS=--release
TARGETDIR=${TARGETBASEDIR}/release
else
TARGETDIR=${TARGETBASEDIR}/debug
endif
module_dest=${TARGETDIR}/${module_name}
all::
cargo build ${RELEASEFLAGS}
run: all
redis-server --loadmodule ${module_dest}
test: all
cargo test --all
clean:
rm -rf ${module_dest} dump.rdb
distclean:
rm -rf ${TARGETBASEDIR} dump.rdb redis *.zip
deps:
pip3 install ramp-packer
curl -s https://redismodules.s3.amazonaws.com/redis-stack/dependencies/redis-${REDISVERSION}-${OS}-${OSNICK}-${ARCH}.tgz --output redis.tgz
tar -xpf redis.tgz
rm *.tgz
mv redis* redis
chmod a+x redis/*
pack:
ramp pack -m ramp.yml target/release/libredical.so -o libredical.Linux-${OSNICK}-${ARCH}.${VERSION}.zip