1 # 2 # mman-win32 (mingw32) Makefile 3 # 4 include config.mak 5 6 ifeq ($(BUILD_STATIC),yes) 7 TARGETS+=libmman.a 8 INSTALL+=static-install 9 endif 10 ifeq ($(BUILD_MSVC),yes) 11 SHFLAGS+=-Wl,--output-def,libmman.def 12 INSTALL+=lib-install 13 endif 14 15 all: $(TARGETS) 16 17 mman.o: mman.c mman.h 18 $(CC) -o mman.o -c mman.c -Wall -O3 -fomit-frame-pointer 19 20 libmman.a: mman.o 21 $(AR) cru libmman.a mman.o 22 $(RANLIB) libmman.a 23 24 static-install: 25 mkdir -p $(DESTDIR)$(libdir) 26 cp libmman.a $(DESTDIR)$(libdir) 27 mkdir -p $(DESTDIR)$(incdir) 28 cp mman.h $(DESTDIR)$(incdir) 29 30 lib-install: 31 mkdir -p $(DESTDIR)$(libdir) 32 cp libmman.lib $(DESTDIR)$(libdir) 33 34 install: $(INSTALL) 35 36 test.exe: test.c mman.c mman.h 37 $(CC) -o test.exe test.c -L. -lmman 38 39 test: $(TARGETS) test.exe 40 test.exe 41 42 clean:: 43 rm -f mman.o libmman.a libmman.def libmman.lib test.exe *.dat 44 45 distclean: clean 46 rm -f config.mak 47 48 .PHONY: clean distclean install test 49