]> git.ipfire.org Git - thirdparty/git.git/blobdiff - Makefile
Add MSVC to Makefile
[thirdparty/git.git] / Makefile
index d4958b832a29412d0bc3656e98f0e8a2079fe492..dcc086ad494476b6702ac879a0b1f445e3d7b044 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -876,6 +876,58 @@ ifneq (,$(findstring CYGWIN,$(uname_S)))
        COMPAT_OBJS += compat/cygwin.o
        UNRELIABLE_FSTAT = UnfortunatelyYes
 endif
+ifdef MSVC
+       pathsep = ;
+       NO_PREAD = YesPlease
+       NO_OPENSSL = YesPlease
+       NO_LIBGEN_H = YesPlease
+       NO_SYMLINK_HEAD = YesPlease
+       NO_IPV6 = YesPlease
+       NO_SETENV = YesPlease
+       NO_UNSETENV = YesPlease
+       NO_STRCASESTR = YesPlease
+       NO_STRLCPY = YesPlease
+       NO_MEMMEM = YesPlease
+       # NEEDS_LIBICONV = YesPlease
+       NO_ICONV = YesPlease
+       NO_C99_FORMAT = YesPlease
+       NO_STRTOUMAX = YesPlease
+       NO_STRTOULL = YesPlease
+       NO_MKDTEMP = YesPlease
+       NO_MKSTEMPS = YesPlease
+       SNPRINTF_RETURNS_BOGUS = YesPlease
+       NO_SVN_TESTS = YesPlease
+       NO_PERL_MAKEMAKER = YesPlease
+       RUNTIME_PREFIX = YesPlease
+       NO_POSIX_ONLY_PROGRAMS = YesPlease
+       NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
+       NO_NSEC = YesPlease
+       USE_WIN32_MMAP = YesPlease
+       # USE_NED_ALLOCATOR = YesPlease
+       UNRELIABLE_FSTAT = UnfortunatelyYes
+       OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo
+       NO_REGEX = YesPlease
+       NO_CURL = YesPlease
+       NO_PTHREADS = YesPlease
+
+       CC = compat/vcbuild/scripts/clink.pl
+       AR = compat/vcbuild/scripts/lib.pl
+       CFLAGS =
+       BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32-D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
+       COMPAT_OBJS = compat/msvc.o compat/fnmatch/fnmatch.o compat/winansi.o
+       COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/fnmatch -Icompat/regex -Icompat/fnmatch -DSTRIP_EXTENSION=\".exe\"
+       BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
+       EXTLIBS = advapi32.lib shell32.lib wininet.lib ws2_32.lib
+       lib =
+ifndef DEBUG
+       BASIC_CFLAGS += -GL -Os -MT
+       BASIC_LDFLAGS += -LTCG
+       AR += -LTCG
+else
+       BASIC_CFLAGS += -Zi -MTd
+endif
+       X = .exe
+else
 ifneq (,$(findstring MINGW,$(uname_S)))
        pathsep = ;
        NO_PREAD = YesPlease
@@ -924,6 +976,7 @@ else
        NO_PTHREADS = YesPlease
 endif
 endif
+endif
 
 -include config.mak.autogen
 -include config.mak
@@ -1326,7 +1379,7 @@ strip: $(PROGRAMS) git$X
 git.o: git.c common-cmds.h GIT-CFLAGS
        $(QUIET_CC)$(CC) -DGIT_VERSION='"$(GIT_VERSION)"' \
                '-DGIT_HTML_PATH="$(htmldir_SQ)"' \
-               $(ALL_CFLAGS) -c $(filter %.c,$^)
+               $(ALL_CFLAGS) -o $@ -c $(filter %.c,$^)
 
 git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \