aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2020-12-11 14:32:52 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2021-01-17 12:51:39 +0100
commit0ea2334d46ca84c1a27bd086700f620a06401f94 (patch)
tree89e768d6c77492dee9cf6b520d562b8e35a7cee5 /Makefile
parent06ffb62a31f8986d1cda864bb8c3a8967d5a65fa (diff)
downloaddlfcn-win32-0ea2334d46ca84c1a27bd086700f620a06401f94.tar.gz
dlfcn-win32-0ea2334d46ca84c1a27bd086700f620a06401f94.tar.bz2
dlfcn-win32-0ea2334d46ca84c1a27bd086700f620a06401f94.zip
Add function dladdr() and associated test application test-dladdr
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 11 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index ab7279b..944358f 100644
--- a/Makefile
+++ b/Makefile
@@ -6,14 +6,14 @@ CFLAGS = -Wall -O3 -fomit-frame-pointer -Isrc
6 6
7ifeq ($(BUILD_SHARED),yes) 7ifeq ($(BUILD_SHARED),yes)
8 TARGETS += libdl.dll 8 TARGETS += libdl.dll
9 SHFLAGS += -Wl,--out-implib,libdl.dll.a -DSHARED 9 SHFLAGS += -Wl,--out-implib,libdl.dll.a
10 INSTALL += shared-install 10 INSTALL += shared-install
11 TESTS += test.exe 11 TESTS += test.exe test-dladdr.exe
12endif 12endif
13ifeq ($(BUILD_STATIC),yes) 13ifeq ($(BUILD_STATIC),yes)
14 TARGETS += libdl.a 14 TARGETS += libdl.a
15 INSTALL += static-install 15 INSTALL += static-install
16 TESTS += test-static.exe 16 TESTS += test-static.exe test-dladdr-static.exe
17endif 17endif
18ifeq ($(BUILD_MSVC),yes) 18ifeq ($(BUILD_MSVC),yes)
19 TARGETS += libdl.lib 19 TARGETS += libdl.lib
@@ -32,7 +32,7 @@ libdl.a: $(SOURCES)
32 $(RANLIB) $@ 32 $(RANLIB) $@
33 33
34libdl.dll: $(SOURCES) 34libdl.dll: $(SOURCES)
35 $(CC) $(CFLAGS) $(SHFLAGS) -shared -o $@ $^ 35 $(CC) $(CFLAGS) $(SHFLAGS) -DDLFCN_WIN32_SHARED -shared -o $@ $^
36 36
37libdl.lib: libdl.dll 37libdl.lib: libdl.dll
38 $(LIBCMD) /machine:i386 /def:libdl.def 38 $(LIBCMD) /machine:i386 /def:libdl.def
@@ -64,6 +64,12 @@ test.exe: tests/test.c $(TARGETS)
64test-static.exe: tests/test.c $(TARGETS) 64test-static.exe: tests/test.c $(TARGETS)
65 $(CC) $(CFLAGS) -o $@ $< libdl.a 65 $(CC) $(CFLAGS) -o $@ $< libdl.a
66 66
67test-dladdr.exe: tests/test-dladdr.c $(TARGETS)
68 $(CC) $(CFLAGS) -DDLFCN_WIN32_SHARED -o $@ $< libdl.dll.a
69
70test-dladdr-static.exe: tests/test-dladdr.c $(TARGETS)
71 $(CC) $(CFLAGS) -o $@ $< libdl.a
72
67testdll.dll: tests/testdll.c 73testdll.dll: tests/testdll.c
68 $(CC) $(CFLAGS) -shared -o $@ $^ 74 $(CC) $(CFLAGS) -shared -o $@ $^
69 75
@@ -81,6 +87,7 @@ clean::
81 src/dlfcn.o \ 87 src/dlfcn.o \
82 libdl.dll libdl.a libdl.def libdl.dll.a libdl.lib libdl.exp \ 88 libdl.dll libdl.a libdl.def libdl.dll.a libdl.lib libdl.exp \
83 tmptest.c tmptest.dll \ 89 tmptest.c tmptest.dll \
90 test-dladdr.exe test-dladdr-static.exe \
84 test.exe test-static.exe testdll.dll testdll2.dll testdll3.dll 91 test.exe test-static.exe testdll.dll testdll2.dll testdll3.dll
85 92
86distclean: clean 93distclean: clean