/
pbxbuild.sh
executable file
·96 lines (84 loc) · 2.24 KB
/
pbxbuild.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
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
#!/bin/sh
#
# usage: pbxbuild.sh [options] [assignments...]
# options: -target <tname> Build only the target named <tname>
# -buildstyle <bsname> Use the build style named <bsname>
#
USAGE_TEXT='usage: pbxbuild.sh [options] [actions...] [assignments...]
options: -target <tname> Build only the target named <tname>
-buildstyle <bsname> Use the build style named <bsname>'
Target=
BuildStyle=
Actions=
Assignments=
# We change into the directory that contains the pbxbuild.sh script.
cd "`dirname -- "$0"`"
IFS='
'
while [ $# -gt 0 ] ; do
case ${1} in
-h | -help | -usage)
echo "$USAGE_TEXT"
exit 0
;;
-target)
shift
if [ ! -z ${1} ]; then
Target="${1}"
fi
shift
;;
-buildstyle)
shift
if [ ! -z ${1} ]; then
BuildStyle="${1}"
fi
shift
;;
-*)
echo "pbxbuild: invalid option '"${1}"'"
echo "$USAGE_TEXT"
exit 1
;;
*=*)
if [ -z ${Assignments} ]; then
Assignments="${1}"
else
Assignments="${Assignments}${IFS}${1}"
fi
shift
;;
*)
if [ -z ${Actions} ]; then
Actions="${1}"
else
Actions="${Actions}${IFS}${1}"
fi
shift
;;
esac
done
# Set up access paths
DataPath=pbxbuild.data
# The default action is 'build'
if [ -z "${Actions}" ]; then
Actions=build
fi
# Set up target information
. "${DataPath}/TargetNames"
for Action in ${Actions}; do
for Target in ${Targets}; do
TargetPath="${DataPath}/${Target}.build"
echo
echo "*** ${Action} ${Target} ***"
echo jam -d2 ${Action} JAMFILE=\"${TargetPath}/Jamfile.jam\" JAMBASE=pbxbuild.data/ProjectBuilderJambase TARGETNAME=\"${Target}\" BUILD_STYLE="${BuildStyle}" ACTION=${Action} OS=darwin NATIVE_ARCH=`arch` SRCROOT=\"`pwd`\" OBJROOT=\"`pwd`/obj\" SYMROOT=\"`pwd`/sym\" DSTROOT=\"`pwd`/dst\" ${Assignments}
/Developer/Private/jam -d2 ${Action} JAMFILE="${TargetPath}/Jamfile.jam" JAMBASE=pbxbuild.data/ProjectBuilderJambase TARGETNAME="${Target}" BUILD_STYLE="${BuildStyle}" ACTION=${Action} OS=darwin NATIVE_ARCH=`arch` SRCROOT="`pwd`" OBJROOT="`pwd`/obj" SYMROOT="`pwd`/sym" DSTROOT="`pwd`/dst" ${Assignments}
if [ $? != 0 ]; then
echo "*** ${Action} ${Target} FAILED ***"
exit 1
fi
done
done
echo
echo "*** BUILD SUCCEEDED ***"
exit 0