forked from RedisJSON/RedisJSON
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
122 lines (83 loc) · 2.67 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
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
define HELP
make build
DEBUG=1 # build debug variant
make clean # remove binary files
ALL=1 # remove binary directories
make all # build all libraries and packages
make pytest # run tests
TEST=name # run test matching 'name'
TEST_ARGS="..." # RLTest arguments
GEN=0|1 # run general tests on a standalone Redis topology
AOF=0|1 # run AOF persistency tests on a standalone Redis topology
SLAVES=0|1 # run replication tests on standalone Redis topology
CLUSTER=0|1 # run general tests on a OSS Redis Cluster topology
VALGRIND|VD=1 # run specified tests with Valgrind
make package # build package (RAMP file)
make docker
make docker_push
make builddocs
make localdocs
make deploydocs
endef
#----------------------------------------------------------------------------------------------
MODULE_NAME=rejson.so
ifeq ($(DEBUG),1)
TARGET_DIR=target/debug
else
CARGO_FLAGS += --release
TARGET_DIR=target/release
endif
TARGET=$(TARGET_DIR)/$(MODULE_NAME)
#----------------------------------------------------------------------------------------------
all: build
#----------------------------------------------------------------------------------------------
lint:
cargo fmt -- --check
#----------------------------------------------------------------------------------------------
build:
cargo build --all --all-targets $(CARGO_FLAGS)
cp $(TARGET_DIR)/librejson.so $(TARGET)
clean:
ifneq ($(ALL),1)
cargo clean
else
rm -rf target
endif
#----------------------------------------------------------------------------------------------
test: pytest
pytest:
MODULE=$(abspath $(TARGET)) ./tests/pytest/tests.sh
cargo_test:
cargo test --features test --all
.PHONY: pytest cargo_test
#----------------------------------------------------------------------------------------------
package:
$(MAKE) -C ./src package
.PHONY: package
#----------------------------------------------------------------------------------------------
docker:
docker build --pull -t rejson:latest .
docker_push:
docker push redislabs/rejson:latest
.PHONY: docker docker_push
#----------------------------------------------------------------------------------------------
builddocs:
mkdocs build
localdocs: builddocs
mkdocs serve
deploydocs: builddocs
mkdocs gh-deploy
.PHONY: builddocs localdocs deploydocs
#----------------------------------------------------------------------------------------------
ifneq ($(HELP),)
ifneq ($(filter help,$(MAKECMDGOALS)),)
HELPFILE:=$(shell mktemp /tmp/make.help.XXXX)
endif
endif
help:
$(file >$(HELPFILE),$(HELP))
@echo
@cat $(HELPFILE)
@echo
@-rm -f $(HELPFILE)
.PHONY: help