forked from redis/redis-rb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
36 lines (29 loc) · 976 Bytes
/
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
TEST_FILES := $(shell find ./test -name *_test.rb -type f)
REDIS_BRANCH ?= unstable
TMP := tmp
BUILD_DIR := ${TMP}/cache/redis-${REDIS_BRANCH}
TARBALL := ${TMP}/redis-${REDIS_BRANCH}.tar.gz
BINARY := ${BUILD_DIR}/src/redis-server
PID_PATH := ${BUILD_DIR}/redis.pid
SOCKET_PATH := ${BUILD_DIR}/redis.sock
PORT := 6381
test: ${TEST_FILES}
make start
env SOCKET_PATH=${SOCKET_PATH} \
bundle exec ruby -v -e 'ARGV.each { |test_file| require test_file }' ${TEST_FILES}
make stop
${TMP}:
mkdir $@
${BINARY}: ${TMP}
bin/build ${REDIS_BRANCH} ${TMP}
stop:
(test -f ${PID_PATH} && (kill $$(cat ${PID_PATH}) || true) && rm -f ${PID_PATH}) || true
start: ${BINARY}
${BINARY} \
--daemonize yes \
--pidfile ${PID_PATH} \
--port ${PORT} \
--unixsocket ${SOCKET_PATH}
clean:
(test -d ${BUILD_DIR} && cd ${BUILD_DIR}/src && make clean distclean) || true
.PHONY: test start stop