X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=jaguarcore.mak;h=9d44b4193375c4a5c5451b8d7482c12b00bb49ee;hb=0c0dea5b5411ef9be8c6d5159faf0d2226db4452;hp=dd288950862ca89088ec092f1dfa52224454f86f;hpb=2f21d8ee63902b160acbaf4c26caaaa0e23ca62f;p=virtualjaguar diff --git a/jaguarcore.mak b/jaguarcore.mak index dd28895..9d44b41 100644 --- a/jaguarcore.mak +++ b/jaguarcore.mak @@ -1,35 +1,30 @@ # # 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. ;-) # -# Figure out which system we're compiling for, and set the appropriate variables - -OSTYPE := $(shell uname -a) - -ifeq "$(findstring Msys,$(OSTYPE))" "Msys" # Win32 - -SYSTYPE := __GCCWIN32__ -SDLLIBTYPE := --libs - -else ifeq "$(findstring Darwin,$(OSTYPE))" "Darwin" # Should catch both 'darwin' and 'darwin7.0' - -SYSTYPE := __GCCUNIX__ -D_OSX_ -SDLLIBTYPE := --static-libs +ifeq ("$(V)","1") +Q := +else +Q := @ +endif -else ifeq "$(findstring Linux,$(OSTYPE))" "Linux" # Linux +# Cross compilation with MXE +#CROSS = i686-pc-mingw32- SYSTYPE := __GCCUNIX__ -SDLLIBTYPE := --libs - -else # ??? - -$(error OS TYPE UNDETECTED) +ifneq "$(CROSS)" "" +SYSTYPE := __GCCWIN32__ +else +OSTYPE := $(shell uname -o) +ifeq "$(OSTYPE)" "Msys" +SYSTYPE := __GCCWIN32__ +endif endif # Set vars for libcdio @@ -41,14 +36,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 @@ -64,6 +59,12 @@ OBJS := \ obj/file.o \ obj/filedb.o \ obj/gpu.o \ + obj/jagbios.o \ + obj/jagbios2.o \ + obj/jagcdbios.o \ + obj/jagdevcdbios.o \ + obj/jagstub1bios.o \ + obj/jagstub2bios.o \ obj/jagdasm.o \ obj/jaguar.o \ obj/jerry.o \ @@ -90,16 +91,12 @@ obj: # Library rules (might not be cross-platform compatible) obj/libjaguarcore.a: $(OBJS) - @$(AR) $(ARFLAGS) obj/libjaguarcore.a $(OBJS) + $(Q)$(AR) $(ARFLAGS) 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 $@ + $(Q)$(CC) $(GCC_DEPS) $(CXXFLAGS) $(SDL_CFLAGS) $(DEFINES) $(INCS) -c $< -o $@ -include obj/*.d