diff --git a/Quake/Makefile b/Quake/Makefile index 57db1118..9ca66e58 100644 --- a/Quake/Makefile +++ b/Quake/Makefile @@ -45,6 +45,7 @@ STRIP ?= strip #CPUFLAGS= -mtune=k8 #CPUFLAGS= -march=atom CPUFLAGS= +LDFLAGS = DFLAGS ?= CFLAGS ?= -Wall -Wno-trigraphs # CFLAGS += -Werror @@ -255,7 +256,7 @@ OBJS := strlcat.o \ # ------------------------ quakespasm: $(OBJS) - $(LINKER) $(OBJS) $(X11_LFLAGS) $(LIBS) $(SDL_LIBS) -o $@ + $(LINKER) $(OBJS) $(X11_LFLAGS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@ $(call do_strip,$@) release: quakespasm diff --git a/Quake/Makefile.darwin b/Quake/Makefile.darwin index 45bd8191..2da77dc2 100644 --- a/Quake/Makefile.darwin +++ b/Quake/Makefile.darwin @@ -44,12 +44,15 @@ LIPO ?= lipo STRIP ?= strip CPUFLAGS= +LDFLAGS = # require 10.5 for 64 bit builds ifeq ($(MACH_TYPE),x86_64) CPUFLAGS+=-mmacosx-version-min=10.5 +LDFLAGS +=-mmacosx-version-min=10.5 endif ifeq ($(MACH_TYPE),ppc64) CPUFLAGS+=-mmacosx-version-min=10.5 +LDFLAGS +=-mmacosx-version-min=10.5 endif DFLAGS ?= CFLAGS ?= -Wall @@ -250,7 +253,7 @@ OBJS := strlcat.o \ # ------------------------ quakespasm: $(OBJS) - $(LINKER) $(OBJS) $(SDL_LIBS) $(LIBS) -o $@ + $(LINKER) $(OBJS) $(SDL_LIBS) $(LDFLAGS) $(LIBS) -o $@ $(call do_strip,$@) release: quakespasm diff --git a/Quake/Makefile.w32 b/Quake/Makefile.w32 index 5257c7c0..3bfae3d2 100644 --- a/Quake/Makefile.w32 +++ b/Quake/Makefile.w32 @@ -54,6 +54,7 @@ STRIP = $(TOOLCHAIN_PREFIX)strip #CPUFLAGS= -mtune=i686 #CPUFLAGS= -march=pentium4 CPUFLAGS= +LDFLAGS = DFLAGS ?= CFLAGS ?= -Wall -Wno-trigraphs # CFLAGS += -Werror @@ -258,7 +259,7 @@ OBJS := strlcat.o \ # ------------------------ quakespasm.exe: $(OBJS) - $(LINKER) $(OBJS) $(LIBS) $(SDL_LIBS) -o $@ + $(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@ $(call do_strip,$@) release: quakespasm.exe diff --git a/Quake/Makefile.w64 b/Quake/Makefile.w64 index d42fef00..01d9da0e 100644 --- a/Quake/Makefile.w64 +++ b/Quake/Makefile.w64 @@ -54,6 +54,7 @@ STRIP = $(TOOLCHAIN_PREFIX)strip #CPUFLAGS= -mtune=k8 #CPUFLAGS= -march=atom CPUFLAGS= +LDFLAGS = DFLAGS ?= CFLAGS ?= -Wall -Wno-trigraphs # CFLAGS += -Werror @@ -258,7 +259,7 @@ OBJS := strlcat.o \ # ------------------------ quakespasm.exe: $(OBJS) - $(LINKER) $(OBJS) $(LIBS) $(SDL_LIBS) -o $@ + $(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@ $(call do_strip,$@) release: quakespasm.exe diff --git a/Quake/build_cross_osx.sh b/Quake/build_cross_osx.sh new file mode 100755 index 00000000..85e9bd93 --- /dev/null +++ b/Quake/build_cross_osx.sh @@ -0,0 +1,57 @@ +#!/bin/sh + +rm -f quakespasm.ppc \ + quakespasm.x86 \ + quakespasm.x86_64 \ + QuakeSpasm +make clean + +OLDPATH=$PATH +MAKE_CMD=make + +OSXBUILD=1 +export OSXBUILD +STRIP=/bin/true +export STRIP + +# ppc +PATH=/opt/cross_osx-ppc/bin:$OLDPATH +CC=powerpc-apple-darwin9-gcc +AS=powerpc-apple-darwin9-as +AR=powerpc-apple-darwin9-ar +RANLIB=powerpc-apple-darwin9-ranlib +LIPO=powerpc-apple-darwin9-lipo +export PATH CC AS AR RANLIB LIPO +$MAKE_CMD MACH_TYPE=ppc -f Makefile.darwin $* || exit 1 +powerpc-apple-darwin9-strip -S quakespasm || exit 1 +mv quakespasm quakespasm.ppc || exit 1 +$MAKE_CMD clean + +# x86 +PATH=/opt/cross_osx-x86/bin:$OLDPATH +CC=i686-apple-darwin9-gcc +AS=i686-apple-darwin9-as +AR=i686-apple-darwin9-ar +RANLIB=i686-apple-darwin9-ranlib +LIPO=i686-apple-darwin9-lipo +export PATH CC AS AR RANLIB LIPO +$MAKE_CMD MACH_TYPE=x86 -f Makefile.darwin $* || exit 1 +i686-apple-darwin9-strip -S quakespasm || exit 1 +mv quakespasm quakespasm.x86 || exit 1 +$MAKE_CMD clean + +# x86_64 +PATH=/opt/cross_osx-x86_64/usr/bin:$OLDPATH +CC=x86_64-apple-darwin9-gcc +AS=x86_64-apple-darwin9-as +AR=x86_64-apple-darwin9-ar +RANLIB=x86_64-apple-darwin9-ranlib +LIPO=x86_64-apple-darwin9-lipo +export PATH CC AS AR RANLIB LIPO +$MAKE_CMD MACH_TYPE=x86_64 -f Makefile.darwin $* || exit 1 +x86_64-apple-darwin9-strip -S quakespasm || exit 1 +mv quakespasm quakespasm.x86_64 || exit 1 +$MAKE_CMD clean + +$LIPO -create -o QuakeSpasm quakespasm.ppc quakespasm.x86 quakespasm.x86_64 || exit 1 + diff --git a/Quake/build_cross_win32.sh b/Quake/build_cross_win32.sh new file mode 100755 index 00000000..82880be3 --- /dev/null +++ b/Quake/build_cross_win32.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Change this script to meet your needs and/or environment. + +#TARGET=i386-mingw32msvc +#TARGET=i686-w64-mingw32 +TARGET=i686-pc-mingw32 +#PREFIX=/opt/cross_win32 +PREFIX=/usr/local/cross-win32 + +PATH="$PREFIX/bin:$PATH" +export PATH + +MAKE_CMD=make + +SDL_CONFIG=/usr/local/sdl_w32/bin/sdl-config +CC="$TARGET-gcc" +AS="$TARGET-as" +RANLIB="$TARGET-ranlib" +AR="$TARGET-ar" +WINDRES="$TARGET-windres" +STRIP="$TARGET-strip" +export PATH CC AS AR RANLIB WINDRES STRIP + +exec $MAKE_CMD SDL_CONFIG=$SDL_CONFIG CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR WINDRES=$WINDRES STRIP=$STRIP -f Makefile.w32 $* diff --git a/Quake/build_cross_win64.sh b/Quake/build_cross_win64.sh new file mode 100755 index 00000000..8d1ccbdf --- /dev/null +++ b/Quake/build_cross_win64.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +# Change this script to meet your needs and/or environment. + +#TARGET=x86_64-pc-mingw32 +TARGET=x86_64-w64-mingw32 +PREFIX=/opt/cross_win64 + +PATH="$PREFIX/bin:$PATH" +export PATH + +MAKE_CMD=make + +SDL_CONFIG=/opt/sdl_w64/bin/sdl-config +CC="$TARGET-gcc" +AS="$TARGET-as" +RANLIB="$TARGET-ranlib" +AR="$TARGET-ar" +WINDRES="$TARGET-windres" +STRIP="$TARGET-strip" +export PATH CC AS AR RANLIB WINDRES STRIP + +exec $MAKE_CMD SDL_CONFIG=$SDL_CONFIG CC=$CC AS=$AS RANLIB=$RANLIB AR=$AR WINDRES=$WINDRES STRIP=$STRIP -f Makefile.w64 $*