X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=makefile;h=54b17068223753cde0f8a529d93f6e62eba12472;hb=256029f43f2892983287b8e5f06720e754a4000f;hp=70c58d7f64315587e88d76cc5a7dc20416cd9bfb;hpb=6a2cd7d1e34a3ee658cee995dad74020a9c7f4cc;p=lugaru.git diff --git a/makefile b/makefile index 70c58d7..54b1706 100644 --- a/makefile +++ b/makefile @@ -15,31 +15,35 @@ GLUDIR := GLU 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) -CXX := g++-4.0 -CC := gcc-4.0 -LD := g++-4.0 + EXEEXT := $(macosx_arch) else -CXX := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++ -CC := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/gcc -LD := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++ + EXEEXT := bin endif -#OPT := -O0 -OPT := -O3 -fno-strict-aliasing -falign-loops=16 -fno-math-errno -#OPT := -Os -fno-strict-aliasing +EXE := $(RUNDIR)/lugaru-$(EXEEXT) -# always use this on the Mac, even in debug builds, since we aren't building -# a dylib at this point. ifeq ($(strip $(macosx)),true) - OPT += -mdynamic-no-pic + CXX := g++-4.0 + CC := gcc-4.0 + LD := g++-4.0 +else + CXX := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++ + CC := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/gcc + LD := /opt/crosstool/gcc-4.1.2-glibc-2.3.6/i686-unknown-linux-gnu/i686-unknown-linux-gnu/bin/g++ endif +#OPT := -O0 +OPT := -O3 -fno-strict-aliasing -falign-loops=16 -fno-math-errno +#OPT := -Os -fno-strict-aliasing + DEFINES := \ -DPLATFORM_UNIX=1 \ - -DPLATFORM_LINUX=1 \ -DUSE_SDL=1 \ -DTRUE=1 \ -DFALSE=0 \ @@ -73,6 +77,11 @@ ifeq ($(strip $(macosx)),true) 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 + ifneq ($(strip $(macosx_arch)),) + CFLAGS += -arch $(macosx_arch) + LDFLAGS += -arch $(macosx_arch) + APPLDFLAGS += -arch $(macosx_arch) + endif else CFLAGS += -DPLATFORM_LINUX=1 LDFLAGS := ./libSDL-1.2.so.0 -Wl,-rpath,\$$ORIGIN @@ -309,9 +318,6 @@ $(BINDIR)/%.o : %.c $(EXE) : $(OBJS) $(APPOBJS) @mkdir -p $(dir $@) -ifeq ($(strip $(macosx)),true) - ranlib ./libSDLmain-osx.a -endif $(LD) -o $@ $(APPLDFLAGS) $(LDFLAGS) $(OBJS) $(APPOBJS) $(POSTLDFLAGS) clean: