X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=jaguarcore.mak;h=0c94a5c9fdacb22b80901597d162ee6af93354c5;hb=c3a4ee955a8a3691150ae62dfa3b805a33c27311;hp=7d0ef6f68281d30ea5c39f7172606544612978b1;hpb=e285d9bb9ae73f64443fa4add30119dc422c4d08;p=virtualjaguar diff --git a/jaguarcore.mak b/jaguarcore.mak index 7d0ef6f..0c94a5c 100644 --- a/jaguarcore.mak +++ b/jaguarcore.mak @@ -1,35 +1,47 @@ # # Makefile for Virtual Jaguar core library # -# by James L. Hammons +# by James Hammons # # This software is licensed under the GPL v3 or any later version. See the # 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) -ifeq "$(findstring Msys,$(OSTYPE))" "Msys" # Win32 +# Win32 +ifeq "$(findstring Msys,$(OSTYPE))" "Msys" SYSTYPE := __GCCWIN32__ SDLLIBTYPE := --libs -else ifeq "$(findstring Darwin,$(OSTYPE))" "Darwin" # Should catch both 'darwin' and 'darwin7.0' +# Apple. Should catch both 'darwin' and 'darwin7.0' +else ifeq "$(findstring Darwin,$(OSTYPE))" "Darwin" SYSTYPE := __GCCUNIX__ -D__THINK_STUPID__ SDLLIBTYPE := --static-libs -else ifeq "$(findstring Linux,$(OSTYPE))" "Linux" # Linux +# Linux +else ifeq "$(findstring Linux,$(OSTYPE))" "Linux" SYSTYPE := __GCCUNIX__ SDLLIBTYPE := --libs -else # ??? +# ??? Throw error, unknown OS +else $(error OS TYPE UNDETECTED) +endif +else +SYSTYPE := __GCCWIN32__ +SDLLIBTYPE := --libs endif # Set vars for libcdio @@ -41,14 +53,14 @@ HAVECDIO := CDIOLIB := endif -CC := gcc -LD := gcc -AR := ar +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) -CXXFLAGS := -MMD -O2 -ffast-math -fomit-frame-pointer `sdl-config --cflags` -D$(SYSTYPE) +SDL_CFLAGS = `$(CROSS)sdl-config --cflags` +DEFINES = -D$(SYSTYPE) +GCC_DEPS = -MMD INCS := -I./src @@ -99,12 +111,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 $@ - 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