2 ######################################################################
3 # Compiles or links files
5 # This is a wrapper to facilitate the compilation of Git with MSVC
6 # using GNU Make as the build system. So, instead of manipulating the
7 # Makefile into something nasty, just to support non-space arguments
8 # etc, we use this wrapper to fix the command line options
10 # Copyright (C) 2009 Marius Storm-Olsen <mstormo@gmail.com>
11 ######################################################################
17 my $arg = shift @ARGV;
18 if ("$arg" =~ /^-[DIMGO]/) {
20 } elsif ("$arg" eq "-o") {
21 my $file_out = shift @ARGV;
22 if ("$file_out" =~ /exe$/) {
24 push(@args, "-OUT:$file_out");
26 push(@args, "-Fo$file_out");
28 } elsif ("$arg" eq "-lz") {
29 push(@args, "zlib.lib");
30 } elsif ("$arg" eq "-liconv") {
31 push(@args, "iconv.lib");
32 } elsif ("$arg" eq "-lcrypto") {
33 push(@args, "libeay32.lib");
34 push(@args, "ssleay32.lib");
35 } elsif ("$arg" =~ /^-L/ && "$arg" ne "-LTCG") {
36 $arg =~ s/^-L/-LIBPATH:/;
38 } elsif ("$arg" =~ /^-R/) {
45 unshift(@args, "link.exe");
47 unshift(@args, "cl.exe");
50 #printf("**** @args\n");
51 exit (system(@args) != 0);