xenv: allow reading mouse through callbacks, for SDL project
[picodrive.git] / platform / common / common.mak
... / ...
CommitLineData
1ifneq ($(DEBUG),)
2CFLAGS += -ggdb
3endif
4ifeq "$(profile)" "1"
5CFLAGS += -fprofile-generate
6endif
7ifeq "$(profile)" "2"
8CFLAGS += -fprofile-use
9endif
10ifeq "$(pdb)" "1"
11DEFINES += PDB
12OBJS += cpu/debug.o
13 ifeq "$(pdb_net)" "1"
14 DEFINES += PDB_NET
15 endif
16 ifeq "$(readline)" "1"
17 DEFINES += HAVE_READLINE
18 LDFLAGS += -lreadline
19 endif
20endif
21ifeq "$(pprof)" "1"
22DEFINES += PPROF
23OBJS += platform/linux/pprof.o
24endif
25
26# === Pico core ===
27# Pico
28OBJS += pico/state.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o pico/z80if.o \
29 pico/videoport.o pico/draw2.o pico/draw.o pico/mode4.o \
30 pico/misc.o pico/eeprom.o pico/patch.o pico/debug.o
31# SMS
32ifneq "$(no_sms)" "1"
33OBJS += pico/sms.o
34else
35DEFINES += NO_SMS
36endif
37# CD
38OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \
39 pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \
40 pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o
41# 32X
42ifneq "$(no_32x)" "1"
43OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o pico/32x/pwm.o
44else
45DEFINES += NO_32X
46endif
47# Pico
48OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o
49# carthw
50OBJS += pico/carthw/carthw.o
51# SVP
52OBJS += pico/carthw/svp/svp.o pico/carthw/svp/memory.o \
53 pico/carthw/svp/ssp16.o
54# sound
55OBJS += pico/sound/sound.o
56OBJS += pico/sound/sn76496.o pico/sound/ym2612.o
57
58# === CPU cores ===
59# --- M68k ---
60ifeq "$(use_musashi)" "1"
61DEFINES += EMU_M68K
62OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o
63#OBJS += cpu/musashi/m68kdasm.o
64endif
65ifeq "$(use_cyclone)" "1"
66DEFINES += EMU_C68K
67OBJS += pico/m68kif_cyclone.o cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o
68endif
69ifeq "$(use_fame)" "1"
70DEFINES += EMU_F68K
71OBJS += cpu/fame/famec.o
72endif
73
74# --- Z80 ---
75ifeq "$(use_drz80)" "1"
76DEFINES += _USE_DRZ80
77OBJS += cpu/DrZ80/drz80.o
78endif
79#
80ifeq "$(use_cz80)" "1"
81DEFINES += _USE_CZ80
82OBJS += cpu/cz80/cz80.o
83endif
84
85# --- SH2 ---
86OBJS += cpu/drc/cmn.o
87ifneq "$(no_32x)" "1"
88OBJS += cpu/sh2/sh2.o
89#
90ifeq "$(use_sh2drc)" "1"
91DEFINES += DRC_SH2
92OBJS += cpu/sh2/compiler.o
93ifdef drc_debug
94DEFINES += DRC_DEBUG=$(drc_debug)
95OBJS += cpu/sh2/mame/sh2dasm.o
96OBJS += platform/linux/host_dasm.o
97LDFLAGS += -lbfd -lopcodes -liberty
98endif
99ifeq "$(drc_debug_interp)" "1"
100DEFINES += DRC_DEBUG_INTERP
101use_sh2mame = 1
102endif
103endif # use_sh2drc
104#
105ifeq "$(use_sh2mame)" "1"
106OBJS += cpu/sh2/mame/sh2pico.o
107endif
108endif # !no_32x
109
110
111DIRS += platform platform/common pico pico/cd pico/pico pico/32x pico/sound pico/carthw/svp \
112 cpu cpu/musashi cpu/cz80 cpu/fame cpu/sh2/mame cpu/drc
113
114
115# common rules
116.c.o:
117 @echo ">>>" $<
118 $(CC) $(CFLAGS) -c $< -o $@
119.s.o:
120 @echo ">>>" $<
121 $(CC) $(CFLAGS) -c $< -o $@
122
123clean_prof:
124 find ../.. -name '*.gcno' -delete
125 find ../.. -name '*.gcda' -delete
126
127mkdirs:
128 mkdir -p $(DIRS)
129
130../../tools/textfilter: ../../tools/textfilter.c
131 make -C ../../tools/ textfilter
132
133
134# random deps
135pico/carthw/svp/compiler.o : ../../cpu/drc/emit_$(ARCH).c
136cpu/sh2/compiler.o : ../../cpu/drc/emit_$(ARCH).c
137cpu/sh2/mame/sh2pico.o : ../../cpu/sh2/mame/sh2.c
138pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
139pico/memory.o pico/cd/memory.o : ../../pico/pico_int.h ../../pico/memory.h
140
141../../cpu/musashi/m68kops.c :
142 @make -C ../../cpu/musashi
143
144../../cpu/mz80/mz80.asm :
145 @make -C ../../cpu/mz80/
146
147cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h
148 @echo ">>>" $<
149 $(CC) $(CFLAGS) -Wno-unused -c $< -o $@
150
151../../cpu/Cyclone/proj/Cyclone.s:
152 @echo building Cyclone...
153 @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h
154