X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=make%2Fxcodemake;h=93c927c96c5584a56f71b15dfb581deaebd2df88;hb=3e441ebb595c36a1f2f029e4ce907bb1bffaea50;hp=a75cd3ed6d59712b203834619b75c67581576e90;hpb=c8d428d055c84eb606b2d3e946bb8d192a891e00;p=handbrake-jp%2Fhandbrake-jp-git.git diff --git a/make/xcodemake b/make/xcodemake index a75cd3ed..93c927c9 100755 --- a/make/xcodemake +++ b/make/xcodemake @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # set -e @@ -12,44 +12,50 @@ set -e MAKEFLAGS= MFLAGS= -cd $EXTERNAL_BUILD +## sanity check - the build system only supports 1 arch at a time +archcount=`echo $ARCHS | awk '{ print NF }'` +if [ "$archcount" -ne 1 ]; then + echo "*********************************************************************" + echo "***" + echo "*** ERROR: invalid number of architectures: $ARCHS" + echo "*** This build system builds one (1) archtecture at a time." + echo "***" + echo "*********************************************************************" + exit 1 +fi + +## compute if re/configure necessary +if [ $EXTERNAL_METHOD != 'xcode' ]; then + reconfigure="terminal -> Xcode" +elif [ ! -f $EXTERNAL_BUILD/GNUmakefile ]; then + reconfigure="no configuration present" +elif [ $EXTERNAL_SRC/make/configure.py -nt $EXTERNAL_BUILD/GNUmakefile ]; then + reconfigure="configure script was updated" +else + reconfigure= +fi + +## perform re/configure +if [ -n "$reconfigure" ]; then + echo "reconfiguring ($reconfigure)" -## re/configure if not configured by Xcode or if missing top-makefile -if [ $EXTERNAL_METHOD != 'xcode' -o ! -f $EXTERNAL_BUILD/GNUmakefile ]; then - ## compute --arch value based on Xcode configuration naming convention case "$CONFIGURATION" in - *.i386) - args="--arch=i386" - ;; - *.x86_64) - args="--arch=x86_64" - ;; - *.ppc) - args="--arch=ppc" + debug*) + debug="--debug=max --optimize=none" ;; - *.ppc64) - args="--arch=ppc64" - ;; - *) - args= + standard*|*) + debug= ;; esac ## invoke configure with (hidden) option which indicates conf performed by xcode - $EXTERNAL_PROJECT/configure PATH=$PATH --conf-method=xcode $args -fi - -## safeguard against passing blank value which would result in unlimited jobs -if [ -z "$EXTERNAL_JOBS" ]; then - jobs= -else - jobs=--jobs=$EXTERNAL_JOBS + (set -x; $EXTERNAL_SRC/configure --force $EXTERNAL_CONFARGS \ + --build=$EXTERNAL_BUILD --arch=$ARCHS $debug --conf-method=xcode PATH=$PATH ) fi +## compute goals; these correlate with TARGET_NAME and ACTION from Xcode spec="$TARGET_NAME:$ACTION" echo "env specification: $spec" - -## compute goals case "$spec" in contrib:clean) goals=contrib.xclean @@ -66,7 +72,6 @@ case "$spec" in else goals="$EXTERNAL_GOALS" fi - vars="$EXTERNAL_VARS" ;; libhb:clean) goals=libhb.clean @@ -80,6 +85,21 @@ case "$spec" in ;; esac -## handoff +## safeguard against passing blank value which would result in unlimited jobs +if [ -z "$EXTERNAL_JOBS" ]; then + jobs= +else + jobs=--jobs=$EXTERNAL_JOBS +fi + +## log environment as provided by Xcode +logdir=$EXTERNAL_BUILD/log +if [ ! -d $logdir ]; then + mkdir -p $logdir +fi +env | sort > $logdir/xcodemake.env.txt + +## pull the trigger +## must set BUILD.method != terminal to prevent inifinite recursion set -x -make -C $EXTERNAL_BUILD BUILD.method=xcode $jobs $goals $vars +exec make -C $EXTERNAL_BUILD BUILD.method=xcode $jobs $goals $EXTERNAL_VARS