- Makefile.darwin: -mmacosx-version-min also needs to be among

the linker flags for x86_64 builds. adjusted accordingly.
- build_cross_osx.sh, build_cross_win32.sh, build_cross_win64.sh:
  added the cross-compile scripts I have been using.
- Makefiles,other: added LDFLAGS variables for future use.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@704 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Ozkan Sezer 2012-09-03 21:21:04 +00:00
parent 64b53c510c
commit 6ca3fc377b
7 changed files with 115 additions and 4 deletions

View file

@ -45,6 +45,7 @@ STRIP ?= strip
#CPUFLAGS= -mtune=k8 #CPUFLAGS= -mtune=k8
#CPUFLAGS= -march=atom #CPUFLAGS= -march=atom
CPUFLAGS= CPUFLAGS=
LDFLAGS =
DFLAGS ?= DFLAGS ?=
CFLAGS ?= -Wall -Wno-trigraphs CFLAGS ?= -Wall -Wno-trigraphs
# CFLAGS += -Werror # CFLAGS += -Werror
@ -255,7 +256,7 @@ OBJS := strlcat.o \
# ------------------------ # ------------------------
quakespasm: $(OBJS) quakespasm: $(OBJS)
$(LINKER) $(OBJS) $(X11_LFLAGS) $(LIBS) $(SDL_LIBS) -o $@ $(LINKER) $(OBJS) $(X11_LFLAGS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@
$(call do_strip,$@) $(call do_strip,$@)
release: quakespasm release: quakespasm

View file

@ -44,12 +44,15 @@ LIPO ?= lipo
STRIP ?= strip STRIP ?= strip
CPUFLAGS= CPUFLAGS=
LDFLAGS =
# require 10.5 for 64 bit builds # require 10.5 for 64 bit builds
ifeq ($(MACH_TYPE),x86_64) ifeq ($(MACH_TYPE),x86_64)
CPUFLAGS+=-mmacosx-version-min=10.5 CPUFLAGS+=-mmacosx-version-min=10.5
LDFLAGS +=-mmacosx-version-min=10.5
endif endif
ifeq ($(MACH_TYPE),ppc64) ifeq ($(MACH_TYPE),ppc64)
CPUFLAGS+=-mmacosx-version-min=10.5 CPUFLAGS+=-mmacosx-version-min=10.5
LDFLAGS +=-mmacosx-version-min=10.5
endif endif
DFLAGS ?= DFLAGS ?=
CFLAGS ?= -Wall CFLAGS ?= -Wall
@ -250,7 +253,7 @@ OBJS := strlcat.o \
# ------------------------ # ------------------------
quakespasm: $(OBJS) quakespasm: $(OBJS)
$(LINKER) $(OBJS) $(SDL_LIBS) $(LIBS) -o $@ $(LINKER) $(OBJS) $(SDL_LIBS) $(LDFLAGS) $(LIBS) -o $@
$(call do_strip,$@) $(call do_strip,$@)
release: quakespasm release: quakespasm

View file

@ -54,6 +54,7 @@ STRIP = $(TOOLCHAIN_PREFIX)strip
#CPUFLAGS= -mtune=i686 #CPUFLAGS= -mtune=i686
#CPUFLAGS= -march=pentium4 #CPUFLAGS= -march=pentium4
CPUFLAGS= CPUFLAGS=
LDFLAGS =
DFLAGS ?= DFLAGS ?=
CFLAGS ?= -Wall -Wno-trigraphs CFLAGS ?= -Wall -Wno-trigraphs
# CFLAGS += -Werror # CFLAGS += -Werror
@ -258,7 +259,7 @@ OBJS := strlcat.o \
# ------------------------ # ------------------------
quakespasm.exe: $(OBJS) quakespasm.exe: $(OBJS)
$(LINKER) $(OBJS) $(LIBS) $(SDL_LIBS) -o $@ $(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@
$(call do_strip,$@) $(call do_strip,$@)
release: quakespasm.exe release: quakespasm.exe

View file

@ -54,6 +54,7 @@ STRIP = $(TOOLCHAIN_PREFIX)strip
#CPUFLAGS= -mtune=k8 #CPUFLAGS= -mtune=k8
#CPUFLAGS= -march=atom #CPUFLAGS= -march=atom
CPUFLAGS= CPUFLAGS=
LDFLAGS =
DFLAGS ?= DFLAGS ?=
CFLAGS ?= -Wall -Wno-trigraphs CFLAGS ?= -Wall -Wno-trigraphs
# CFLAGS += -Werror # CFLAGS += -Werror
@ -258,7 +259,7 @@ OBJS := strlcat.o \
# ------------------------ # ------------------------
quakespasm.exe: $(OBJS) quakespasm.exe: $(OBJS)
$(LINKER) $(OBJS) $(LIBS) $(SDL_LIBS) -o $@ $(LINKER) $(OBJS) $(LDFLAGS) $(LIBS) $(SDL_LIBS) -o $@
$(call do_strip,$@) $(call do_strip,$@)
release: quakespasm.exe release: quakespasm.exe

57
Quake/build_cross_osx.sh Executable file
View file

@ -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

25
Quake/build_cross_win32.sh Executable file
View file

@ -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 $*

23
Quake/build_cross_win64.sh Executable file
View file

@ -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 $*