Rename GPLv3 document as LICENSE, to fit better the GitHub requirements. Text / Licen...
[clinton/Virtual-Jaguar-Rx.git] / jaguarcore.mak
1 #
2 # Makefile for Virtual Jaguar core library
3 #
4 # by James Hammons
5 # Edited by Jean-Paul Mari
6 #
7 # This software is licensed under the GPL v3 or any later version. See the
8 # file LICENSE file for details. ;-)
9 #
10
11 ifeq ("$(V)","1")
12 Q :=
13 else
14 Q := @
15 endif
16
17 # Cross compilation with MXE
18 #CROSS = i686-pc-mingw32-
19
20 SYSTYPE := __GCCUNIX__
21
22 ifneq "$(CROSS)" ""
23 SYSTYPE := __GCCWIN32__
24 else
25 OSTYPE := $(shell uname -o)
26 ifeq "$(OSTYPE)" "Msys"
27 SYSTYPE := __GCCWIN32__
28 endif
29 endif
30
31 # Set vars for libcdio
32 ifneq "$(shell pkg-config --silence-errors --libs libcdio)" ""
33 HAVECDIO := -DHAVE_LIB_CDIO
34 CDIOLIB := -lcdio
35 else
36 HAVECDIO :=
37 CDIOLIB :=
38 endif
39
40 CC := $(CROSS)gcc
41 LD := $(CROSS)gcc
42 AR := $(CROSS)ar
43 ARFLAGS := -rs
44
45 SDL_CFLAGS = `$(CROSS)sdl-config --cflags`
46 DEFINES = -D$(SYSTYPE)
47 GCC_DEPS = -MMD
48
49 INCS := -I./src
50
51 OBJS := \
52 obj/blitter.o \
53 obj/cdintf.o \
54 obj/cdrom.o \
55 obj/dac.o \
56 obj/dsp.o \
57 obj/eeprom.o \
58 obj/event.o \
59 obj/filedb.o \
60 obj/gpu.o \
61 obj/jagbios.o \
62 obj/jagbios2.o \
63 obj/jagcdbios.o \
64 obj/jagdevcdbios.o \
65 obj/jagstub1bios.o \
66 obj/jagstub2bios.o \
67 obj/jagdasm.o \
68 obj/jaguar.o \
69 obj/jerry.o \
70 obj/joystick.o \
71 obj/memory.o \
72 obj/memtrack.o \
73 obj/mmu.o \
74 obj/op.o \
75 obj/state.o \
76 obj/tom.o \
77 obj/universalhdr.o \
78 obj/wavetable.o
79
80 # Targets for convenience sake, not "real" targets
81 .PHONY: clean
82
83 all: obj obj/libjaguarcore.a
84 @echo "Done!"
85
86 obj:
87 @mkdir obj
88
89 # Library rules (might not be cross-platform compatible)
90 obj/libjaguarcore.a: $(OBJS)
91 $(Q)$(AR) $(ARFLAGS) obj/libjaguarcore.a $(OBJS)
92
93 # Main source compilation (implicit rules)...
94
95 obj/%.o: src/%.cpp
96 @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m"
97 $(Q)$(CC) $(GCC_DEPS) $(CXXFLAGS) $(SDL_CFLAGS) $(DEFINES) $(INCS) -c $< -o $@
98
99 -include obj/*.d