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