forked from pieter/gitx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_libgit2.sh
executable file
·52 lines (43 loc) · 1014 Bytes
/
build_libgit2.sh
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
#!/bin/sh
# build_libgit2.sh
# GitX
#
# Created by BrotherBard on 7/3/10.
# Copyright 2010 BrotherBard. All rights reserved.
#
# based on: http://log.yeahrightkeller.com/post/270155578/run-script-while-cleaning-in-xcode
buildAction () {
echo "Building libgit2..."
if [[ -d .git ]]
then
export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`"$TARGET_BUILD_DIR"/gitx --git-path`
git submodule init
git submodule update
cd libgit2
rm -f libgit2.a
make CFLAGS="-arch i386 -arch ppc -arch x86_64"
ranlib libgit2.a
else
echo "error: Not a git repository."
echo "error: clone GitX first so that the libgit2 submodule can be updated"
exit 1
fi
}
cleanAction () {
echo "Cleaning libgit2..."
cd libgit2
make clean
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# MAIN
#echo "Running with ACTION=${ACTION}"
case $ACTION in
# NOTE: it gets set to "" rather than "build" when doing a build.
"")
buildAction
;;
"clean")
cleanAction
;;
esac
exit 0