aboutsummaryrefslogtreecommitdiff
path: root/deps/mman/Makefile
diff options
context:
space:
mode:
authorPaul Cercueil2020-01-30 20:18:58 -0300
committerPaul Cercueil2020-02-08 11:44:52 -0300
commit81c4586ff05b003fc65201c3e4504738996d6412 (patch)
tree82529cafd6b659e63c93765a6ca38c7c4a662607 /deps/mman/Makefile
parentd16005f843cd28ae90f091bd4e39a90b355e1d45 (diff)
downloadpcsx_rearmed-81c4586ff05b003fc65201c3e4504738996d6412.tar.gz
pcsx_rearmed-81c4586ff05b003fc65201c3e4504738996d6412.tar.bz2
pcsx_rearmed-81c4586ff05b003fc65201c3e4504738996d6412.zip
git subrepo clone (merge) https://github.com/witwall/mman-win32 deps/mman
subrepo: subdir: "deps/mman" merged: "2d1c576e" upstream: origin: "https://github.com/witwall/mman-win32" branch: "master" commit: "2d1c576e" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "a04d8c2"
Diffstat (limited to 'deps/mman/Makefile')
-rw-r--r--deps/mman/Makefile68
1 files changed, 68 insertions, 0 deletions
diff --git a/deps/mman/Makefile b/deps/mman/Makefile
new file mode 100644
index 0000000..f6af361
--- /dev/null
+++ b/deps/mman/Makefile
@@ -0,0 +1,68 @@
+#
+# mman-win32 (mingw32) Makefile
+#
+include config.mak
+
+CFLAGS=-Wall -O3 -fomit-frame-pointer
+
+ifeq ($(BUILD_STATIC),yes)
+ TARGETS+=libmman.a
+ INSTALL+=static-install
+endif
+
+ifeq ($(BUILD_SHARED),yes)
+ TARGETS+=libmman.dll
+ INSTALL+=shared-install
+ CFLAGS+=-DMMAN_LIBRARY_DLL -DMMAN_LIBRARY
+endif
+
+ifeq ($(BUILD_MSVC),yes)
+ SHFLAGS+=-Wl,--output-def,libmman.def
+ INSTALL+=lib-install
+endif
+
+all: $(TARGETS)
+
+mman.o: mman.c mman.h
+ $(CC) -o mman.o -c mman.c $(CFLAGS)
+
+libmman.a: mman.o
+ $(AR) cru libmman.a mman.o
+ $(RANLIB) libmman.a
+
+libmman.dll: mman.o
+ $(CC) -shared -o libmman.dll mman.o -Wl,--out-implib,libmman.dll.a
+
+header-install:
+ mkdir -p $(DESTDIR)$(incdir)
+ cp mman.h $(DESTDIR)$(incdir)
+
+static-install: header-install
+ mkdir -p $(DESTDIR)$(libdir)
+ cp libmman.a $(DESTDIR)$(libdir)
+
+shared-install: header-install
+ mkdir -p $(DESTDIR)$(libdir)
+ cp libmman.dll.a $(DESTDIR)$(libdir)
+ mkdir -p $(DESTDIR)$(bindir)
+ cp libmman.dll $(DESTDIR)$(bindir)
+
+lib-install:
+ mkdir -p $(DESTDIR)$(libdir)
+ cp libmman.lib $(DESTDIR)$(libdir)
+
+install: $(INSTALL)
+
+test.exe: test.c mman.c mman.h
+ $(CC) -o test.exe test.c -L. -lmman
+
+test: $(TARGETS) test.exe
+ test.exe
+
+clean::
+ rm -f mman.o libmman.a libmman.dll.a libmman.dll libmman.def libmman.lib test.exe *.dat
+
+distclean: clean
+ rm -f config.mak
+
+.PHONY: clean distclean install test