]>
Commit | Line | Data |
---|---|---|
e1b6dbb5 JK |
1 | # Platform specific Makefile tweaks based on uname detection |
2 | ||
dce7d295 JH |
3 | # Define NO_SAFESEH if you need MSVC/Visual Studio to ignore the lack of |
4 | # Microsoft's Safe Exception Handling in libraries (such as zlib). | |
5 | # Typically required for VS2013+/32-bit compilation on Vista+ versions. | |
6 | ||
e1b6dbb5 JK |
7 | uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
8 | uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') | |
9 | uname_O := $(shell sh -c 'uname -o 2>/dev/null || echo not') | |
10 | uname_R := $(shell sh -c 'uname -r 2>/dev/null || echo not') | |
11 | uname_P := $(shell sh -c 'uname -p 2>/dev/null || echo not') | |
12 | uname_V := $(shell sh -c 'uname -v 2>/dev/null || echo not') | |
13 | ||
ebd2e4a1 CMAB |
14 | ifneq ($(findstring MINGW,$(uname_S)),) |
15 | uname_S := MINGW | |
16 | endif | |
17 | ||
e1b6dbb5 JK |
18 | ifdef MSVC |
19 | # avoid the MingW and Cygwin configuration sections | |
20 | uname_S := Windows | |
21 | uname_O := Windows | |
dce7d295 JH |
22 | |
23 | # Generate and include makefile variables that point to the | |
24 | # currently installed set of MSVC command line tools. | |
25 | compat/vcbuild/MSVC-DEFS-GEN: compat/vcbuild/find_vs_env.bat | |
26 | @"$<" | tr '\\' / >"$@" | |
27 | include compat/vcbuild/MSVC-DEFS-GEN | |
28 | ||
29 | # See if vcpkg and the vcpkg-build versions of the third-party | |
30 | # libraries that we use are installed. We include the result | |
31 | # to get $(vcpkg_*) variables defined for the Makefile. | |
976aaedc | 32 | ifeq (,$(SKIP_VCPKG)) |
dce7d295 JH |
33 | compat/vcbuild/VCPKG-DEFS: compat/vcbuild/vcpkg_install.bat |
34 | @"$<" | |
35 | include compat/vcbuild/VCPKG-DEFS | |
e1b6dbb5 | 36 | endif |
976aaedc | 37 | endif |
e1b6dbb5 JK |
38 | |
39 | # We choose to avoid "if .. else if .. else .. endif endif" | |
40 | # because maintaining the nesting to match is a pain. If | |
41 | # we had "elif" things would have been much nicer... | |
42 | ||
e1b6dbb5 JK |
43 | ifeq ($(uname_S),OSF1) |
44 | # Need this for u_short definitions et al | |
45 | BASIC_CFLAGS += -D_OSF_SOURCE | |
46 | SOCKLEN_T = int | |
47 | NO_STRTOULL = YesPlease | |
48 | NO_NSEC = YesPlease | |
49 | endif | |
50 | ifeq ($(uname_S),Linux) | |
61f76a36 | 51 | HAVE_ALLOCA_H = YesPlease |
e1b6dbb5 | 52 | NO_STRLCPY = YesPlease |
e1b6dbb5 JK |
53 | HAVE_PATHS_H = YesPlease |
54 | LIBC_CONTAINS_LIBINTL = YesPlease | |
55 | HAVE_DEV_TTY = YesPlease | |
148d6771 | 56 | HAVE_CLOCK_GETTIME = YesPlease |
a6c3c638 | 57 | HAVE_CLOCK_MONOTONIC = YesPlease |
52fcec75 EW |
58 | # -lrt is needed for clock_gettime on glibc <= 2.16 |
59 | NEEDS_LIBRT = YesPlease | |
abf38abe | 60 | HAVE_SYNC_FILE_RANGE = YesPlease |
0cc30e0e | 61 | HAVE_GETDELIM = YesPlease |
e2d90fd1 | 62 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
9806f5a7 | 63 | BASIC_CFLAGS += -DHAVE_SYSINFO |
226c0ddd | 64 | PROCFS_EXECUTABLE_PATH = /proc/self/exe |
2f732bf1 ES |
65 | HAVE_PLATFORM_PROCINFO = YesPlease |
66 | COMPAT_OBJS += compat/linux/procinfo.o | |
ffb9f298 DA |
67 | # centos7/rhel7 provides gcc 4.8.5 and zlib 1.2.7. |
68 | ifneq ($(findstring .el7.,$(uname_R)),) | |
69 | BASIC_CFLAGS += -std=c99 | |
ffb9f298 | 70 | endif |
e1b6dbb5 JK |
71 | endif |
72 | ifeq ($(uname_S),GNU/kFreeBSD) | |
61f76a36 | 73 | HAVE_ALLOCA_H = YesPlease |
e1b6dbb5 | 74 | NO_STRLCPY = YesPlease |
e1b6dbb5 JK |
75 | HAVE_PATHS_H = YesPlease |
76 | DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease | |
77 | LIBC_CONTAINS_LIBINTL = YesPlease | |
e2d90fd1 | 78 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
e1b6dbb5 JK |
79 | endif |
80 | ifeq ($(uname_S),UnixWare) | |
81 | CC = cc | |
82 | NEEDS_SOCKET = YesPlease | |
83 | NEEDS_NSL = YesPlease | |
84 | NEEDS_SSL_WITH_CRYPTO = YesPlease | |
85 | NEEDS_LIBICONV = YesPlease | |
86 | SHELL_PATH = /usr/local/bin/bash | |
87 | NO_IPV6 = YesPlease | |
88 | NO_HSTRERROR = YesPlease | |
e1b6dbb5 JK |
89 | BASIC_CFLAGS += -Kthread |
90 | BASIC_CFLAGS += -I/usr/local/include | |
91 | BASIC_LDFLAGS += -L/usr/local/lib | |
92 | INSTALL = ginstall | |
93 | TAR = gtar | |
94 | NO_STRCASESTR = YesPlease | |
95 | NO_MEMMEM = YesPlease | |
96 | endif | |
97 | ifeq ($(uname_S),SCO_SV) | |
98 | ifeq ($(uname_R),3.2) | |
99 | CFLAGS = -O2 | |
100 | endif | |
101 | ifeq ($(uname_R),5) | |
102 | CC = cc | |
103 | BASIC_CFLAGS += -Kthread | |
104 | endif | |
105 | NEEDS_SOCKET = YesPlease | |
106 | NEEDS_NSL = YesPlease | |
107 | NEEDS_SSL_WITH_CRYPTO = YesPlease | |
108 | NEEDS_LIBICONV = YesPlease | |
109 | SHELL_PATH = /usr/bin/bash | |
110 | NO_IPV6 = YesPlease | |
111 | NO_HSTRERROR = YesPlease | |
e1b6dbb5 JK |
112 | BASIC_CFLAGS += -I/usr/local/include |
113 | BASIC_LDFLAGS += -L/usr/local/lib | |
114 | NO_STRCASESTR = YesPlease | |
115 | NO_MEMMEM = YesPlease | |
116 | INSTALL = ginstall | |
117 | TAR = gtar | |
118 | endif | |
119 | ifeq ($(uname_S),Darwin) | |
120 | NEEDS_CRYPTO_WITH_SSL = YesPlease | |
121 | NEEDS_SSL_WITH_CRYPTO = YesPlease | |
122 | NEEDS_LIBICONV = YesPlease | |
9eeff2f6 JH |
123 | # Note: $(uname_R) gives us the underlying Darwin version. |
124 | # - MacOS 10.0.* and MacOS 10.1.0 = Darwin 1.* | |
125 | # - MacOS 10.x.* = Darwin (x+4).* for (1 <= x) | |
126 | # i.e. "begins with [15678] and a dot" means "10.4.* or older". | |
e1b6dbb5 JK |
127 | ifeq ($(shell expr "$(uname_R)" : '[15678]\.'),2) |
128 | OLD_ICONV = UnfortunatelyYes | |
9c7a0bee | 129 | NO_APPLE_COMMON_CRYPTO = YesPlease |
e1b6dbb5 JK |
130 | endif |
131 | ifeq ($(shell expr "$(uname_R)" : '[15]\.'),2) | |
132 | NO_STRLCPY = YesPlease | |
133 | endif | |
4e368785 ES |
134 | ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1),1) |
135 | HAVE_GETDELIM = YesPlease | |
136 | endif | |
bbabaad2 JK |
137 | ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 20 && echo 1),1) |
138 | OPEN_RETURNS_EINTR = UnfortunatelyYes | |
139 | endif | |
e1b6dbb5 JK |
140 | NO_MEMMEM = YesPlease |
141 | USE_ST_TIMESPEC = YesPlease | |
142 | HAVE_DEV_TTY = YesPlease | |
143 | COMPAT_OBJS += compat/precompose_utf8.o | |
144 | BASIC_CFLAGS += -DPRECOMPOSE_UNICODE | |
a42643aa | 145 | BASIC_CFLAGS += -DPROTECT_HFS_DEFAULT=1 |
9529080d | 146 | HAVE_BSD_SYSCTL = YesPlease |
8e178ec4 | 147 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
226c0ddd | 148 | HAVE_NS_GET_EXECUTABLE_PATH = YesPlease |
05cd988d | 149 | CSPRNG_METHOD = arc4random |
a0b31086 JS |
150 | |
151 | # Workaround for `gettext` being keg-only and not even being linked via | |
152 | # `brew link --force gettext`, should be obsolete as of | |
153 | # https://github.com/Homebrew/homebrew-core/pull/53489 | |
154 | ifeq ($(shell test -d /usr/local/opt/gettext/ && echo y),y) | |
155 | BASIC_CFLAGS += -I/usr/local/include -I/usr/local/opt/gettext/include | |
156 | BASIC_LDFLAGS += -L/usr/local/lib -L/usr/local/opt/gettext/lib | |
157 | ifeq ($(shell test -x /usr/local/opt/gettext/bin/msgfmt && echo y),y) | |
158 | MSGFMT = /usr/local/opt/gettext/bin/msgfmt | |
159 | endif | |
160 | endif | |
f67df255 JH |
161 | |
162 | # The builtin FSMonitor on MacOS builds upon Simple-IPC. Both require | |
163 | # Unix domain sockets and PThreads. | |
164 | ifndef NO_PTHREADS | |
165 | ifndef NO_UNIX_SOCKETS | |
166 | FSMONITOR_DAEMON_BACKEND = darwin | |
a85ad67b | 167 | FSMONITOR_OS_SETTINGS = darwin |
f67df255 JH |
168 | endif |
169 | endif | |
170 | ||
171 | BASIC_LDFLAGS += -framework CoreServices | |
e1b6dbb5 JK |
172 | endif |
173 | ifeq ($(uname_S),SunOS) | |
174 | NEEDS_SOCKET = YesPlease | |
175 | NEEDS_NSL = YesPlease | |
176 | SHELL_PATH = /bin/bash | |
177 | SANE_TOOL_PATH = /usr/xpg6/bin:/usr/xpg4/bin | |
61f76a36 | 178 | HAVE_ALLOCA_H = YesPlease |
e1b6dbb5 JK |
179 | NO_STRCASESTR = YesPlease |
180 | NO_MEMMEM = YesPlease | |
181 | NO_MKDTEMP = YesPlease | |
e1b6dbb5 | 182 | NO_REGEX = YesPlease |
e1b6dbb5 JK |
183 | NO_MSGFMT_EXTENDED_OPTIONS = YesPlease |
184 | HAVE_DEV_TTY = YesPlease | |
185 | ifeq ($(uname_R),5.6) | |
186 | SOCKLEN_T = int | |
187 | NO_HSTRERROR = YesPlease | |
188 | NO_IPV6 = YesPlease | |
189 | NO_SOCKADDR_STORAGE = YesPlease | |
190 | NO_UNSETENV = YesPlease | |
191 | NO_SETENV = YesPlease | |
192 | NO_STRLCPY = YesPlease | |
193 | NO_STRTOUMAX = YesPlease | |
194 | GIT_TEST_CMP = cmp | |
195 | endif | |
196 | ifeq ($(uname_R),5.7) | |
197 | NEEDS_RESOLV = YesPlease | |
198 | NO_IPV6 = YesPlease | |
199 | NO_SOCKADDR_STORAGE = YesPlease | |
200 | NO_UNSETENV = YesPlease | |
201 | NO_SETENV = YesPlease | |
202 | NO_STRLCPY = YesPlease | |
203 | NO_STRTOUMAX = YesPlease | |
204 | GIT_TEST_CMP = cmp | |
205 | endif | |
206 | ifeq ($(uname_R),5.8) | |
207 | NO_UNSETENV = YesPlease | |
208 | NO_SETENV = YesPlease | |
209 | NO_STRTOUMAX = YesPlease | |
210 | GIT_TEST_CMP = cmp | |
211 | endif | |
212 | ifeq ($(uname_R),5.9) | |
213 | NO_UNSETENV = YesPlease | |
214 | NO_SETENV = YesPlease | |
215 | NO_STRTOUMAX = YesPlease | |
216 | GIT_TEST_CMP = cmp | |
217 | endif | |
218 | INSTALL = /usr/ucb/install | |
219 | TAR = gtar | |
61f76a36 | 220 | BASIC_CFLAGS += -D__EXTENSIONS__ -D__sun__ |
e1b6dbb5 JK |
221 | endif |
222 | ifeq ($(uname_O),Cygwin) | |
223 | ifeq ($(shell expr "$(uname_R)" : '1\.[1-6]\.'),4) | |
224 | NO_D_TYPE_IN_DIRENT = YesPlease | |
e1b6dbb5 JK |
225 | NO_STRCASESTR = YesPlease |
226 | NO_MEMMEM = YesPlease | |
e1b6dbb5 JK |
227 | NO_SYMLINK_HEAD = YesPlease |
228 | NO_IPV6 = YesPlease | |
229 | OLD_ICONV = UnfortunatelyYes | |
f593ef77 ML |
230 | # There are conflicting reports about this. |
231 | # On some boxes NO_MMAP is needed, and not so elsewhere. | |
232 | # Try commenting this out if you suspect MMAP is more efficient | |
233 | NO_MMAP = YesPlease | |
92f63d2b ML |
234 | else |
235 | NO_REGEX = UnfortunatelyYes | |
e1b6dbb5 | 236 | endif |
61f76a36 | 237 | HAVE_ALLOCA_H = YesPlease |
e1b6dbb5 JK |
238 | NEEDS_LIBICONV = YesPlease |
239 | NO_FAST_WORKING_DIRECTORY = UnfortunatelyYes | |
e1b6dbb5 | 240 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease |
e1b6dbb5 | 241 | X = .exe |
e1b6dbb5 | 242 | UNRELIABLE_FSTAT = UnfortunatelyYes |
e53a64b9 | 243 | OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo |
5b633610 | 244 | MMAP_PREVENTS_DELETE = UnfortunatelyYes |
1cadad6f | 245 | COMPAT_OBJS += compat/win32/path-utils.o |
a5956d6a | 246 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
e1b6dbb5 JK |
247 | endif |
248 | ifeq ($(uname_S),FreeBSD) | |
249 | NEEDS_LIBICONV = YesPlease | |
6c6ce21b ES |
250 | # Versions up to 10.1 require OLD_ICONV; 10.2 and beyond don't. |
251 | # A typical version string looks like "10.2-RELEASE". | |
252 | ifeq ($(shell expr "$(uname_R)" : '[1-9]\.'),2) | |
253 | OLD_ICONV = YesPlease | |
254 | endif | |
255 | ifeq ($(firstword $(subst -, ,$(uname_R))),10.0) | |
256 | OLD_ICONV = YesPlease | |
257 | endif | |
258 | ifeq ($(firstword $(subst -, ,$(uname_R))),10.1) | |
259 | OLD_ICONV = YesPlease | |
260 | endif | |
e1b6dbb5 JK |
261 | NO_MEMMEM = YesPlease |
262 | BASIC_CFLAGS += -I/usr/local/include | |
263 | BASIC_LDFLAGS += -L/usr/local/lib | |
264 | DIR_HAS_BSD_GROUP_SEMANTICS = YesPlease | |
265 | USE_ST_TIMESPEC = YesPlease | |
266 | ifeq ($(shell expr "$(uname_R)" : '4\.'),2) | |
267 | PTHREAD_LIBS = -pthread | |
268 | NO_UINTMAX_T = YesPlease | |
269 | NO_STRTOUMAX = YesPlease | |
270 | endif | |
271 | PYTHON_PATH = /usr/local/bin/python | |
259f22af | 272 | PERL_PATH = /usr/local/bin/perl |
e1b6dbb5 | 273 | HAVE_PATHS_H = YesPlease |
9529080d | 274 | HAVE_BSD_SYSCTL = YesPlease |
226c0ddd | 275 | HAVE_BSD_KERN_PROC_SYSCTL = YesPlease |
05cd988d | 276 | CSPRNG_METHOD = arc4random |
995bc22d | 277 | PAGER_ENV = LESS=FRX LV=-c MORE=FRX |
e2d90fd1 | 278 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
18a4f6be | 279 | FILENO_IS_A_MACRO = UnfortunatelyYes |
e1b6dbb5 JK |
280 | endif |
281 | ifeq ($(uname_S),OpenBSD) | |
282 | NO_STRCASESTR = YesPlease | |
283 | NO_MEMMEM = YesPlease | |
284 | USE_ST_TIMESPEC = YesPlease | |
285 | NEEDS_LIBICONV = YesPlease | |
286 | BASIC_CFLAGS += -I/usr/local/include | |
287 | BASIC_LDFLAGS += -L/usr/local/lib | |
288 | HAVE_PATHS_H = YesPlease | |
9529080d | 289 | HAVE_BSD_SYSCTL = YesPlease |
226c0ddd | 290 | HAVE_BSD_KERN_PROC_SYSCTL = YesPlease |
05cd988d | 291 | CSPRNG_METHOD = arc4random |
226c0ddd | 292 | PROCFS_EXECUTABLE_PATH = /proc/curproc/file |
4e3ecbd4 | 293 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
18a4f6be | 294 | FILENO_IS_A_MACRO = UnfortunatelyYes |
92164af9 BS |
295 | endif |
296 | ifeq ($(uname_S),MirBSD) | |
297 | NO_STRCASESTR = YesPlease | |
298 | NO_MEMMEM = YesPlease | |
299 | USE_ST_TIMESPEC = YesPlease | |
300 | NEEDS_LIBICONV = YesPlease | |
301 | HAVE_PATHS_H = YesPlease | |
9529080d | 302 | HAVE_BSD_SYSCTL = YesPlease |
05cd988d | 303 | CSPRNG_METHOD = arc4random |
e1b6dbb5 JK |
304 | endif |
305 | ifeq ($(uname_S),NetBSD) | |
306 | ifeq ($(shell expr "$(uname_R)" : '[01]\.'),2) | |
307 | NEEDS_LIBICONV = YesPlease | |
308 | endif | |
309 | BASIC_CFLAGS += -I/usr/pkg/include | |
310 | BASIC_LDFLAGS += -L/usr/pkg/lib $(CC_LD_DYNPATH)/usr/pkg/lib | |
311 | USE_ST_TIMESPEC = YesPlease | |
e1b6dbb5 | 312 | HAVE_PATHS_H = YesPlease |
9529080d | 313 | HAVE_BSD_SYSCTL = YesPlease |
226c0ddd | 314 | HAVE_BSD_KERN_PROC_SYSCTL = YesPlease |
05cd988d | 315 | CSPRNG_METHOD = arc4random |
226c0ddd | 316 | PROCFS_EXECUTABLE_PATH = /proc/curproc/exe |
e1b6dbb5 JK |
317 | endif |
318 | ifeq ($(uname_S),AIX) | |
319 | DEFAULT_PAGER = more | |
320 | NO_STRCASESTR = YesPlease | |
321 | NO_MEMMEM = YesPlease | |
322 | NO_MKDTEMP = YesPlease | |
e1b6dbb5 JK |
323 | NO_STRLCPY = YesPlease |
324 | NO_NSEC = YesPlease | |
0e6d899f | 325 | NO_REGEX = NeedsStartEnd |
e1b6dbb5 JK |
326 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
327 | INTERNAL_QSORT = UnfortunatelyYes | |
328 | NEEDS_LIBICONV = YesPlease | |
329 | BASIC_CFLAGS += -D_LARGE_FILES | |
ee662bf5 | 330 | FILENO_IS_A_MACRO = UnfortunatelyYes |
400caafb | 331 | NEED_ACCESS_ROOT_HANDLER = UnfortunatelyYes |
e1b6dbb5 JK |
332 | ifeq ($(shell expr "$(uname_V)" : '[1234]'),1) |
333 | NO_PTHREADS = YesPlease | |
334 | else | |
335 | PTHREAD_LIBS = -lpthread | |
336 | endif | |
337 | ifeq ($(shell expr "$(uname_V).$(uname_R)" : '5\.1'),3) | |
338 | INLINE = '' | |
339 | endif | |
340 | GIT_TEST_CMP = cmp | |
341 | endif | |
342 | ifeq ($(uname_S),GNU) | |
343 | # GNU/Hurd | |
61f76a36 | 344 | HAVE_ALLOCA_H = YesPlease |
e1b6dbb5 | 345 | NO_STRLCPY = YesPlease |
e1b6dbb5 JK |
346 | HAVE_PATHS_H = YesPlease |
347 | LIBC_CONTAINS_LIBINTL = YesPlease | |
274a1328 | 348 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
e1b6dbb5 JK |
349 | endif |
350 | ifeq ($(uname_S),IRIX) | |
351 | NO_SETENV = YesPlease | |
352 | NO_UNSETENV = YesPlease | |
353 | NO_STRCASESTR = YesPlease | |
354 | NO_MEMMEM = YesPlease | |
e1b6dbb5 JK |
355 | NO_MKDTEMP = YesPlease |
356 | # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads | |
357 | # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set), | |
358 | # git dies with a segmentation fault when trying to access the first | |
359 | # entry of a reflog. The conservative choice is made to always set | |
360 | # NO_MMAP. If you suspect that your compiler is not affected by this | |
361 | # issue, comment out the NO_MMAP statement. | |
362 | NO_MMAP = YesPlease | |
363 | NO_REGEX = YesPlease | |
e1b6dbb5 JK |
364 | SNPRINTF_RETURNS_BOGUS = YesPlease |
365 | SHELL_PATH = /usr/gnu/bin/bash | |
366 | NEEDS_LIBGEN = YesPlease | |
367 | endif | |
368 | ifeq ($(uname_S),IRIX64) | |
369 | NO_SETENV = YesPlease | |
370 | NO_UNSETENV = YesPlease | |
371 | NO_STRCASESTR = YesPlease | |
372 | NO_MEMMEM = YesPlease | |
e1b6dbb5 JK |
373 | NO_MKDTEMP = YesPlease |
374 | # When compiled with the MIPSpro 7.4.4m compiler, and without pthreads | |
375 | # (i.e. NO_PTHREADS is set), and _with_ MMAP (i.e. NO_MMAP is not set), | |
376 | # git dies with a segmentation fault when trying to access the first | |
377 | # entry of a reflog. The conservative choice is made to always set | |
378 | # NO_MMAP. If you suspect that your compiler is not affected by this | |
379 | # issue, comment out the NO_MMAP statement. | |
380 | NO_MMAP = YesPlease | |
381 | NO_REGEX = YesPlease | |
e1b6dbb5 JK |
382 | SNPRINTF_RETURNS_BOGUS = YesPlease |
383 | SHELL_PATH = /usr/gnu/bin/bash | |
384 | NEEDS_LIBGEN = YesPlease | |
385 | endif | |
386 | ifeq ($(uname_S),HP-UX) | |
387 | INLINE = __inline | |
388 | NO_IPV6 = YesPlease | |
389 | NO_SETENV = YesPlease | |
390 | NO_STRCASESTR = YesPlease | |
391 | NO_MEMMEM = YesPlease | |
e1b6dbb5 JK |
392 | NO_STRLCPY = YesPlease |
393 | NO_MKDTEMP = YesPlease | |
394 | NO_UNSETENV = YesPlease | |
395 | NO_HSTRERROR = YesPlease | |
396 | NO_SYS_SELECT_H = YesPlease | |
e1b6dbb5 JK |
397 | SNPRINTF_RETURNS_BOGUS = YesPlease |
398 | NO_NSEC = YesPlease | |
399 | ifeq ($(uname_R),B.11.00) | |
400 | NO_INET_NTOP = YesPlease | |
401 | NO_INET_PTON = YesPlease | |
402 | endif | |
403 | ifeq ($(uname_R),B.10.20) | |
404 | # Override HP-UX 11.x setting: | |
405 | INLINE = | |
406 | SOCKLEN_T = size_t | |
407 | NO_PREAD = YesPlease | |
408 | NO_INET_NTOP = YesPlease | |
409 | NO_INET_PTON = YesPlease | |
410 | endif | |
411 | GIT_TEST_CMP = cmp | |
412 | endif | |
413 | ifeq ($(uname_S),Windows) | |
414 | GIT_VERSION := $(GIT_VERSION).MSVC | |
415 | pathsep = ; | |
dce7d295 JH |
416 | # Assume that this is built in Git for Windows' SDK |
417 | ifeq (MINGW32,$(MSYSTEM)) | |
418 | prefix = /mingw32 | |
419 | else | |
420 | prefix = /mingw64 | |
421 | endif | |
422 | # Prepend MSVC 64-bit tool-chain to PATH. | |
423 | # | |
424 | # A regular Git Bash *does not* have cl.exe in its $PATH. As there is a | |
425 | # link.exe next to, and required by, cl.exe, we have to prepend this | |
426 | # onto the existing $PATH. | |
427 | # | |
428 | SANE_TOOL_PATH ?= $(msvc_bin_dir_msys) | |
61f76a36 | 429 | HAVE_ALLOCA_H = YesPlease |
e1b6dbb5 JK |
430 | NO_PREAD = YesPlease |
431 | NEEDS_CRYPTO_WITH_SSL = YesPlease | |
432 | NO_LIBGEN_H = YesPlease | |
433 | NO_POLL = YesPlease | |
434 | NO_SYMLINK_HEAD = YesPlease | |
435 | NO_IPV6 = YesPlease | |
436 | NO_UNIX_SOCKETS = YesPlease | |
437 | NO_SETENV = YesPlease | |
e1b6dbb5 JK |
438 | NO_STRCASESTR = YesPlease |
439 | NO_STRLCPY = YesPlease | |
e1b6dbb5 | 440 | NO_MEMMEM = YesPlease |
dce7d295 | 441 | NEEDS_LIBICONV = YesPlease |
e1b6dbb5 | 442 | NO_STRTOUMAX = YesPlease |
e1b6dbb5 | 443 | NO_MKDTEMP = YesPlease |
dce7d295 | 444 | NO_INTTYPES_H = YesPlease |
05cd988d | 445 | CSPRNG_METHOD = rtlgenrandom |
dce7d295 JH |
446 | # VS2015 with UCRT claims that snprintf and friends are C99 compliant, |
447 | # so we don't need this: | |
448 | # | |
449 | # SNPRINTF_RETURNS_BOGUS = YesPlease | |
62c73671 JH |
450 | |
451 | # The builtin FSMonitor requires Named Pipes and Threads on Windows. | |
452 | # These are always available, so we do not have to conditionally | |
453 | # support it. | |
454 | FSMONITOR_DAEMON_BACKEND = win32 | |
d33c804d JH |
455 | FSMONITOR_OS_SETTINGS = win32 |
456 | ||
e1b6dbb5 | 457 | NO_SVN_TESTS = YesPlease |
e1b6dbb5 | 458 | RUNTIME_PREFIX = YesPlease |
86e25458 | 459 | HAVE_WPGMPTR = YesWeDo |
e1b6dbb5 | 460 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease |
59c7b881 | 461 | USE_WIN32_IPC = YesPlease |
e1b6dbb5 | 462 | USE_WIN32_MMAP = YesPlease |
5b633610 | 463 | MMAP_PREVENTS_DELETE = UnfortunatelyYes |
e1b6dbb5 JK |
464 | # USE_NED_ALLOCATOR = YesPlease |
465 | UNRELIABLE_FSTAT = UnfortunatelyYes | |
466 | OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo | |
467 | NO_REGEX = YesPlease | |
bad866a2 | 468 | NO_GETTEXT = YesPlease |
e1b6dbb5 | 469 | NO_PYTHON = YesPlease |
e0492c5b | 470 | ETAGS_TARGET = ETAGS |
e1b6dbb5 JK |
471 | NO_POSIX_GOODIES = UnfortunatelyYes |
472 | NATIVE_CRLF = YesPlease | |
473 | DEFAULT_HELP_FORMAT = html | |
fb5e3378 JS |
474 | ifeq (/mingw64,$(subst 32,64,$(prefix))) |
475 | # Move system config into top-level /etc/ | |
476 | ETC_GITCONFIG = ../etc/gitconfig | |
477 | ETC_GITATTRIBUTES = ../etc/gitattributes | |
478 | endif | |
e1b6dbb5 JK |
479 | |
480 | CC = compat/vcbuild/scripts/clink.pl | |
481 | AR = compat/vcbuild/scripts/lib.pl | |
482 | CFLAGS = | |
dce7d295 | 483 | BASIC_CFLAGS = -nologo -I. -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE |
e1b6dbb5 | 484 | COMPAT_OBJS = compat/msvc.o compat/winansi.o \ |
abf38abe | 485 | compat/win32/flush.o \ |
22c3634c | 486 | compat/win32/path-utils.o \ |
e1b6dbb5 | 487 | compat/win32/pthread.o compat/win32/syslog.o \ |
353d3d77 | 488 | compat/win32/trace2_win32_process_info.o \ |
e1b6dbb5 | 489 | compat/win32/dirent.o |
dce7d295 | 490 | COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DDETECT_MSYS_TTY -DNOGDI -DHAVE_STRING_H -Icompat -Icompat/regex -Icompat/win32 -DSTRIP_EXTENSION=\".exe\" |
396ff754 | 491 | BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -ENTRY:wmainCRTStartup -SUBSYSTEM:CONSOLE |
dce7d295 JH |
492 | # invalidcontinue.obj allows Git's source code to close the same file |
493 | # handle twice, or to access the osfhandle of an already-closed stdout | |
494 | # See https://msdn.microsoft.com/en-us/library/ms235330.aspx | |
495 | EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib invalidcontinue.obj kernel32.lib ntdll.lib | |
e1b6dbb5 JK |
496 | PTHREAD_LIBS = |
497 | lib = | |
dce7d295 JH |
498 | BASIC_CFLAGS += $(vcpkg_inc) $(sdk_includes) $(msvc_includes) |
499 | ifndef DEBUG | |
500 | BASIC_CFLAGS += $(vcpkg_rel_lib) | |
501 | else | |
502 | BASIC_CFLAGS += $(vcpkg_dbg_lib) | |
503 | endif | |
504 | BASIC_CFLAGS += $(sdk_libs) $(msvc_libs) | |
505 | ||
556702f8 JH |
506 | ifneq ($(USE_MSVC_CRTDBG),) |
507 | # Optionally enable memory leak reporting. | |
508 | BASIC_CFLAGS += -DUSE_MSVC_CRTDBG | |
509 | endif | |
dce7d295 JH |
510 | # Always give "-Zi" to the compiler and "-debug" to linker (even in |
511 | # release mode) to force a PDB to be generated (like RelWithDebInfo). | |
512 | BASIC_CFLAGS += -Zi | |
513 | BASIC_LDFLAGS += -debug -Zf | |
514 | ||
515 | ifdef NO_SAFESEH | |
516 | LDFLAGS += -SAFESEH:NO | |
517 | endif | |
518 | ||
e1b6dbb5 | 519 | ifndef DEBUG |
dce7d295 JH |
520 | BASIC_CFLAGS += -GL -Gy -O2 -Oy- -MD -DNDEBUG |
521 | BASIC_LDFLAGS += -release -LTCG /OPT:REF /OPT:ICF /INCREMENTAL:NO /DEBUGTYPE:CV,FIXUP | |
e1b6dbb5 JK |
522 | AR += -LTCG |
523 | else | |
dce7d295 | 524 | BASIC_CFLAGS += -MDd -DDEBUG -D_DEBUG |
e1b6dbb5 JK |
525 | endif |
526 | X = .exe | |
963e1543 JS |
527 | |
528 | compat/msvc.o: compat/msvc.c compat/mingw.c GIT-CFLAGS | |
e1b6dbb5 JK |
529 | endif |
530 | ifeq ($(uname_S),Interix) | |
531 | NO_INITGROUPS = YesPlease | |
532 | NO_IPV6 = YesPlease | |
533 | NO_MEMMEM = YesPlease | |
534 | NO_MKDTEMP = YesPlease | |
535 | NO_STRTOUMAX = YesPlease | |
536 | NO_NSEC = YesPlease | |
e1b6dbb5 JK |
537 | ifeq ($(uname_R),3.5) |
538 | NO_INET_NTOP = YesPlease | |
539 | NO_INET_PTON = YesPlease | |
540 | NO_SOCKADDR_STORAGE = YesPlease | |
e1b6dbb5 JK |
541 | endif |
542 | ifeq ($(uname_R),5.2) | |
543 | NO_INET_NTOP = YesPlease | |
544 | NO_INET_PTON = YesPlease | |
545 | NO_SOCKADDR_STORAGE = YesPlease | |
e1b6dbb5 JK |
546 | endif |
547 | endif | |
548 | ifeq ($(uname_S),Minix) | |
549 | NO_IPV6 = YesPlease | |
550 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease | |
551 | NO_NSEC = YesPlease | |
552 | NEEDS_LIBGEN = | |
553 | NEEDS_CRYPTO_WITH_SSL = YesPlease | |
e1b6dbb5 JK |
554 | NEEDS_RESOLV = |
555 | NO_HSTRERROR = YesPlease | |
556 | NO_MMAP = YesPlease | |
557 | NO_CURL = | |
558 | NO_EXPAT = | |
559 | endif | |
560 | ifeq ($(uname_S),NONSTOP_KERNEL) | |
561 | # Needs some C99 features, "inline" is just one of them. | |
562 | # INLINE='' would just replace one set of warnings with another and | |
563 | # still not compile in c89 mode, due to non-const array initializations. | |
564 | CC = cc -c99 | |
71fb089c RB |
565 | # Build down-rev compatible objects that don't use our new getopt_long. |
566 | ifeq ($(uname_R).$(uname_V),J06.21) | |
567 | CC += -WRVU=J06.20 | |
568 | endif | |
569 | ifeq ($(uname_R).$(uname_V),L17.02) | |
570 | CC += -WRVU=L16.05 | |
571 | endif | |
e1b6dbb5 JK |
572 | # Disable all optimization, seems to result in bad code, with -O or -O2 |
573 | # or even -O1 (default), /usr/local/libexec/git-core/git-pack-objects | |
574 | # abends on "git push". Needs more investigation. | |
71fb089c | 575 | CFLAGS = -g -O0 -Winline |
e1b6dbb5 JK |
576 | # We'd want it to be here. |
577 | prefix = /usr/local | |
71fb089c RB |
578 | # perl and python must be in /usr/bin on NonStop - supplied by HPE |
579 | # with operating system in that managed directory. | |
580 | PERL_PATH = /usr/bin/perl | |
581 | PYTHON_PATH = /usr/bin/python | |
582 | # The current /usr/coreutils/rm at lowest support level does not work | |
583 | # with the git test structure. Long paths as in | |
584 | # 'trash directory...' cause rm to terminate prematurely without fully | |
585 | # removing the directory at OS releases J06.21 and L17.02. | |
586 | # Default to the older rm until those two releases are deprecated. | |
587 | RM = /bin/rm -f | |
71fb089c RB |
588 | NEEDS_CRYPTO_WITH_SSL = YesPlease |
589 | HAVE_DEV_TTY = YesPlease | |
e1b6dbb5 JK |
590 | HAVE_LIBCHARSET_H = YesPlease |
591 | HAVE_STRINGS_H = YesPlease | |
592 | NEEDS_LIBICONV = YesPlease | |
593 | NEEDS_LIBINTL_BEFORE_LIBICONV = YesPlease | |
594 | NO_SYS_SELECT_H = UnfortunatelyYes | |
595 | NO_D_TYPE_IN_DIRENT = YesPlease | |
71fb089c | 596 | NO_GETTEXT = YesPlease |
e1b6dbb5 JK |
597 | NO_HSTRERROR = YesPlease |
598 | NO_STRCASESTR = YesPlease | |
e1b6dbb5 JK |
599 | NO_MEMMEM = YesPlease |
600 | NO_STRLCPY = YesPlease | |
601 | NO_SETENV = YesPlease | |
602 | NO_UNSETENV = YesPlease | |
603 | NO_MKDTEMP = YesPlease | |
e1b6dbb5 JK |
604 | # Currently libiconv-1.9.1. |
605 | OLD_ICONV = UnfortunatelyYes | |
71fb089c | 606 | NO_REGEX = NeedsStartEnd |
e1b6dbb5 | 607 | NO_PTHREADS = UnfortunatelyYes |
243a4c7e | 608 | FREAD_READS_DIRECTORIES = UnfortunatelyYes |
e1b6dbb5 JK |
609 | |
610 | # Not detected (nor checked for) by './configure'. | |
611 | # We don't have SA_RESTART on NonStop, unfortunalety. | |
612 | COMPAT_CFLAGS += -DSA_RESTART=0 | |
613 | # Apparently needed in compat/fnmatch/fnmatch.c. | |
614 | COMPAT_CFLAGS += -DHAVE_STRING_H=1 | |
615 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease | |
616 | NO_NSEC = YesPlease | |
617 | NO_PREAD = YesPlease | |
618 | NO_MMAP = YesPlease | |
619 | NO_POLL = YesPlease | |
620 | NO_INTPTR_T = UnfortunatelyYes | |
05cd988d | 621 | CSPRNG_METHOD = openssl |
e1b6dbb5 | 622 | SANE_TOOL_PATH = /usr/coreutils/bin:/usr/local/bin |
f0ec22bb | 623 | SHELL_PATH = /usr/coreutils/bin/bash |
e1b6dbb5 | 624 | endif |
ebd2e4a1 | 625 | ifeq ($(uname_S),MINGW) |
e1b6dbb5 | 626 | pathsep = ; |
22f4c27e | 627 | HAVE_ALLOCA_H = YesPlease |
e1b6dbb5 JK |
628 | NO_PREAD = YesPlease |
629 | NEEDS_CRYPTO_WITH_SSL = YesPlease | |
630 | NO_LIBGEN_H = YesPlease | |
631 | NO_POLL = YesPlease | |
632 | NO_SYMLINK_HEAD = YesPlease | |
633 | NO_UNIX_SOCKETS = YesPlease | |
634 | NO_SETENV = YesPlease | |
e1b6dbb5 JK |
635 | NO_STRCASESTR = YesPlease |
636 | NO_STRLCPY = YesPlease | |
e1b6dbb5 JK |
637 | NO_MEMMEM = YesPlease |
638 | NEEDS_LIBICONV = YesPlease | |
e1b6dbb5 JK |
639 | NO_STRTOUMAX = YesPlease |
640 | NO_MKDTEMP = YesPlease | |
e1b6dbb5 | 641 | NO_SVN_TESTS = YesPlease |
62c73671 JH |
642 | |
643 | # The builtin FSMonitor requires Named Pipes and Threads on Windows. | |
644 | # These are always available, so we do not have to conditionally | |
645 | # support it. | |
646 | FSMONITOR_DAEMON_BACKEND = win32 | |
d33c804d JH |
647 | FSMONITOR_OS_SETTINGS = win32 |
648 | ||
e1b6dbb5 | 649 | RUNTIME_PREFIX = YesPlease |
86e25458 | 650 | HAVE_WPGMPTR = YesWeDo |
e1b6dbb5 | 651 | NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease |
59c7b881 | 652 | USE_WIN32_IPC = YesPlease |
e1b6dbb5 | 653 | USE_WIN32_MMAP = YesPlease |
5b633610 | 654 | MMAP_PREVENTS_DELETE = UnfortunatelyYes |
e1b6dbb5 JK |
655 | USE_NED_ALLOCATOR = YesPlease |
656 | UNRELIABLE_FSTAT = UnfortunatelyYes | |
657 | OBJECT_CREATION_USES_RENAMES = UnfortunatelyNeedsTo | |
658 | NO_REGEX = YesPlease | |
e1b6dbb5 | 659 | ETAGS_TARGET = ETAGS |
e1b6dbb5 | 660 | NO_POSIX_GOODIES = UnfortunatelyYes |
65db0443 | 661 | DEFAULT_HELP_FORMAT = html |
b7e6a416 | 662 | HAVE_PLATFORM_PROCINFO = YesPlease |
05cd988d | 663 | CSPRNG_METHOD = rtlgenrandom |
396ff754 | 664 | BASIC_LDFLAGS += -municode |
7b40ae86 | 665 | COMPAT_CFLAGS += -DNOGDI -Icompat -Icompat/win32 |
e1b6dbb5 JK |
666 | COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\" |
667 | COMPAT_OBJS += compat/mingw.o compat/winansi.o \ | |
353d3d77 | 668 | compat/win32/trace2_win32_process_info.o \ |
abf38abe | 669 | compat/win32/flush.o \ |
1cadad6f | 670 | compat/win32/path-utils.o \ |
e1b6dbb5 JK |
671 | compat/win32/pthread.o compat/win32/syslog.o \ |
672 | compat/win32/dirent.o | |
7c9fbda6 | 673 | BASIC_CFLAGS += -DWIN32 |
e1b6dbb5 | 674 | EXTLIBS += -lws2_32 |
ce39c2e0 | 675 | GITLIBS += git.res |
e1b6dbb5 | 676 | PTHREAD_LIBS = |
ce39c2e0 | 677 | RC = windres -O coff |
95f31e9a | 678 | NATIVE_CRLF = YesPlease |
e1b6dbb5 | 679 | X = .exe |
e1b6dbb5 JK |
680 | ifneq (,$(wildcard ../THIS_IS_MSYSGIT)) |
681 | htmldir = doc/git/html/ | |
682 | prefix = | |
683 | INSTALL = /bin/install | |
684 | EXTLIBS += /mingw/lib/libz.a | |
e1b6dbb5 JK |
685 | INTERNAL_QSORT = YesPlease |
686 | HAVE_LIBCHARSET_H = YesPlease | |
ca354871 | 687 | NO_GETTEXT = YesPlease |
49d279f8 | 688 | NO_PYTHON = YesPlease |
6a1ce2ed | 689 | COMPAT_CFLAGS += -D__USE_MINGW_ACCESS |
e1b6dbb5 | 690 | else |
aeb582a9 | 691 | ifneq ($(shell expr "$(uname_R)" : '1\.'),2) |
df5218b4 | 692 | # MSys2 |
7b40ae86 | 693 | prefix = /usr/ |
ce6a1585 İD |
694 | # Enable DEP |
695 | BASIC_LDFLAGS += -Wl,--nxcompat | |
696 | # Enable ASLR (unless debugging) | |
697 | ifneq (,$(findstring -O,$(filter-out -O0 -Og,$(CFLAGS)))) | |
698 | BASIC_LDFLAGS += -Wl,--dynamicbase | |
699 | endif | |
7b40ae86 JS |
700 | ifeq (MINGW32,$(MSYSTEM)) |
701 | prefix = /mingw32 | |
bb02e7a5 | 702 | HOST_CPU = i686 |
598b6c3a | 703 | BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup |
7b40ae86 JS |
704 | endif |
705 | ifeq (MINGW64,$(MSYSTEM)) | |
706 | prefix = /mingw64 | |
bb02e7a5 | 707 | HOST_CPU = x86_64 |
598b6c3a | 708 | BASIC_LDFLAGS += -Wl,--pic-executable,-e,mainCRTStartup |
7b40ae86 JS |
709 | else |
710 | COMPAT_CFLAGS += -D_USE_32BIT_TIME_T | |
711 | BASIC_LDFLAGS += -Wl,--large-address-aware | |
712 | endif | |
df5218b4 | 713 | CC = gcc |
a1c5e906 JS |
714 | COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \ |
715 | -fstack-protector-strong | |
f7f90e0f | 716 | EXTLIBS += -lntdll |
df5218b4 | 717 | INSTALL = /bin/install |
df5218b4 JS |
718 | INTERNAL_QSORT = YesPlease |
719 | HAVE_LIBCHARSET_H = YesPlease | |
b640b77f | 720 | USE_GETTEXT_SCHEME = fallthrough |
ebbf5d2b | 721 | USE_LIBPCRE = YesPlease |
df5218b4 | 722 | USE_NED_ALLOCATOR = YesPlease |
fb5e3378 JS |
723 | ifeq (/mingw64,$(subst 32,64,$(prefix))) |
724 | # Move system config into top-level /etc/ | |
725 | ETC_GITCONFIG = ../etc/gitconfig | |
726 | ETC_GITATTRIBUTES = ../etc/gitattributes | |
727 | endif | |
df5218b4 JS |
728 | else |
729 | COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO | |
730 | NO_CURL = YesPlease | |
49d279f8 | 731 | NO_PYTHON = YesPlease |
df5218b4 | 732 | endif |
e1b6dbb5 JK |
733 | endif |
734 | endif | |
735 | ifeq ($(uname_S),QNX) | |
736 | COMPAT_CFLAGS += -DSA_RESTART=0 | |
081fd8d0 | 737 | EXPAT_NEEDS_XMLPARSE_H = YesPlease |
e1b6dbb5 JK |
738 | HAVE_STRINGS_H = YesPlease |
739 | NEEDS_SOCKET = YesPlease | |
e1b6dbb5 JK |
740 | NO_GETPAGESIZE = YesPlease |
741 | NO_ICONV = YesPlease | |
742 | NO_MEMMEM = YesPlease | |
743 | NO_MKDTEMP = YesPlease | |
e1b6dbb5 JK |
744 | NO_NSEC = YesPlease |
745 | NO_PTHREADS = YesPlease | |
e1b6dbb5 JK |
746 | NO_STRCASESTR = YesPlease |
747 | NO_STRLCPY = YesPlease | |
748 | endif | |
976aaedc JS |
749 | |
750 | vcxproj: | |
751 | # Require clean work tree | |
752 | git update-index -q --refresh && \ | |
753 | git diff-files --quiet && \ | |
754 | git diff-index --cached --quiet HEAD -- | |
755 | ||
756 | # Make .vcxproj files and add them | |
976aaedc JS |
757 | perl contrib/buildsystems/generate -g Vcxproj |
758 | git add -f git.sln {*,*/lib,t/helper/*}/*.vcxproj | |
759 | ||
030a628b | 760 | # Generate the LinkOrCopyBuiltins.targets and LinkOrCopyRemoteHttp.targets file |
b18ae14a JS |
761 | (echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \ |
762 | echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \ | |
763 | for name in $(BUILT_INS);\ | |
764 | do \ | |
765 | echo ' <Copy SourceFiles="$$(OutDir)\git.exe" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \ | |
766 | done && \ | |
030a628b JS |
767 | echo ' </Target>' && \ |
768 | echo '</Project>') >git/LinkOrCopyBuiltins.targets | |
769 | (echo '<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">' && \ | |
770 | echo ' <Target Name="CopyBuiltins_AfterBuild" AfterTargets="AfterBuild">' && \ | |
b18ae14a JS |
771 | for name in $(REMOTE_CURL_ALIASES); \ |
772 | do \ | |
773 | echo ' <Copy SourceFiles="$$(OutDir)\'"$(REMOTE_CURL_PRIMARY)"'" DestinationFiles="$$(OutDir)\'"$$name"'" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" />'; \ | |
774 | done && \ | |
775 | echo ' </Target>' && \ | |
030a628b JS |
776 | echo '</Project>') >git-remote-http/LinkOrCopyRemoteHttp.targets |
777 | git add -f git/LinkOrCopyBuiltins.targets git-remote-http/LinkOrCopyRemoteHttp.targets | |
b18ae14a | 778 | |
7c3c0a99 ÆAB |
779 | # Add generated headers |
780 | $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(GENERATED_H) | |
781 | git add -f $(GENERATED_H) | |
976aaedc JS |
782 | |
783 | # Add scripts | |
784 | rm -f perl/perl.mak | |
5d65ad17 | 785 | $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(SCRIPT_LIB) $(SCRIPTS) |
976aaedc JS |
786 | # Strip out the sane tool path, needed only for building |
787 | sed -i '/^git_broken_path_fix ".*/d' git-sh-setup | |
5d65ad17 | 788 | git add -f $(SCRIPT_LIB) $(SCRIPTS) |
976aaedc JS |
789 | |
790 | # Add Perl module | |
791 | $(MAKE) $(LIB_PERL_GEN) | |
792 | git add -f perl/build | |
793 | ||
794 | # Add bin-wrappers, for testing | |
795 | rm -rf bin-wrappers/ | |
796 | $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(test_bindir_programs) | |
797 | # Ensure that the GIT_EXEC_PATH is a Unix-y one, and that the absolute | |
798 | # path of the repository is not hard-coded (GIT_EXEC_PATH will be set | |
799 | # by test-lib.sh according to the current setup) | |
800 | sed -i -e 's/^\(GIT_EXEC_PATH\)=.*/test -n "$${\1##*:*}" ||\ | |
801 | \1="$$(cygpath -u "$$\1")"/' \ | |
802 | -e "s|'$$(pwd)|\"\$$GIT_EXEC_PATH\"'|g" bin-wrappers/* | |
803 | # Ensure that test-* helpers find the .dll files copied to top-level | |
804 | sed -i 's|^PATH=.*|&:"$$GIT_EXEC_PATH"|' bin-wrappers/test-* | |
805 | # We do not want to force hard-linking builtins | |
806 | sed -i 's|\(git\)-\([-a-z]*\)\.exe"|\1.exe" \2|g' \ | |
807 | bin-wrappers/git-{receive-pack,upload-archive} | |
808 | git add -f $(test_bindir_programs) | |
809 | # remote-ext is a builtin, but invoked as if it were external | |
810 | sed 's|receive-pack|remote-ext|g' \ | |
811 | <bin-wrappers/git-receive-pack >bin-wrappers/git-remote-ext | |
812 | git add -f bin-wrappers/git-remote-ext | |
813 | ||
814 | # Add templates | |
815 | $(MAKE) -C templates | |
816 | git add -f templates/boilerplates.made templates/blt/ | |
817 | ||
5d65ad17 JS |
818 | # Add the translated messages |
819 | make MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 $(MOFILES) | |
820 | git add -f $(MOFILES) | |
821 | ||
976aaedc JS |
822 | # Add build options |
823 | $(MAKE) MSVC=1 SKIP_VCPKG=1 prefix=/mingw64 GIT-BUILD-OPTIONS | |
824 | git add -f GIT-BUILD-OPTIONS | |
825 | ||
826 | # Commit the whole shebang | |
827 | git commit -m "Generate Visual Studio solution" \ | |
828 | -m "Auto-generated by \`$(MAKE)$(MAKEFLAGS) $@\`" |