Skip to content

Commit b5e4232

Browse files
committed
Makefile makes git submodule update if hiredis is missing
1 parent f953088 commit b5e4232

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

Makefile

+15-12
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ export LIBRDB_VERSION
2222

2323
# ------------------------- ALL --------------------------------------
2424

25-
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
25+
all: ./deps/hiredis/hiredis.h
26+
$(MAKE) -C deps all
27+
$(MAKE) -C src/lib all
28+
$(MAKE) -C src/ext all
29+
$(MAKE) -C src/cli all
30+
$(MAKE) -C examples all
3131

3232
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
33+
$(MAKE) -C deps clean
34+
$(MAKE) -C src/lib clean
35+
$(MAKE) -C src/ext clean
36+
$(MAKE) -C src/cli clean
37+
$(MAKE) -C examples clean
38+
$(MAKE) -C test clean
3939
rm -f librdb.pc
4040
rm -f librdb-ext.pc
4141

@@ -44,6 +44,9 @@ distclean: clean
4444
example: all
4545
cd examples && export LD_LIBRARY_PATH=../lib && ./example1
4646

47+
./deps/hiredis/hiredis.h:
48+
git submodule update --init deps/hiredis
49+
4750
# ------------------------- DEBUG -------------------------------------
4851

4952
debug:

deps/Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
all:
2-
$(MAKE) -C redis -f Makefile all
3-
$(MAKE) -C hiredis -f Makefile all
2+
$(MAKE) -C redis all
3+
$(MAKE) -C hiredis all
44

55
clean:
6-
$(MAKE) -C redis -f Makefile clean
7-
$(MAKE) -C hiredis -f Makefile all
6+
$(MAKE) -C redis clean
7+
$(MAKE) -C hiredis all
88

99

1010
.PHONY: all clean

0 commit comments

Comments
 (0)