bjarni@2722: # $Id: Makefile 3214 2005-11-17 19:43:37Z bjarni $ bjarni@2722: # This makefile is not a standalone makefile, but is called from the general one bjarni@2722: # it contains code specific to MacOS X bjarni@2722: bjarni@2722: ifdef RELEASE bjarni@2722: ifndef STATIC bjarni@2722: # all OSX releases needs to be static bjarni@2722: # end users don't tend to have the dynamic libs installed bjarni@2722: $(warning Compiling a dynamic release. It should be static unless you really know what you are doing!!!) bjarni@2722: endif bjarni@2722: endif bjarni@2722: bjarni@2722: ifdef RELEASE bjarni@2728: ifndef FAT_BINARY bjarni@2722: $(warning Compiling a release build, that is not a universal binary) bjarni@2722: endif bjarni@2722: endif bjarni@2722: bjarni@2728: ifdef FAT_BINARY bjarni@2728: ifndef STATIC bjarni@2728: $(warning Compiling a universal binary, that is not static. Adding static flag) bjarni@2728: STATIC:=1 bjarni@2728: endif bjarni@2728: endif bjarni@2728: bjarni@2722: ifdef RELEASE bjarni@2722: ifdef DEBUG bjarni@2722: $(warning Compiling a release build, that is a debug build) bjarni@2722: endif bjarni@2722: endif bjarni@2722: bjarni@2729: ifdef JAGUAR bjarni@2729: ifdef FAT_BINARY bjarni@2729: $(error FAT_BINARY and JAGUAR can't be used at the same time) bjarni@2729: endif bjarni@2729: endif bjarni@2729: bjarni@2722: # setup flags if none are defined bjarni@2729: ifndef CFLAGS_JAGUAR bjarni@2729: CFLAGS_JAGUAR:= -isysroot /Developer/SDKs/MacOSX10.2.8.sdk bjarni@2729: endif bjarni@2729: ifndef LDFLAGS_JAGUAR bjarni@2729: LDFLAGS_JAGUAR:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.2.8.sdk bjarni@2729: endif bjarni@2729: bjarni@2729: ifndef PPC_CC bjarni@2729: PPC_CC:=powerpc-apple-darwin8-gcc-4.0.0 bjarni@2729: endif bjarni@2728: ifndef CFLAGS_PPC bjarni@2728: CFLAGS_PPC:= -isysroot /Developer/SDKs/MacOSX10.3.9.sdk bjarni@2722: endif bjarni@2728: ifndef LDFLAGS_PPC bjarni@2728: LDFLAGS_PPC:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.3.9.sdk bjarni@2722: endif bjarni@2728: ifndef CFLAGS_x86 bjarni@2728: CFLAGS_x86:= -isysroot /Developer/SDKs/MacOSX10.4u.sdk bjarni@2728: endif bjarni@2728: ifndef LDFLAGS_x86 bjarni@2728: LDFLAGS_x86:= -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk bjarni@2728: endif bjarni@2722: ifndef x86_CC bjarni@2722: x86_CC:=i686-apple-darwin8-gcc-4.0.0 bjarni@2722: endif bjarni@2722: ifdef WITH_PNG bjarni@2722: ifndef LIBPNG_PPC_CONFIG bjarni@2722: LIBPNG_PPC_CONFIG:=$(LIBPNG-CONFIG) bjarni@2722: endif bjarni@2722: ifndef LIBPNG_x86_CONFIG bjarni@2722: LIBPNG_x86_CONFIG:=$(LIBPNG-CONFIG) bjarni@2722: endif bjarni@2722: endif bjarni@2722: ifdef WITH_SDL bjarni@2722: ifndef SDL_PPC_CONFIG bjarni@2722: SDL_PPC_CONFIG:=$(SDL-CONFIG) bjarni@2722: endif bjarni@2722: ifndef SDL_x86_CONFIG bjarni@2722: SDL_x86_CONFIG:=$(SDL-CONFIG) bjarni@2722: endif bjarni@2728: ifndef x86_SDL_LIB bjarni@2728: x86_SDL_LIB:=$(shell echo "`$(SDL_x86_CONFIG) --prefix`/lib/libSDL-1.2.0.dylib") bjarni@2728: endif bjarni@2722: endif bjarni@2722: bjarni@2728: ifdef FAT_BINARY bjarni@2722: # set up config files bjarni@2722: ifndef SKIP_LIB_TEST bjarni@2722: ifdef WITH_PNG bjarni@2722: TEST:=$(shell lipo -info `$(LIBPNG_PPC_CONFIG) --prefix`/lib/libpng.a | xargs -n 1 | grep "ppc")) bjarni@2722: ifndef TEST bjarni@2722: $(error no PPC libpng found) bjarni@2722: endif bjarni@2722: TEST:=$(shell lipo -info `$(LIBPNG_x86_CONFIG) --prefix`/lib/libpng.a | xargs -n 1 | grep "i386")) bjarni@2722: ifndef TEST bjarni@2722: $(error no x86 libpng found) bjarni@2722: endif bjarni@2722: endif bjarni@2722: bjarni@2722: ifdef WITH_SDL bjarni@2722: ifdef STATIC bjarni@2722: ifndef x86_SDL_LIB bjarni@2722: $(error static universal build without a defined x86 SDL lib) bjarni@2722: endif bjarni@2722: endif bjarni@2722: TEST:=$(shell lipo -info `$(SDL_PPC_CONFIG) --prefix`/lib/libSDL.a | xargs -n 1 | grep "ppc")) bjarni@2722: ifndef TEST bjarni@2722: $(error no PPC SDL lib found) bjarni@2722: endif bjarni@2722: TEST:=$(shell lipo -info `$(SDL_x86_CONFIG) --prefix`/lib/libSDL.a | xargs -n 1 | grep "i386")) bjarni@2722: ifndef TEST bjarni@2722: $(error no x86 SDL lib found) bjarni@2722: endif bjarni@2722: endif bjarni@2722: endif bjarni@2722: bjarni@2722: ifdef UNIVERSAL_x86_PART bjarni@2722: LIBPNG-CONFIG:=$(LIBPNG_x86_CONFIG) bjarni@2722: SDL-CONFIG:=$(SDL_x86_CONFIG) bjarni@2722: CC_TARGET:=$(x86_CC) bjarni@2722: # clear the cached list of PPC libs bjarni@2722: LIBS:= bjarni@2728: CFLAGS:= $(CFLAGS_x86) -arch i386 bjarni@2728: LDFLAGS:= $(LDFLAGS_x86) bjarni@2722: else bjarni@2722: LIBPNG-CONFIG:=$(LIBPNG_PPC_CONFIG) bjarni@2722: SDL-CONFIG:=$(SDL_PPC_CONFIG) bjarni@2722: CC_TARGET:=$(PPC_CC) bjarni@2728: CFLAGS:= $(CFLAGS_PPC) -arch ppc bjarni@2728: LDFLAGS:= $(LDFLAGS_PPC) bjarni@2722: endif bjarni@2722: endif bjarni@2729: bjarni@2729: ifdef JAGUAR bjarni@2729: CFLAGS:=$(CFLAGS_JAGUAR) bjarni@2729: LDFLAGS:=$(LDFLAGS_JAGUAR) bjarni@2729: # network support is broken is jaguar (OSX 10.2) bjarni@2729: WITH_NETWORK:= bjarni@2729: # crosscompiling for jaguar should always be static bjarni@2729: STATIC:=1 bjarni@2730: # libpng appears to break it too bjarni@2730: WITH_PNG:= bjarni@2729: endif