| OLD | NEW |
| (Empty) | |
| 1 # |
| 2 # dlfcn-win32 Makefile |
| 3 # |
| 4 include config.mak |
| 5 |
| 6 ifeq ($(BUILD_SHARED),yes) |
| 7 TARGETS+=libdl.dll |
| 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 SHFLAGS+=-Wl,--output-def,libdl.def |
| 17 INSTALL+=lib-install |
| 18 endif |
| 19 |
| 20 all: $(TARGETS) |
| 21 |
| 22 dlfcn.o: |
| 23 $(CC) -o dlfcn.o -c dlfcn.c -Wall -O3 -fomit-frame-pointer |
| 24 |
| 25 libdl.a: dlfcn.o |
| 26 $(AR) cru libdl.a dlfcn.o |
| 27 $(RANLIB) libdl.a |
| 28 |
| 29 libdl.dll: dlfcn.o |
| 30 $(CC) $(SHFLAGS) -shared -o libdl.dll dlfcn.o |
| 31 $(LIBCMD) /machine:i386 /def:libdl.def |
| 32 |
| 33 shared-install: |
| 34 mkdir -p $(DESTDIR)$(prefix)/bin |
| 35 cp libdl.dll $(DESTDIR)$(prefix)/bin |
| 36 $(STRIP) $(DESTDIR)$(prefix)/bin/libdl.dll |
| 37 mkdir -p $(DESTDIR)$(libdir) |
| 38 cp libdl.dll.a $(DESTDIR)$(libdir) |
| 39 mkdir -p $(DESTDIR)$(incdir) |
| 40 cp dlfcn.h $(DESTDIR)$(incdir) |
| 41 |
| 42 static-install: |
| 43 mkdir -p $(DESTDIR)$(libdir) |
| 44 cp libdl.a $(DESTDIR)$(libdir) |
| 45 mkdir -p $(DESTDIR)$(incdir) |
| 46 cp dlfcn.h $(DESTDIR)$(incdir) |
| 47 |
| 48 lib-install: |
| 49 mkdir -p $(DESTDIR)$(libdir) |
| 50 cp libdl.lib $(DESTDIR)$(libdir) |
| 51 |
| 52 install: $(INSTALL) |
| 53 |
| 54 test.exe: |
| 55 $(CC) -o test.exe test.c -L. -ldl |
| 56 |
| 57 testdll.dll: |
| 58 $(CC) -shared -o testdll.dll testdll.c |
| 59 |
| 60 test: $(TARGETS) test.exe testdll.dll |
| 61 test.exe |
| 62 |
| 63 clean:: |
| 64 rm -f dlfcn.o libdl.dll libdl.a libdl.def libdl.dll.a libdl.lib libdl.ex
p test.exe testdll.dll |
| 65 |
| 66 distclean: clean |
| 67 rm -f config.mak |
| 68 |
| 69 .PHONY: clean distclean install test |
| OLD | NEW |