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. ;-)
16 # Cross compilation with MXE
17 #CROSS = i686-pc-mingw32-
19 # Figure out which system we're compiling for, and set the appropriate variables
22 OSTYPE := $(shell uname -a)
25 ifeq "$(findstring Msys,$(OSTYPE))" "Msys"
27 SYSTYPE := __GCCWIN32__
30 # Apple. Should catch both 'darwin' and 'darwin7.0'
31 else ifeq "$(findstring Darwin,$(OSTYPE))" "Darwin"
33 SYSTYPE := __GCCUNIX__ -D__THINK_STUPID__
34 SDLLIBTYPE := --static-libs
37 else ifeq "$(findstring Linux,$(OSTYPE))" "Linux"
39 SYSTYPE := __GCCUNIX__
42 else ifeq "$(findstring kFreeBSD,$(OSTYPE))" "kFreeBSD"
44 SYSTYPE := __GCCUNIX__
47 # ??? Throw error, unknown OS
50 $(error OS TYPE UNDETECTED)
54 SYSTYPE := __GCCWIN32__
58 # Set vars for libcdio
59 ifneq "$(shell pkg-config --silence-errors --libs libcdio)" ""
60 HAVECDIO := -DHAVE_LIB_CDIO
72 SDL_CFLAGS = `$(CROSS)sdl-config --cflags`
73 DEFINES = -D$(SYSTYPE)
111 # Targets for convenience sake, not "real" targets
114 all: obj obj/libjaguarcore.a
120 # Library rules (might not be cross-platform compatible)
121 obj/libjaguarcore.a: $(OBJS)
122 $(Q)$(AR) $(ARFLAGS) obj/libjaguarcore.a $(OBJS)
124 # Main source compilation (implicit rules)...
127 @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
128 $(Q)$(CC) $(GCC_DEPS) $(CXXFLAGS) $(SDL_CFLAGS) $(DEFINES) $(INCS) -c $< -o $@