]> Shamusworld >> Repos - virtualjaguar/blobdiff - jaguarcore.mak
Added bits & pieces to allow cross compilation under MXE.
[virtualjaguar] / jaguarcore.mak
index 1bcafe0e1baec2b0737fcc46d5a3839dc852a263..89faa3bad1e42c1779da55d6a5a3520772aaf89a 100644 (file)
@@ -7,8 +7,12 @@
 # file GPLv3 for details. ;-)
 #
 
+# Cross compilation with MXE
+#CROSS = i686-pc-mingw32-
+
 # Figure out which system we're compiling for, and set the appropriate variables
 
+ifeq "$(CROSS)" ""
 OSTYPE := $(shell uname -a)
 
 # Win32
@@ -34,6 +38,10 @@ else
 
 $(error OS TYPE UNDETECTED)
 
+endif
+else
+SYSTYPE    := __GCCWIN32__
+SDLLIBTYPE := --libs
 endif
 
 # Set vars for libcdio
@@ -45,10 +53,10 @@ HAVECDIO :=
 CDIOLIB  :=
 endif
 
-CC       := gcc
-LD       := gcc
-AR       := ar
-ARFLAGS  := -rs
+CC      := $(CROSS)gcc
+LD      := $(CROSS)gcc
+AR      := $(CROSS)ar
+ARFLAGS := -rs
 
 # Note that we use optimization level 2 instead of 3--3 doesn't seem to gain much over 2
 #CFLAGS  := -MMD -O2 -ffast-math -fomit-frame-pointer `sdl-config --cflags` -D$(SYSTYPE)
@@ -56,7 +64,7 @@ ARFLAGS  := -rs
 CFLAGS ?= -O2 -ffast-math -fomit-frame-pointer
 CXXFLAGS ?= -O2 -ffast-math -fomit-frame-pointer
 
-SDL_CFLAGS = `sdl-config --cflags`
+SDL_CFLAGS = `$(CROSS)sdl-config --cflags`
 DEFINES = -D$(SYSTYPE)
 GCC_DEPS = "-MMD"