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