(prep-master) empty it out after a release.
[git] / Make
1 #!/bin/sh
2
3 # DDD=' -DUSE_SYMLINK_HEAD=0'
4 # PATH=/usr/bin:/bin
5
6 G=/opt/packrat/playpen/public/in-place/git/index/gitweb_config.perl
7 PATH=$HOME/git-master/bin:/usr/bin:/bin
8 LANG=C
9 LC_CTYPE=C
10 export PATH LANG LC_CTYPE
11
12 # for now...
13 #GIT_SVN_NO_LIB=1
14 #export GIT_SVN_NO_LIB
15
16 old_style_def_fix=b79d18c92d9f4841a6a1a29b7b2373a8ff9871e1
17
18 head=`git symbolic-ref HEAD 2>/dev/null` &&
19 branch=`expr "$head" : 'refs/heads/\(.*\)'` || branch=detached
20
21 case "$branch" in
22 next | maint | master | pu)
23         d="prefix=$HOME/git-$branch" ;;
24 snap)
25         v=`git describe HEAD`
26         expr "$v" : '.*-g[0-9a-f]*$' >/dev/null && {
27             echo >&2 "You are on 'snap' but $v is not an official version."
28             exit 1
29         }
30         d="prefix=$HOME/git-snap-$v"
31         ;;
32 *)
33         d="prefix=$HOME/git-test" ;;
34 esac
35
36 : ${O=-O2}
37
38 while case $# in 0) break ;; esac
39 do 
40         case "$1" in
41         -pedantic)
42                 o= &&
43                 rev=$(git-rev-parse HEAD) &&
44                 case "$(git-merge-base "$old_style_def_fix" "$rev")" in
45                 $old_style_def_fix)
46                         o=-Wold-style-definition ;;
47                 esac
48                 O="$O -Werror -Wall $o -ansi -pedantic -std=c99"
49                 ;;
50         --)
51                 shift
52                 break
53                 ;;
54         -*)
55                 echo >&2 "Eh $1?"
56                 exit 1
57                 ;;
58         *)
59                 break
60                 ;;              
61         esac
62         shift
63 done
64
65 make $d \
66      GITWEB_CONFIG=$G \
67      PYTHON_PATH=/usr/bin/python2.4 \
68      ETC_GITCONFIG=$d/etc/gitconfig \
69      CFLAGS="$O -Wall -Wdeclaration-after-statement -g" \
70      "$@"