What's in git.git (Jun 2008, issue #03; Mon, 23)
[git/spearce.git] / Make
blob001992d7bc0519ce345fcd39d775b18cfd759577
1 #!/bin/sh
3 # DDD=' -DUSE_SYMLINK_HEAD=0'
4 # PATH=/usr/bin:/bin
6 G=/opt/packrat/playpen/public/in-place/git/index/gitweb_config.perl
7 GIT=$HOME/git-master/bin/git
8 PATH=/usr/bin:/bin
9 LANG=C
10 LC_ALL=C
11 export PATH LANG LC_ALL
13 # for now...
14 #GIT_SVN_NO_LIB=1
15 #export GIT_SVN_NO_LIB
17 old_style_def_fix=b79d18c92d9f4841a6a1a29b7b2373a8ff9871e1
19 head=`$GIT symbolic-ref HEAD 2>/dev/null` &&
20 branch=`expr "$head" : 'refs/heads/\(.*\)'` || branch=detached
22 case "$branch" in
23 next | maint | master | pu)
24 prefix="$HOME/git-$branch"
26 snap)
27 v=`$GIT describe HEAD`
28 expr "$v" : '.*-g[0-9a-f]*$' >/dev/null && {
29 echo >&2 "You are on 'snap' but $v is not an official version."
30 exit 1
32 prefix="$HOME/git-snap-$v"
35 prefix="$HOME/git-test" ;;
36 esac
37 d="prefix=$prefix"
39 : ${O=-O2}
41 while case $# in 0) break ;; esac
42 do
43 case "$1" in
44 -pedantic)
45 o= &&
46 rev=$($GIT rev-parse HEAD) &&
47 case "$($GIT merge-base "$old_style_def_fix" "$rev")" in
48 $old_style_def_fix)
49 o=-Wold-style-definition ;;
50 esac
51 O="$O -Werror $o -std=c99 -Wno-pointer-to-int-cast"
52 # O="$O -fwrapv -fno-strict-overflow"
54 --)
55 shift
56 break
58 -*)
59 echo >&2 "Eh $1?"
60 exit 1
63 break
64 ;;
65 esac
66 shift
67 done
69 sh -c 'git describe --abbrev=4 HEAD' >/dev/null 2>&1 || {
70 $GIT describe --abbrev=4 HEAD | sed -e 's/-/./g' >version
73 make $d \
74 GITWEB_CONFIG=$G \
75 PYTHON_PATH=/usr/bin/python2.4 \
76 ETC_GITCONFIG=$prefix/etc/gitconfig \
77 CFLAGS="$O -Wall -Wdeclaration-after-statement -g" \
78 "$@"
79 status=$?
80 rm -f version
81 exit $status