Replace backslash in file paths to slash
[clinton/Virtual-Jaguar-Rx.git] / jaguarcore.mak
... / ...
CommitLineData
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
10ifeq ("$(V)","1")
11Q :=
12else
13Q := @
14endif
15
16# Cross compilation with MXE
17#CROSS = i686-pc-mingw32-
18
19SYSTYPE := __GCCUNIX__
20
21ifneq "$(CROSS)" ""
22SYSTYPE := __GCCWIN32__
23else
24OSTYPE := $(shell uname -o)
25ifeq "$(OSTYPE)" "Msys"
26SYSTYPE := __GCCWIN32__
27endif
28endif
29
30# Set vars for libcdio
31ifneq "$(shell pkg-config --silence-errors --libs libcdio)" ""
32HAVECDIO := -DHAVE_LIB_CDIO
33CDIOLIB := -lcdio
34else
35HAVECDIO :=
36CDIOLIB :=
37endif
38
39CC := $(CROSS)gcc
40LD := $(CROSS)gcc
41AR := $(CROSS)ar
42ARFLAGS := -rs
43
44SDL_CFLAGS = `$(CROSS)sdl-config --cflags`
45DEFINES = -D$(SYSTYPE)
46GCC_DEPS = -MMD
47
48INCS := -I./src
49
50OBJS := \
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
87all: obj obj/libjaguarcore.a
88 @echo "Done!"
89
90obj:
91 @mkdir obj
92
93# Library rules (might not be cross-platform compatible)
94obj/libjaguarcore.a: $(OBJS)
95 $(Q)$(AR) $(ARFLAGS) obj/libjaguarcore.a $(OBJS)
96
97# Main source compilation (implicit rules)...
98
99obj/%.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