]> Shamusworld >> Repos - virtualjaguar/blobdiff - jaguarcore.mak
Added option to enable logging automagically in Alpine mode.
[virtualjaguar] / jaguarcore.mak
index 1bcafe0e1baec2b0737fcc46d5a3839dc852a263..8d7971d00f32f50b4c1ae745d7d99190aa622930 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,20 +53,14 @@ HAVECDIO :=
 CDIOLIB  :=
 endif
 
-CC       := gcc
-LD       := gcc
-AR       := 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)
-#CXXFLAGS  := -MMD -O2 -ffast-math -fomit-frame-pointer `sdl-config --cflags` -D$(SYSTYPE)
-CFLAGS ?= -O2 -ffast-math -fomit-frame-pointer
-CXXFLAGS ?= -O2 -ffast-math -fomit-frame-pointer
+CC      := $(CROSS)gcc
+LD      := $(CROSS)gcc
+AR      := $(CROSS)ar
+ARFLAGS := -rs
 
-SDL_CFLAGS = `sdl-config --cflags`
+SDL_CFLAGS = `$(CROSS)sdl-config --cflags`
 DEFINES = -D$(SYSTYPE)
-GCC_DEPS = "-MMD"
+GCC_DEPS = -MMD
 
 INCS := -I./src
 
@@ -75,6 +77,7 @@ OBJS := \
        obj/filedb.o       \
        obj/gpu.o          \
        obj/jagbios.o      \
+       obj/jagbios2.o     \
        obj/jagcdbios.o    \
        obj/jagdevcdbios.o \
        obj/jagstub1bios.o \
@@ -109,14 +112,8 @@ obj/libjaguarcore.a: $(OBJS)
 
 # Main source compilation (implicit rules)...
 
-obj/%.o: src/%.c
-       @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
-#      @$(CC) $(CFLAGS) $(INCS) -c $< -o $@
-       @$(CC) $(GCC_DEPS) $(CFLAGS) $(SDL_CFLAGS) $(DEFINES) $(INCS) -c $< -o $@
-
 obj/%.o: src/%.cpp
        @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
-#      @$(CC) $(CXXFLAGS) $(INCS) -c $< -o $@
        @$(CC) $(GCC_DEPS) $(CXXFLAGS) $(SDL_CFLAGS) $(DEFINES) $(INCS) -c $< -o $@
 
 -include obj/*.d