From a7c247e87d1b79c6c74b89aaab32864e57f685d5 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 4 Nov 2021 12:45:19 +0100 Subject: New test app for dynamic loading of libmbed* with dlopen Signed-off-by: Gilles Peskine --- programs/Makefile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'programs/Makefile') diff --git a/programs/Makefile b/programs/Makefile index 7f9d11e..2c25983 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -118,6 +118,10 @@ ifdef PTHREAD APPS += ssl/ssl_pthread_server endif +ifdef SHARED +APPS += test/dlopen +endif + ifdef TEST_CPP APPS += test/cpp_dummy_build endif @@ -344,6 +348,15 @@ test/cpp_dummy_build$(EXEXT): test/cpp_dummy_build.cpp $(DEP) echo " CXX test/cpp_dummy_build.cpp" $(CXX) $(LOCAL_CXXFLAGS) $(CXXFLAGS) test/cpp_dummy_build.cpp $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ +ifdef SHARED +test/dlopen$(EXEXT): test/dlopen.c $(DEP) + echo " CC test/dlopen.c" +# Do not link any test objects (that would bring in a static dependency on +# libmbedcrypto at least). Do not link with libmbed* (that would defeat the +# purpose of testing dynamic loading). + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) test/dlopen.c $(LDFLAGS) -ldl -o $@ +endif + test/query_config.o: test/query_config.c test/query_config.h $(DEP) echo " CC test/query_config.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -c test/query_config.c -o $@ @@ -405,6 +418,7 @@ ifndef WINDOWS rm -f $(EXES) -rm -f ssl/ssl_pthread_server$(EXEXT) -rm -f test/cpp_dummy_build.cpp test/cpp_dummy_build$(EXEXT) + -rm -f test/dlopen$(EXEXT) else if exist *.o del /Q /F *.o if exist *.exe del /Q /F *.exe -- cgit v1.1