(svn r3882) -Codechange: [OSX] changed the way universal and tripple binaries are build
Instead of compiling a binary for each arch and then join them in the end, each .o file is now compiled as a fat file
This means that the makefile will not call itself to make a binary for each target and we don't have to make clean between each build
it also means that if one file changed, we don't have to recompile all files
Another benefit is since it's handled at .o level and though LDFLAGS, no special code is needed if we decide to compile more binaries (like a lot of stuff used to happen at post linking)
We also needs much less flags to set up, so it should be even easier to get to work out of the box now
The tradeoff in doing so is that now the binary needs at least OSX 10.3.9 to execute
To deal with this issue, the JAGUAR flag can be used to compile for older OSes. We will release a binary for old OSes at next release to see if anybody even downloads it (not that many people use OSX 10.2 anymore)
GPMI will not work on 10.2 anyway so we will cut support for it some day anyway
# $Id: Makefile 3214 2005-11-17 19:43:37Z bjarni $
# This makefile is not a standalone makefile, but is called from the general one
# it contains code specific to MacOS X
ifdef RELEASE
ifndef STATIC
# all OSX releases needs to be static
# end users don't tend to have the dynamic libs installed
$(warning Compiling a dynamic release. It should be static unless you really know what you are doing!!!)
endif
endif
ifdef RELEASE
ifndef UNIVERSAL_BINARY
$(warning Compiling a release build, that is not a universal binary)
endif
endif
ifdef TRIPPLE_BINARY
ifdef DEBUG
$(error no G5 optimisation is made in debug builds, so tripple binaries aren't possible. Use UNIVERSAL_BINARY instead if you really want a universal debug build)
endif
UNIVERSAL_BINARY:=1
endif
ifndef UNIVERSAL_BINARY
ifndef JAGUAR
ifeq ($(shell uname), Darwin)
# it's a hardware mac, not crosscompiling
$(shell $(CC) os/macosx/G5_detector.c -o os/macosx/G5_detector)
IS_G5:=$(shell os/macosx/G5_detector)
endif
endif
endif
ifdef UNIVERSAL_BINARY
ifndef STATIC
$(warning Compiling a universal binary, that is not static. Adding static flag)
STATIC:=1
endif
endif
ifdef RELEASE
ifdef DEBUG
$(warning Compiling a release build, that is a debug build)
endif
endif
# setup flags if none are defined
ifndef CFLAGS_JAGUAR
CFLAGS_JAGUAR:= -isysroot /Developer/SDKs/MacOSX10.2.8.sdk
endif
ifndef LDFLAGS_JAGUAR
LDFLAGS_JAGUAR:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk
endif
ifndef CFLAGS_UNIVERSAL
CFLAGS_UNIVERSAL:= -isysroot /Developer/SDKs/MacOSX10.4u.sdk
endif
ifndef LDFLAGS_UNIVERSAL
LDFLAGS_UNIVERSAL:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
endif
ifdef JAGUAR
CFLAGS:= $(CFLAGS_JAGUAR) -arch ppc
LDFLAGS:= $(LDFLAGS_JAGUAR)
endif
ifndef G5_FLAGS
G5_FLAGS := -mtune=970 -mcpu=970 -mpowerpc-gpopt
endif
ifdef UNIVERSAL_BINARY
TARGET_CPU_FLAGS:= -arch ppc -arch i386
LDFLAGS := $(LDFLAGS_UNIVERSAL) -arch ppc -arch i386
CFLAGS += $(CFLAGS_UNIVERSAL)
ifdef TRIPPLE_BINARY
LDFLAGS += -arch ppc970
endif
endif