@ -2,11 +2,14 @@
# This makefile is not a standalone makefile, but is called from the general one
# it contains targets specific to MacOS X
i f d e f F A T _ B I N A R Y
FAT_BINARY := build_universal_binary
i f d e f U N I V E R S A L _ B I N A R Y
i f d e f T R I P P L E _ B I N A R Y
TRIPPLE_BINARY := tripple_binary
e n d i f
UNIVERSAL_BINARY := build_universal_binary
e n d i f
i f d e f U N I V E R S A L _ x 8 6 _ P A R T
i f d e f U N I V E R S A L _ PP C _ P A R T
# the bundle is build by the PPC compile when making universal binaries
BUILD_OSX_BUNDLE :=
e l s e
@ -18,20 +21,30 @@ endif
# we make clean and compile the other one. In the end we use lipo to join them together
# when this is done, we can continue with the targets from the first run, which is build_OSX_bundle
$( FAT _BINARY): $( TTD )
$( UNIVERSAL _BINARY): $( TTD )
$( Q) mkdir -p temp_binary_dir
$( Q) cp $( TTD) temp_binary_dir/$( TTD) _a
$( Q) rm -rf $( TTD) $( OBJS) # delete all .o files so we can compile for a new endian
$( Q) make UNIVERSAL_x86 _PART:= 1
$( Q) rm -rf $( TTD) $( OBJS) # delete all .o files so we can compile for a new CPU
$( Q) make UNIVERSAL_PPC _PART:= 1
$( Q) cp $( TTD) temp_binary_dir/$( TTD) _b
@echo '===> Joining the PPC and x86 binaries into one universal one'
$( Q) lipo temp_binary_dir/$( TTD) _a temp_binary_dir/$( TTD) _b -create -output $( TTD)
$( Q) rm -rf temp_binary_dir
$(TRIPPLE_BINARY) : $( UNIVERSAL_BINARY )
$( Q) mkdir -p temp_binary_dir
$( Q) cp $( TTD) temp_binary_dir/$( TTD) _a
$( Q) rm -rf $( TTD) $( OBJS) # delete all .o files so we can compile for a new CPU
$( Q) make UNIVERSAL_PPC_PART:= 1 IS_G5:= 1
$( Q) cp $( TTD) temp_binary_dir/$( TTD) _b
@echo '===> Joining the Universal and G5 binaries into a tripple binary'
$( Q) lipo temp_binary_dir/$( TTD) _a temp_binary_dir/$( TTD) _b -create -output $( TTD)
$( Q) rm -rf temp_binary_dir
# build the bundle. OSX wants to keep apps in bundles, so we will give it one
# the good thing about bundles is that you can keep extra files in them, so we keep lng files and a data dir in it
$(BUILD_OSX_BUNDLE) : $( TTD ) $( FAT_BINARY )
$(BUILD_OSX_BUNDLE) : $( TTD ) $( UNIVERSAL_BINARY) $( TRIPPLE _BINARY)
@echo '===> Building application bundle'
$( Q) rm -fr " $( OSXAPP) "
$( Q) mkdir -p " $( OSXAPP) " /Contents/MacOS
@ -67,4 +80,4 @@ release: all
$(OSX) : $( TTD ) $( BUILD_OSX_BUNDLE )
.PHONY : release $( BUILD_OSX_BUNDLE ) $( FAT _BINARY)
.PHONY : release $( BUILD_OSX_BUNDLE ) $( UNIVERSAL _BINARY)