OSDN Git Service

translate some words in frmMain.cs
[handbrake-jp/handbrake-jp.git] / make / xcodemake
1 #!/bin/bash
2 #
3
4 set -e
5
6 ## This script is invoked by Xcode external targets.
7 ##
8 ## We must guarantee no jobserver is passed through since the file-descriptors
9 ## have been clobbered by Xcode. If this is not done then make behaves as if
10 ## it is allowed to run an infinite number of jobs.
11 ##
12 MAKEFLAGS=
13 MFLAGS=
14
15 ## sanity check - the build system only supports 1 arch at a time
16 archcount=`echo $ARCHS | awk '{ print NF }'`
17 if [ "$archcount" -ne 1 ]; then
18     echo "*********************************************************************"
19     echo "***"
20     echo "*** ERROR: invalid number of architectures: $ARCHS"
21     echo "*** This build system builds one (1) archtecture at a time."
22     echo "***"
23     echo "*********************************************************************"
24     exit 1
25 fi
26
27 ## compute if re/configure necessary
28 if [ $EXTERNAL_METHOD != 'xcode' ]; then
29     reconfigure="terminal -> Xcode"
30 elif [ ! -f $EXTERNAL_BUILD/GNUmakefile ]; then
31     reconfigure="no configuration present"
32 elif [ $EXTERNAL_SRC/make/configure.py -nt $EXTERNAL_BUILD/GNUmakefile ]; then
33     reconfigure="configure script was updated"
34 else
35     reconfigure=
36 fi
37
38 ## perform re/configure
39 if [ -n "$reconfigure" ]; then
40     echo "reconfiguring ($reconfigure)"
41
42     case "$CONFIGURATION" in
43     debug*)
44         debug="--debug=max --optimize=none"
45         ;;
46     standard*|*)
47         debug=
48         ;;
49     esac
50
51     ## invoke configure with (hidden) option which indicates conf performed by xcode
52     (set -x; $EXTERNAL_SRC/configure --force $EXTERNAL_CONFARGS \
53         --build=$EXTERNAL_BUILD --arch=$ARCHS $debug --conf-method=xcode PATH=$PATH )
54 fi
55
56 ## compute goals; these correlate with TARGET_NAME and ACTION from Xcode
57 spec="$TARGET_NAME:$ACTION"
58 echo "env specification: $spec"
59 case "$spec" in
60     contrib:clean)
61         goals=contrib.xclean
62         ;;
63     contrib:*)
64         goals=contrib.install
65         ;;
66     external:clean)
67         goals=clean
68         ;;
69     external:*)
70         if [ -z "$EXTERNAL_GOALS" ]; then
71             goals=build
72         else
73             goals="$EXTERNAL_GOALS"
74         fi
75         ;;
76     libhb:clean)
77         goals=libhb.clean
78         ;;
79     libhb:*)
80         goals=libhb.build
81         ;;
82     *)
83         echo "ERROR: invalid env specification: $spec"
84         exit 1
85         ;;
86 esac
87
88 ## safeguard against passing blank value which would result in unlimited jobs
89 if [ -z "$EXTERNAL_JOBS" ]; then
90     jobs=
91 else
92     jobs=--jobs=$EXTERNAL_JOBS
93 fi
94
95 ## log environment as provided by Xcode
96 logdir=$EXTERNAL_BUILD/log
97 if [ ! -d $logdir ]; then
98     mkdir -p $logdir
99 fi
100 env | sort > $logdir/xcodemake.env.txt
101
102 ## pull the trigger
103 ## must set BUILD.method != terminal to prevent inifinite recursion
104 set -x
105 exec make -C $EXTERNAL_BUILD BUILD.method=xcode $jobs $goals $EXTERNAL_VARS