Commit a1c0728d by Ramsay Jones

Add support for the MinGW platform

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
parent cfe3a027
...@@ -30,6 +30,12 @@ ifneq (,$(findstring CYGWIN,$(uname_S))) ...@@ -30,6 +30,12 @@ ifneq (,$(findstring CYGWIN,$(uname_S)))
NO_VISIBILITY=YesPlease NO_VISIBILITY=YesPlease
endif endif
ifneq (,$(findstring MINGW,$(uname_S)))
OS=win32
NO_VISIBILITY=YesPlease
SPARSE_FLAGS=-Wno-one-bit-signed-bitfield
endif
SRC_C = $(wildcard src/*.c) SRC_C = $(wildcard src/*.c)
OS_SRC = $(wildcard src/$(OS)/*.c) OS_SRC = $(wildcard src/$(OS)/*.c)
SRC_C += $(OS_SRC) SRC_C += $(OS_SRC)
...@@ -68,7 +74,7 @@ all:: $(GIT_LIB) ...@@ -68,7 +74,7 @@ all:: $(GIT_LIB)
clean: clean:
rm -f $(GIT_LIB) rm -f $(GIT_LIB)
rm -f libgit2.pc 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 -rf apidocs
rm -f *~ src/*~ src/git/*~ src/sha1/*~ src/unix/*~ src/win32/*~ rm -f *~ src/*~ src/git/*~ src/sha1/*~ src/unix/*~ src/win32/*~
@$(MAKE) -C tests -s --no-print-directory clean @$(MAKE) -C tests -s --no-print-directory clean
......
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
#endif #endif
/* Define the printf format specifer to use for size_t output */ /* Define the printf format specifer to use for size_t output */
#if !defined(_MSC_VER) #if defined(_MSC_VER) || defined(__MINGW32__)
# define PRIuZ "zu"
#else
# define PRIuZ "Iu" # define PRIuZ "Iu"
#else
# define PRIuZ "zu"
#endif #endif
/* Micosoft Visual C/C++ */ /* Micosoft Visual C/C++ */
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
/** Force 64 bit off_t size on POSIX. */ /** Force 64 bit off_t size on POSIX. */
#define _FILE_OFFSET_BITS 64 #define _FILE_OFFSET_BITS 64
#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) #if defined(_WIN32) && !defined(__CYGWIN__)
#define GIT_WIN32 1 #define GIT_WIN32 1
#endif #endif
......
...@@ -15,6 +15,13 @@ CRYPTO_LIB = -lcrypto ...@@ -15,6 +15,13 @@ CRYPTO_LIB = -lcrypto
EXTRA_LIBS = EXTRA_LIBS =
# Platform specific tweaks
ifneq (,$(findstring MINGW,$(uname_S)))
OS=win32
EXTRA_LIBS += -lwsock32 -lpthread
endif
HDRS = $(wildcard ../src/*.h) HDRS = $(wildcard ../src/*.h)
PUBLIC_HEADERS = $(wildcard ../src/git/*.h) PUBLIC_HEADERS = $(wildcard ../src/git/*.h)
HDRS += $(PUBLIC_HEADERS) HDRS += $(PUBLIC_HEADERS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment