Add recodetree script to convert non-ASCII file names to UTF-8
[msysgit.git] / bin / msvc-build
blob835e3a461a0a7924f1ce22419bab12fde30fcc7f
1 #!/bin/sh
3 set -e
5 gui=
6 clean=
7 while test $# -gt 0
8 do
9 case "$1" in
10 --gui|--dev|--devenv|--vs|--visual-studio)
11 gui=t
13 clean)
14 clean=t
17 echo "Usage: $0 [--vs] [clean]" >&2
18 exit 1
20 esac
21 shift
22 done
24 cd /git
26 case "$clean" in
28 case "$gui" in
30 rm -rf git.sln libgit
32 '')
33 make clean
35 esac
36 exit
38 esac
40 test -d msvcgit || git clone git://repo.or.cz/msvcgit.git
42 vsvars=
43 type cl.exe 2> /dev/null ||
44 vsvars="$(ls -t \
45 "$PROGRAMFILES/Microsoft Visual Studio"*/Common7/Tools/vsvars32.bat |
46 head -n 1)"
48 config_mak=
49 test -f config.mak &&
50 config_mak=config.mak.bup.$$ &&
51 mv config.mak $config_mak
53 cat > config.mak << EOF
54 CFLAGS += -Imsvcgit/32bits/include
55 LDFLAGS += -Lmsvcgit/32bits/lib
56 EOF
58 echo "call \"$vsvars\"" > msvc-build.cmd
59 if test -z "$gui"
60 then
61 echo 'make MSVC=1' >> msvc-build.cmd
62 else
63 echo 'perl contrib/buildsystems/generate -g Vcproj' >> msvc-build.cmd
64 echo 'start git.sln' >> msvc-build.cmd
67 cmd /c msvc-build.cmd
69 test -z "$config_mak" ||
70 mv $config_mak config.mak