LIBOGGDIR := libogg-1.0
LIBVORBISDIR := libvorbis-1.0.1
-EXE := $(RUNDIR)/lugaru-bin
+
+ifeq ($(strip $(macosx_arch)),)
+ macosx_arch := i386
+endif
+
+ifeq ($(strip $(macosx)),true)
+ EXEEXT := $(macosx_arch)
+else
+ EXEEXT := bin
+endif
+
+EXE := $(RUNDIR)/lugaru-$(EXEEXT)
ifeq ($(strip $(macosx)),true)
CXX := g++-4.0
CFLAGS += -mdynamic-no-pic
LDFLAGS := -framework Cocoa -framework OpenGL -framework IOKit -framework CoreFoundation -framework Carbon -framework OpenAL
APPLDFLAGS := ./libSDL-1.2.0.dylib ./libSDLmain-osx.a
- APPLDFLAGS := /usr/local/lib/libSDL-1.2.0.dylib /usr/local/lib/libSDLmain.a
ifneq ($(strip $(macosx_arch)),)
CFLAGS += -arch $(macosx_arch)
LDFLAGS += -arch $(macosx_arch)
$(EXE) : $(OBJS) $(APPOBJS)
@mkdir -p $(dir $@)
-#ifeq ($(strip $(macosx)),true)
-# ranlib ./libSDLmain-osx.a libSDLmain-osx-ranlib
-#endif
$(LD) -o $@ $(APPLDFLAGS) $(LDFLAGS) $(OBJS) $(APPOBJS) $(POSTLDFLAGS)
clean:
--- /dev/null
+#!/bin/sh
+
+set -e
+set -x
+
+NCPU=`sysctl -n hw.ncpu`
+
+for arch in ppc i386 x86_64 ; do
+ make macosx=true macosx_arch=$arch clean
+ make macosx=true macosx_arch=$arch -j$NCPU
+ BINS="$BINS run/lugaru-$arch"
+done
+
+rm -f run/lugaru-bin
+lipo -create -o run/lugaru-bin $BINS
+