summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--src/cc-compat.h6
-rw-r--r--src/common.h2
-rw-r--r--tests/Makefile7
4 files changed, 18 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index a0a6eea81..b6d1b7d59 100644
--- a/Makefile
+++ b/Makefile
@@ -30,6 +30,12 @@ ifneq (,$(findstring CYGWIN,$(uname_S)))
NO_VISIBILITY=YesPlease
endif
+ifneq (,$(findstring MINGW,$(uname_S)))
+ OS=win32
+ NO_VISIBILITY=YesPlease
+ SPARSE_FLAGS=-Wno-one-bit-signed-bitfield
+endif
+
SRC_C = $(wildcard src/*.c)
OS_SRC = $(wildcard src/$(OS)/*.c)
SRC_C += $(OS_SRC)
@@ -68,7 +74,7 @@ all:: $(GIT_LIB)
clean:
rm -f $(GIT_LIB)
rm -f libgit2.pc
- rm -f src/*.o src/sha1/*.o src/unix/*.o
+ rm -f src/*.o src/sha1/*.o src/unix/*.o src/win32/*.o
rm -rf apidocs
rm -f *~ src/*~ src/git/*~ src/sha1/*~ src/unix/*~ src/win32/*~
@$(MAKE) -C tests -s --no-print-directory clean
diff --git a/src/cc-compat.h b/src/cc-compat.h
index a256495f5..488de7f11 100644
--- a/src/cc-compat.h
+++ b/src/cc-compat.h
@@ -40,10 +40,10 @@
#endif
/* Define the printf format specifer to use for size_t output */
-#if !defined(_MSC_VER)
-# define PRIuZ "zu"
-#else
+#if defined(_MSC_VER) || defined(__MINGW32__)
# define PRIuZ "Iu"
+#else
+# define PRIuZ "zu"
#endif
/* Micosoft Visual C/C++ */
diff --git a/src/common.h b/src/common.h
index 5cb9d1b56..35df53402 100644
--- a/src/common.h
+++ b/src/common.h
@@ -4,7 +4,7 @@
/** Force 64 bit off_t size on POSIX. */
#define _FILE_OFFSET_BITS 64
-#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__)
+#if defined(_WIN32) && !defined(__CYGWIN__)
#define GIT_WIN32 1
#endif
diff --git a/tests/Makefile b/tests/Makefile
index 2ad730b25..8fac94df3 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -15,6 +15,13 @@ CRYPTO_LIB = -lcrypto
EXTRA_LIBS =
+# Platform specific tweaks
+
+ifneq (,$(findstring MINGW,$(uname_S)))
+ OS=win32
+ EXTRA_LIBS += -lwsock32 -lpthread
+endif
+
HDRS = $(wildcard ../src/*.h)
PUBLIC_HEADERS = $(wildcard ../src/git/*.h)
HDRS += $(PUBLIC_HEADERS)