summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorsundb <sundbcn@gmail.com>2021-12-16 17:42:58 +0800
committerGitHub <noreply@github.com>2021-12-16 17:42:58 +0800
commitc6657ef65bacc989a5ae1462062d41547fa84765 (patch)
tree859dfe063b7755339425c9ebbab3bdc55b4bf95f /Makefile
parentfd033e983acb69f7814255e7836f255411e17007 (diff)
parentda5a4ff3622e8744b772a76f6ce580dc9134fb38 (diff)
Merge branch 'redis:master' into master
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 15 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index a8d37a2..f30c2ac 100644
--- a/Makefile
+++ b/Makefile
@@ -73,11 +73,19 @@ USE_SSL?=0
# This is required for test.c only
ifeq ($(USE_SSL),1)
- CFLAGS+=-DHIREDIS_TEST_SSL
+ export CFLAGS+=-DHIREDIS_TEST_SSL
+endif
+ifeq ($(TEST_ASYNC),1)
+ export CFLAGS+=-DHIREDIS_TEST_ASYNC
endif
ifeq ($(uname_S),Linux)
- SSL_LDFLAGS=-lssl -lcrypto
+ ifdef OPENSSL_PREFIX
+ CFLAGS+=-I$(OPENSSL_PREFIX)/include
+ SSL_LDFLAGS+=-L$(OPENSSL_PREFIX)/lib -lssl -lcrypto
+ else
+ SSL_LDFLAGS=-lssl -lcrypto
+ endif
else
OPENSSL_PREFIX?=/usr/local/opt/openssl
CFLAGS+=-I$(OPENSSL_PREFIX)/include
@@ -206,6 +214,9 @@ ifeq ($(USE_SSL),1)
TEST_LIBS += $(SSL_STLIBNAME)
TEST_LDFLAGS = $(SSL_LDFLAGS) -lssl -lcrypto -lpthread
endif
+ifeq ($(TEST_ASYNC),1)
+ TEST_LDFLAGS += -levent
+endif
hiredis-test: test.o $(TEST_LIBS)
$(CC) -o $@ $(REAL_CFLAGS) -I. $^ $(REAL_LDFLAGS) $(TEST_LDFLAGS)
@@ -294,12 +305,12 @@ gprof:
$(MAKE) CFLAGS="-pg" LDFLAGS="-pg"
gcov:
- $(MAKE) CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="-fprofile-arcs"
+ $(MAKE) CFLAGS+="-fprofile-arcs -ftest-coverage" LDFLAGS="-fprofile-arcs"
coverage: gcov
make check
mkdir -p tmp/lcov
- lcov -d . -c -o tmp/lcov/hiredis.info
+ lcov -d . -c --exclude '/usr*' -o tmp/lcov/hiredis.info
genhtml --legend -o tmp/lcov/report tmp/lcov/hiredis.info
noopt: