-
Notifications
You must be signed in to change notification settings - Fork 1
/
0.6.0-makefile.patch
43 lines (37 loc) · 1007 Bytes
/
0.6.0-makefile.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# from https://github.com/rasa/git-crypt/commit/b155e882ec4127336df8f6da32d3961c6f1fef85
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,19 @@ PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
+SYS := $(shell gcc -dumpmachine)
+CYGWIN := $(findstring cygwin,$(SYS))
+MINGW32 := $(findstring mingw32,$(SYS))
+
+# https://stackoverflow.com/a/21749803/1432614
+ifdef CYGWIN
+ CXXFLAGS += -U__STRICT_ANSI__
+endif
+
+ifdef MINGW32
+ CXXFLAGS += -static
+endif
+
ENABLE_MAN ?= no
DOCBOOK_XSL ?= http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
@@ -27,6 +40,10 @@ OBJFILES = \
OBJFILES += crypto-openssl-10.o crypto-openssl-11.o
LDFLAGS += -lcrypto
+ifdef MINGW32
+ LDFLAGS += -lgdi32
+endif
+
XSLTPROC ?= xsltproc
DOCBOOK_FLAGS += --param man.output.in.separate.dir 1 \
--stringparam man.output.base.dir man/ \
@@ -68,6 +68,7 @@
clean-bin:
rm -f $(OBJFILES) git-crypt
+ rm -f $(OBJFILES) git-crypt.exe
clean-man:
rm -f man/man1/git-crypt.1