diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2020-12-11 14:32:52 +0100 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2021-01-17 12:51:39 +0100 |
commit | 0ea2334d46ca84c1a27bd086700f620a06401f94 (patch) | |
tree | 89e768d6c77492dee9cf6b520d562b8e35a7cee5 /Makefile | |
parent | 06ffb62a31f8986d1cda864bb8c3a8967d5a65fa (diff) | |
download | dlfcn-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-- | Makefile | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -6,14 +6,14 @@ CFLAGS = -Wall -O3 -fomit-frame-pointer -Isrc | |||
6 | 6 | ||
7 | ifeq ($(BUILD_SHARED),yes) | 7 | ifeq ($(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 |
12 | endif | 12 | endif |
13 | ifeq ($(BUILD_STATIC),yes) | 13 | ifeq ($(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 |
17 | endif | 17 | endif |
18 | ifeq ($(BUILD_MSVC),yes) | 18 | ifeq ($(BUILD_MSVC),yes) |
19 | TARGETS += libdl.lib | 19 | TARGETS += libdl.lib |
@@ -32,7 +32,7 @@ libdl.a: $(SOURCES) | |||
32 | $(RANLIB) $@ | 32 | $(RANLIB) $@ |
33 | 33 | ||
34 | libdl.dll: $(SOURCES) | 34 | libdl.dll: $(SOURCES) |
35 | $(CC) $(CFLAGS) $(SHFLAGS) -shared -o $@ $^ | 35 | $(CC) $(CFLAGS) $(SHFLAGS) -DDLFCN_WIN32_SHARED -shared -o $@ $^ |
36 | 36 | ||
37 | libdl.lib: libdl.dll | 37 | libdl.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) | |||
64 | test-static.exe: tests/test.c $(TARGETS) | 64 | test-static.exe: tests/test.c $(TARGETS) |
65 | $(CC) $(CFLAGS) -o $@ $< libdl.a | 65 | $(CC) $(CFLAGS) -o $@ $< libdl.a |
66 | 66 | ||
67 | test-dladdr.exe: tests/test-dladdr.c $(TARGETS) | ||
68 | $(CC) $(CFLAGS) -DDLFCN_WIN32_SHARED -o $@ $< libdl.dll.a | ||
69 | |||
70 | test-dladdr-static.exe: tests/test-dladdr.c $(TARGETS) | ||
71 | $(CC) $(CFLAGS) -o $@ $< libdl.a | ||
72 | |||
67 | testdll.dll: tests/testdll.c | 73 | testdll.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 | ||
86 | distclean: clean | 93 | distclean: clean |