From b5e4232de6a2b47f7cf355d5318c2f495e5b86a6 Mon Sep 17 00:00:00 2001 From: Moti Cohen Date: Mon, 9 Sep 2024 22:37:56 +0300 Subject: [PATCH] Makefile makes git submodule update if hiredis is missing --- Makefile | 27 +++++++++++++++------------ deps/Makefile | 8 ++++---- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 621b36c..8585174 100644 --- a/Makefile +++ b/Makefile @@ -22,20 +22,20 @@ export LIBRDB_VERSION # ------------------------- ALL -------------------------------------- -all: - $(MAKE) -C deps -f Makefile all - $(MAKE) -C src/lib -f Makefile all - $(MAKE) -C src/ext -f Makefile all - $(MAKE) -C src/cli -f Makefile all - $(MAKE) -C examples -f Makefile all +all: ./deps/hiredis/hiredis.h + $(MAKE) -C deps all + $(MAKE) -C src/lib all + $(MAKE) -C src/ext all + $(MAKE) -C src/cli all + $(MAKE) -C examples all clean: - $(MAKE) -C deps -f Makefile clean - $(MAKE) -C src/lib -f Makefile clean - $(MAKE) -C src/ext -f Makefile clean - $(MAKE) -C src/cli -f Makefile clean - $(MAKE) -C examples -f Makefile clean - $(MAKE) -C test -f Makefile clean + $(MAKE) -C deps clean + $(MAKE) -C src/lib clean + $(MAKE) -C src/ext clean + $(MAKE) -C src/cli clean + $(MAKE) -C examples clean + $(MAKE) -C test clean rm -f librdb.pc rm -f librdb-ext.pc @@ -44,6 +44,9 @@ distclean: clean example: all cd examples && export LD_LIBRARY_PATH=../lib && ./example1 +./deps/hiredis/hiredis.h: + git submodule update --init deps/hiredis + # ------------------------- DEBUG ------------------------------------- debug: diff --git a/deps/Makefile b/deps/Makefile index c41cd3f..566d522 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -1,10 +1,10 @@ all: - $(MAKE) -C redis -f Makefile all - $(MAKE) -C hiredis -f Makefile all + $(MAKE) -C redis all + $(MAKE) -C hiredis all clean: - $(MAKE) -C redis -f Makefile clean - $(MAKE) -C hiredis -f Makefile all + $(MAKE) -C redis clean + $(MAKE) -C hiredis all .PHONY: all clean \ No newline at end of file