diff options
Diffstat (limited to 'Makefile2')
-rw-r--r-- | Makefile2 | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/Makefile2 b/Makefile2 new file mode 100644 index 0000000..4d11de8 --- /dev/null +++ b/Makefile2 | |||
@@ -0,0 +1,75 @@ | |||
1 | # | ||
2 | # dlfcn-win32 Makefile | ||
3 | # | ||
4 | include config.mak | ||
5 | |||
6 | ifeq ($(BUILD_SHARED),yes) | ||
7 | TARGETS += libdl.dll libdl.dll.a | ||
8 | SHFLAGS += -Wl,--out-implib,libdl.dll.a | ||
9 | INSTALL += shared-install | ||
10 | endif | ||
11 | ifeq ($(BUILD_STATIC),yes) | ||
12 | TARGETS += libdl.a | ||
13 | INSTALL += static-install | ||
14 | endif | ||
15 | ifeq ($(BUILD_MSVC),yes) | ||
16 | TARGETS += libdl.lib | ||
17 | SHFLAGS += -Wl,--output-def,libdl.def | ||
18 | INSTALL += lib-install | ||
19 | endif | ||
20 | |||
21 | LIB_OBJS := dlfcn.o | ||
22 | HEADERS := dlfcn.h | ||
23 | |||
24 | all: $(TARGETS) | ||
25 | |||
26 | %.o: %.c | ||
27 | $(CC) -o $@ -c $< -Wall -O3 -fomit-frame-pointer | ||
28 | |||
29 | libdl.a: $(LIB_OBJS) | ||
30 | $(AR) cru $@ $^ | ||
31 | $(RANLIB) libdl.a | ||
32 | |||
33 | libdl.dll libdl.dll.a: $(LIB_OBJS) | ||
34 | $(CC) $(SHFLAGS) -shared -o $@ $^ | ||
35 | |||
36 | libdl.lib: libdl.dll | ||
37 | $(LIBCMD) /machine:i386 /def:libdl.def | ||
38 | |||
39 | include-install: $(HEADERS) | ||
40 | mkdir -p $(DESTDIR)$(incdir) | ||
41 | install -m 644 $^ "$(DESTDIR)$(incdir)" | ||
42 | |||
43 | shared-install: include-install | ||
44 | mkdir -p $(DESTDIR)$(prefix)/bin | ||
45 | cp libdl.dll $(DESTDIR)$(prefix)/bin | ||
46 | $(STRIP) $(DESTDIR)$(prefix)/bin/libdl.dll | ||
47 | mkdir -p $(DESTDIR)$(libdir) | ||
48 | cp libdl.dll.a $(DESTDIR)$(libdir) | ||
49 | |||
50 | static-install: include-install | ||
51 | mkdir -p $(DESTDIR)$(libdir) | ||
52 | cp libdl.a $(DESTDIR)$(libdir) | ||
53 | |||
54 | lib-install: $(LIBS) | ||
55 | mkdir -p $(DESTDIR)$(libdir) | ||
56 | cp libdl.lib $(DESTDIR)$(libdir) | ||
57 | |||
58 | install: $(INSTALL) | ||
59 | |||
60 | test.exe: test.o $(TARGETS) | ||
61 | $(CC) -o $@ $< -L. -ldl | ||
62 | |||
63 | testdll.dll: testdll.c | ||
64 | $(CC) -shared -o $@ $^ | ||
65 | |||
66 | test: $(TARGETS) test.exe testdll.dll | ||
67 | $(WINE) test.exe | ||
68 | |||
69 | clean:: | ||
70 | rm -f dlfcn.o libdl.dll libdl.a libdl.def libdl.dll.a libdl.lib libdl.exp test.exe testdll.dll | ||
71 | |||
72 | distclean: clean | ||
73 | rm -f config.mak | ||
74 | |||
75 | .PHONY: clean distclean install test | ||