2 # mman-win32 (mingw32) Makefile
6 CFLAGS=-Wall -O3 -fomit-frame-pointer
8 ifeq ($(BUILD_STATIC),yes)
10 INSTALL+=static-install
13 ifeq ($(BUILD_SHARED),yes)
15 INSTALL+=shared-install
16 CFLAGS+=-DMMAN_LIBRARY_DLL -DMMAN_LIBRARY
19 ifeq ($(BUILD_MSVC),yes)
20 SHFLAGS+=-Wl,--output-def,libmman.def
27 $(CC) -o mman.o -c mman.c $(CFLAGS)
30 $(AR) cru libmman.a mman.o
34 $(CC) -shared -o libmman.dll mman.o -Wl,--out-implib,libmman.dll.a
37 mkdir -p $(DESTDIR)$(incdir)
38 cp mman.h $(DESTDIR)$(incdir)
40 static-install: header-install
41 mkdir -p $(DESTDIR)$(libdir)
42 cp libmman.a $(DESTDIR)$(libdir)
44 shared-install: header-install
45 mkdir -p $(DESTDIR)$(libdir)
46 cp libmman.dll.a $(DESTDIR)$(libdir)
47 mkdir -p $(DESTDIR)$(bindir)
48 cp libmman.dll $(DESTDIR)$(bindir)
51 mkdir -p $(DESTDIR)$(libdir)
52 cp libmman.lib $(DESTDIR)$(libdir)
56 test.exe: test.c mman.c mman.h
57 $(CC) -o test.exe test.c -L. -lmman
59 test: $(TARGETS) test.exe
63 rm -f mman.o libmman.a libmman.dll.a libmman.dll libmman.def libmman.lib test.exe *.dat
68 .PHONY: clean distclean install test