Browse code

tls_wolfssl: make - use kamailio make infra vars

S-P Chan authored on 24/06/2022 07:58:14
Showing 1 changed files
... ...
@@ -9,17 +9,13 @@ auto_gen=
9 9
 NAME=tls_wolfssl.so
10 10
 
11 11
 LIBS += lib/lib/libwolfssl.a
12
-DEFS += -I./lib/include/
12
+INCLUDES += -I./lib/include/
13 13
 
14 14
 
15 15
 include ../../Makefile.modules
16
-SOURCES := $(shell ls *.c)
17
-OBJECTS = $(SOURCES:.c=.o)
18
-MOD_DIR := $(shell pwd)
16
+$(objs): lib/include/wolfssl/options.h
19 17
 
20
-$(OBJECTS): lib/lib/libwolfssl.a
21
-
22
-lib/lib/libwolfssl.a:
18
+lib/include/wolfssl/options.h lib/lib/libwolfssl.a:
23 19
 	@cd ./lib/wolfssl; \
24 20
 	if [ ! -f "configure" ]; then \
25 21
 		./autogen.sh; \
... ...
@@ -28,9 +24,8 @@ lib/lib/libwolfssl.a:
28 24
 		env -u DEFS -u CFLAGS -u LDFLAGS -u LIBS EXTRA_CFLAGS="-g -fPIC -Wno-error=array-bounds -Wno-error=stringop-overflow" ./configure \
29 25
 		--enable-all --enable-pkcs11 --enable-static --enable-aligndata=no \
30 26
 		--disable-shared --disable-examples \
31
-		--prefix=$(MOD_DIR)/lib \
32
-		--exec-prefix=$(MOD_DIR)/lib; \
33
-		sed -i s/-Werror// Makefile; \
27
+		--prefix=$(CURDIR)/lib \
28
+		--exec-prefix=$(CURDIR)/lib; \
34 29
 	fi;
35 30
 	@$(MAKE) -C ./lib/wolfssl install
36 31
 
... ...
@@ -38,7 +33,7 @@ $(NAME): lib/lib/libwolfssl.a
38 33
 
39 34
 clean-wolfssl:
40 35
 	@rm -rf ./lib/{bin,include,share,lib}; \
41
-	cd ./lib/wolfssl; make clean || /bin/true
36
+	(cd ./lib/wolfssl; make distclean) || /bin/true
42 37
 
43 38
 clean-module:
44 39
 	@rm -f *.o *.so
... ...
@@ -46,3 +41,6 @@ clean-module:
46 41
 clean-all: clean-wolfssl clean-module
47 42
 
48 43
 .PHONY: clean-wolfssl clean-module clean-all
44
+
45
+# debugging for dependency on lib/wolfssl
46
+$(warning sources = $(sources), auto_gen = $(auto_gen), objs = $(objs))