From 3e6760e6c589417b2767cd197e754b7bb3217a4b Mon Sep 17 00:00:00 2001 From: sezero Date: Tue, 17 Aug 2010 19:30:35 +0000 Subject: [PATCH] Makefile.w32, Makefile.w64: made them a little bit more flexible by adding CROSS_COMPILE and TARGET variables. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@280 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/Makefile.w32 | 18 ++++++++++++++---- quakespasm/Quake/Makefile.w64 | 18 ++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/quakespasm/Quake/Makefile.w32 b/quakespasm/Quake/Makefile.w32 index 8071d324..afaa30d7 100644 --- a/quakespasm/Quake/Makefile.w32 +++ b/quakespasm/Quake/Makefile.w32 @@ -1,5 +1,5 @@ # GNU Makefile for cross-compiling quakespasm.exe (Win32 : MinGW) -# using cross-toolchains on a linux host / June 21, 2010. +# using cross-toolchains on a linux host / Aug. 17, 2010. # "make DEBUG=1" builds debug client # "make WINSOCK2=1" to use WinSock2 api when not using SDL_net. otherwise, # WinSock 1.1 will be used. @@ -25,9 +25,19 @@ TOPDIR := $(shell pwd) # Define some build variables # --------------------------------------- -CC = i686-pc-mingw32-gcc -WINDRES = i686-pc-mingw32-windres -STRIP = i686-pc-mingw32-strip +TARGET=i686-pc-mingw32 + +CROSS_COMPILE=1 + +ifeq ($(CROSS_COMPILE),1) +TOOLCHAIN_PREFIX=$(TARGET)- +else +TOOLCHAIN_PREFIX= +endif + +CC = $(TOOLCHAIN_PREFIX)gcc +WINDRES = $(TOOLCHAIN_PREFIX)windres +STRIP = $(TOOLCHAIN_PREFIX)strip #CPUFLAGS= -mtune=i686 #CPUFLAGS= -march=pentium4 diff --git a/quakespasm/Quake/Makefile.w64 b/quakespasm/Quake/Makefile.w64 index d495f1d1..82527ce8 100644 --- a/quakespasm/Quake/Makefile.w64 +++ b/quakespasm/Quake/Makefile.w64 @@ -1,5 +1,5 @@ # GNU Makefile for cross-compiling quakespasm.exe (Win64 : MinGW-w64) -# using cross-toolchains on a linux host / June 21, 2010. +# using cross-toolchains on a linux host / Aug. 17, 2010. # "make DEBUG=1" builds debug client # "make WINSOCK2=0" to use the old WinSock 1.1 api when not using SDL_net. # otherwise, WinSock2 api will be used. @@ -25,9 +25,19 @@ TOPDIR := $(shell pwd) # Define some build variables # --------------------------------------- -CC = x86_64-w64-mingw32-gcc -WINDRES = x86_64-w64-mingw32-windres -STRIP = x86_64-w64-mingw32-strip +TARGET=x86_64-w64-mingw32 + +CROSS_COMPILE=1 + +ifeq ($(CROSS_COMPILE),1) +TOOLCHAIN_PREFIX=$(TARGET)- +else +TOOLCHAIN_PREFIX= +endif + +CC = $(TOOLCHAIN_PREFIX)gcc +WINDRES = $(TOOLCHAIN_PREFIX)windres +STRIP = $(TOOLCHAIN_PREFIX)strip #CPUFLAGS= -mtune=k8 #CPUFLAGS= -march=atom