forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMake
More file actions
executable file
·194 lines (179 loc) · 3.36 KB
/
Make
File metadata and controls
executable file
·194 lines (179 loc) · 3.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#!/bin/sh
case "$(git version 2>/dev/null)" in
"git version"*)
GIT=git ;;
*)
echo >&2 "No git to bootstrap"
exit 1 ;;
esac
inst_prefix=$(
IFS=:
for p in $PATH
do
probed=${p%/git-active/bin}
if test "$probed" != "$p"
then
echo "$probed"
exit
fi
done
echo $HOME
)
LANG=C
old_style_def_fix=b79d18c92d9f4841a6a1a29b7b2373a8ff9871e1
: ${O=-O2}
for cv in PYTHON_PATH=python TCL_PATH=tclsh TCLTKPATH=wish
do
cmd=${cv#*=}
var=${cv%=*}
eval $(
if test -f "/usr/bin/$cmd"
then
break
fi
for p in /usr/bin /usr/local/bin
do
if test -f "$p/$cmd"
then
echo "$var=$p/$cmd; export $var"
break
fi
found=$(find "$p/$cmd"* -type f 2>/dev/null | head -n 1)
if test -f "$found"
then
echo "$var=$found; export $var"
break
fi
done
)
done
Wall='-Wall -Wdeclaration-after-statement' tests= jobs=
case `uname` in
OpenBSD)
NEEDS_CRYPTO_WITH_SSL=YesPlease ; export NEEDS_CRYPTO_WITH_SSL
GIT_SKIP_TESTS="t9200 t9502 $GIT_SKIP_TESTS"; export GIT_SKIP_TESTS
SHELL_PATH=/usr/local/bin/bash; export SHELL_PATH
NO_PEDANTIC=CannotDo NO_JOBS=CannotDo
Wall=
;;
FreeBSD)
OLD_ICONV=YesPlease; export OLD_ICONV
GIT_SKIP_TESTS="t5560 $GIT_SKIP_TESTS"; export GIT_SKIP_TESTS
;;
SunOS)
NEEDS_CRYPTO_WITH_SSL=YesPlease ; export NEEDS_CRYPTO_WITH_SSL
GIT_SKIP_TESTS="$GIT_SKIP_TESTS"; export GIT_SKIP_TESTS
NO_PEDANTIC=CannotDo Wall=
;;
esac
while case $# in 0) break ;; esac
do
case "$1" in
-pedantic | --pedantic)
o= &&
rev=$($GIT rev-parse HEAD) &&
case "$($GIT merge-base "$old_style_def_fix" "$rev")" in
$old_style_def_fix)
o=-Wold-style-definition ;;
esac
case "$NO_PEDANTIC" in
?*) ;;
'')
O="$O -Werror $o -std=c99 -Wno-pointer-to-int-cast"
O="$O -Wpointer-arith"
;;
esac
# -Wvla
# O="$O -fwrapv -fno-strict-overflow"
;;
-j*)
case "$NO_JOBS" in
?*) jobs= ;;
'') jobs=$1 ;;
esac
;;
-loose | --loose)
Wall=
;;
--locale=*)
LANG=${1#*=}
;;
--test=*)
tests=$(
cd t &&
for t in ${1#*=}
do
eval echo "t$t-*.sh"
done | tr '\012' ' '
)
;;
--)
shift
break
;;
-*)
echo >&2 "Eh $1?"
exit 1
;;
*)
break
;;
esac
shift
done
LC_ALL=$LANG
export LANG LC_ALL
head=`$GIT symbolic-ref HEAD 2>/dev/null` &&
branch=`expr "$head" : 'refs/heads/\(.*\)'` || branch=detached
case "$branch" in
next | maint | master | pu | jch)
prefix="$inst_prefix/git-$branch"
;;
snap)
v=`$GIT describe HEAD`
expr "$v" : '.*-g[0-9a-f]*$' >/dev/null && {
echo >&2 "You are on 'snap' but $v is not an official version."
exit 1
}
prefix="$inst_prefix/git-snap-$v"
;;
*)
prefix="$inst_prefix/git-test" ;;
esac
d="prefix=$prefix"
sh -c 'git describe --abbrev=4 HEAD' >/dev/null 2>&1 || {
$GIT describe --abbrev=4 HEAD | sed -e 's/-/./g' >version
}
d="$d "'
MAN_BASE_URL="http://www.kernel.org/pub/software/scm/git/docs/"
ASCIIDOC_NO_ROFF=YesPlease
ASCIIDOC8=YesPlease
BLK_SHA1=YesPlease
GNU_ROFF=YesPlease'
# Platform hack
if test -z "${make:+set}" && {
test -x /usr/local/bin/gmake ||
test -x /usr/bin/gmake
}
then
make=gmake
fi
if test -f /bin/ginstall
then
set INSTALL=ginstall "$@"
fi
CFLAGS="$O $Wall -g"
OK_TO_USE_CFLAGS=Yes
if test -n "${NO_CFLAGS+set}"
then
unset OK_TO_USE_CFLAGS
fi
${make-make} $d \
ETC_GITCONFIG=$prefix/etc/gitconfig \
${OK_TO_USE_CFLAGS+"CFLAGS=$CFLAGS"} \
${tests:+"T=$tests"} \
$jobs \
"$@"
status=$?
rm -f version
exit $status