2 # Makefile for Virtual Jaguar core library
6 # This software is licensed under the GPL v3 or any later version. See the
7 # file GPLv3 for details. ;-)
10 # Cross compilation with MXE
11 #CROSS = i686-pc-mingw32-
13 # Figure out which system we're compiling for, and set the appropriate variables
16 OSTYPE := $(shell uname -a)
19 ifeq "$(findstring Msys,$(OSTYPE))" "Msys"
21 SYSTYPE := __GCCWIN32__
24 # Apple. Should catch both 'darwin' and 'darwin7.0'
25 else ifeq "$(findstring Darwin,$(OSTYPE))" "Darwin"
27 SYSTYPE := __GCCUNIX__ -D__THINK_STUPID__
28 SDLLIBTYPE := --static-libs
31 else ifeq "$(findstring Linux,$(OSTYPE))" "Linux"
33 SYSTYPE := __GCCUNIX__
36 else ifeq "$(findstring kFreeBSD,$(OSTYPE))" "kFreeBSD"
38 SYSTYPE := __GCCUNIX__
41 # ??? Throw error, unknown OS
44 $(error OS TYPE UNDETECTED)
48 SYSTYPE := __GCCWIN32__
52 # Set vars for libcdio
53 ifneq "$(shell pkg-config --silence-errors --libs libcdio)" ""
54 HAVECDIO := -DHAVE_LIB_CDIO
66 SDL_CFLAGS = `$(CROSS)sdl-config --cflags`
67 DEFINES = -D$(SYSTYPE)
105 # Targets for convenience sake, not "real" targets
108 all: obj obj/libjaguarcore.a
114 # Library rules (might not be cross-platform compatible)
115 obj/libjaguarcore.a: $(OBJS)
116 @$(AR) $(ARFLAGS) obj/libjaguarcore.a $(OBJS)
118 # Main source compilation (implicit rules)...
121 @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
122 @$(CC) $(GCC_DEPS) $(CXXFLAGS) $(SDL_CFLAGS) $(DEFINES) $(INCS) -c $< -o $@