17
17
PKGCONFIGDIR = $(LIBDIR)/pkgconfig
18
18
endif
19
19
20
+ HIREDIS_VERSION := $(shell git submodule status deps/hiredis | grep -oP "\(v[0-9]+\.[0-9]+\.[0-9]-[0-9]* -[a-z0-9]* \) " || true)
20
21
LIBRDB_VERSION = $(shell grep -oP '(?<=LIBRDB_VERSION_STRING ") [0-9]+\.[0-9]+\.[0-9]+' ./src/lib/version.h)
21
22
export LIBRDB_VERSION
22
23
23
24
# ------------------------- ALL --------------------------------------
24
25
25
26
all :
26
- $(MAKE ) -C deps -f Makefile all
27
- $(MAKE ) -C src/lib -f Makefile all
28
- $(MAKE ) -C src/ext -f Makefile all
29
- $(MAKE ) -C src/cli -f Makefile all
30
- $(MAKE ) -C examples -f Makefile all
27
+ $(MAKE ) -C deps all
28
+ $(MAKE ) -C src/lib all
29
+ $(MAKE ) -C src/ext all
30
+ $(MAKE ) -C src/cli all
31
+ $(MAKE ) -C examples all
31
32
32
33
clean :
33
- $(MAKE ) -C deps -f Makefile clean
34
- $(MAKE ) -C src/lib -f Makefile clean
35
- $(MAKE ) -C src/ext -f Makefile clean
36
- $(MAKE ) -C src/cli -f Makefile clean
37
- $(MAKE ) -C examples -f Makefile clean
38
- $(MAKE ) -C test -f Makefile clean
34
+ $(MAKE ) -C deps clean
35
+ $(MAKE ) -C src/lib clean
36
+ $(MAKE ) -C src/ext clean
37
+ $(MAKE ) -C src/cli clean
38
+ $(MAKE ) -C examples clean
39
+ $(MAKE ) -C test clean
39
40
rm -f librdb.pc
40
41
rm -f librdb-ext.pc
41
42
@@ -50,9 +51,15 @@ debug:
50
51
OPTIMIZATION=" -O0" LIBRDB_DEBUG=1 $(MAKE )
51
52
52
53
# ------------------------- TEST --------------------------------------
53
-
54
- build_test : all
55
- $(MAKE ) -C test -f Makefile all
54
+ hiredis_submodule :
55
+ @if [ -z " $( HIREDIS_VERSION) " ]; then \
56
+ echo " Submodule 'hiredis' is not up to date. Run 'git submodule update --init' to update it." ; \
57
+ exit 1; \
58
+ fi
59
+
60
+ build_test : all hiredis_submodule
61
+ $(MAKE ) -C deps all
62
+ $(MAKE ) -C test all
56
63
57
64
test : build_test
58
65
./runtests
0 commit comments