fix incomplete init
[picodrive.git] / platform / common / common.mak
... / ...
CommitLineData
1ifdef drc_debug
2use_fame = 1
3use_cz80 = 1
4use_cyclone = 0
5use_drz80 = 0
6
7asm_memory = 0
8asm_render = 0
9asm_ym2612 = 0
10asm_misc = 0
11asm_cdpico = 0
12asm_cdmemory = 0
13asm_mix = 0
14endif
15
16ifeq "$(profile)" "1"
17CFLAGS += -fprofile-generate
18endif
19ifeq "$(profile)" "2"
20CFLAGS += -fprofile-use
21endif
22ifeq "$(pdb)" "1"
23DEFINES += PDB
24SRCS_COMMON += $(R)cpu/debug.c
25 ifeq "$(pdb_net)" "1"
26 DEFINES += PDB_NET
27 endif
28 ifeq "$(readline)" "1"
29 DEFINES += HAVE_READLINE
30 LDFLAGS += -lreadline
31 endif
32endif
33ifeq "$(cpu_cmp)" "1"
34ifdef cpu_cmp_w
35DEFINES += CPU_CMP_W
36else
37DEFINES += CPU_CMP_R
38endif # cpu_cmp_w
39endif
40ifeq "$(pprof)" "1"
41DEFINES += PPROF
42SRCS_COMMON += $(R)platform/linux/pprof.c
43endif
44
45# ARM asm stuff
46ifeq "$(ARCH)" "arm"
47ifeq "$(asm_render)" "1"
48DEFINES += _ASM_DRAW_C
49SRCS_COMMON += $(R)pico/draw_arm.S $(R)pico/draw2_arm.S
50endif
51ifeq "$(asm_memory)" "1"
52DEFINES += _ASM_MEMORY_C
53SRCS_COMMON += $(R)pico/memory_arm.s
54endif
55ifeq "$(asm_ym2612)" "1"
56DEFINES += _ASM_YM2612_C
57SRCS_COMMON += $(R)pico/sound/ym2612_arm.s
58endif
59ifeq "$(asm_misc)" "1"
60DEFINES += _ASM_MISC_C
61SRCS_COMMON += $(R)pico/misc_arm.s
62SRCS_COMMON += $(R)pico/cd/misc_arm.s
63endif
64ifeq "$(asm_cdpico)" "1"
65DEFINES += _ASM_CD_PICO_C
66SRCS_COMMON += $(R)pico/cd/pico_arm.s
67endif
68ifeq "$(asm_cdmemory)" "1"
69DEFINES += _ASM_CD_MEMORY_C
70SRCS_COMMON += $(R)pico/cd/memory_arm.s
71endif
72ifeq "$(asm_32xdraw)" "1"
73DEFINES += _ASM_32X_DRAW
74SRCS_COMMON += $(R)pico/32x/draw_arm.s
75endif
76ifeq "$(asm_mix)" "1"
77SRCS_COMMON += $(R)pico/sound/mix_arm.s
78endif
79endif # ARCH=arm
80
81# === Pico core ===
82# Pico
83SRCS_COMMON += $(R)pico/pico.c $(R)pico/cart.c $(R)pico/memory.c \
84 $(R)pico/state.c $(R)pico/sek.c $(R)pico/z80if.c \
85 $(R)pico/videoport.c $(R)pico/draw2.c $(R)pico/draw.c \
86 $(R)pico/mode4.c $(R)pico/misc.c $(R)pico/eeprom.c \
87 $(R)pico/patch.c $(R)pico/debug.c $(R)pico/media.c
88# SMS
89ifneq "$(no_sms)" "1"
90SRCS_COMMON += $(R)pico/sms.c
91else
92DEFINES += NO_SMS
93endif
94# CD
95SRCS_COMMON += $(R)pico/cd/pico.c $(R)pico/cd/memory.c $(R)pico/cd/sek.c \
96 $(R)pico/cd/LC89510.c $(R)pico/cd/cd_sys.c $(R)pico/cd/cd_file.c \
97 $(R)pico/cd/cue.c $(R)pico/cd/gfx_cd.c $(R)pico/cd/misc.c \
98 $(R)pico/cd/pcm.c $(R)pico/cd/buffering.c
99# 32X
100ifneq "$(no_32x)" "1"
101SRCS_COMMON += $(R)pico/32x/32x.c $(R)pico/32x/memory.c $(R)pico/32x/draw.c \
102 $(R)pico/32x/sh2soc.c $(R)pico/32x/pwm.c
103else
104DEFINES += NO_32X
105endif
106# Pico
107SRCS_COMMON += $(R)pico/pico/pico.c $(R)pico/pico/memory.c $(R)pico/pico/xpcm.c
108# carthw
109SRCS_COMMON += $(R)pico/carthw/carthw.c
110# SVP
111SRCS_COMMON += $(R)pico/carthw/svp/svp.c $(R)pico/carthw/svp/memory.c \
112 $(R)pico/carthw/svp/ssp16.c
113ifeq "$(use_svpdrc)" "1"
114DEFINES += _SVP_DRC
115SRCS_COMMON += $(R)pico/carthw/svp/stub_arm.S
116SRCS_COMMON += $(R)pico/carthw/svp/compiler.c
117endif
118# sound
119SRCS_COMMON += $(R)pico/sound/sound.c
120SRCS_COMMON += $(R)pico/sound/sn76496.c $(R)pico/sound/ym2612.c
121ifneq "$(ARCH)$(asm_mix)" "arm1"
122SRCS_COMMON += $(R)pico/sound/mix.c
123endif
124
125# === CPU cores ===
126# --- M68k ---
127ifeq "$(use_musashi)" "1"
128DEFINES += EMU_M68K
129SRCS_COMMON += $(R)cpu/musashi/m68kops.c $(R)cpu/musashi/m68kcpu.c
130#SRCS_COMMON += $(R)cpu/musashi/m68kdasm.c
131endif
132ifeq "$(use_cyclone)" "1"
133DEFINES += EMU_C68K
134SRCS_COMMON += $(R)pico/m68kif_cyclone.s $(R)cpu/cyclone/Cyclone.s \
135 $(R)cpu/cyclone/tools/idle.s
136endif
137ifeq "$(use_fame)" "1"
138DEFINES += EMU_F68K
139SRCS_COMMON += $(R)cpu/fame/famec.c
140endif
141
142# --- Z80 ---
143ifeq "$(use_drz80)" "1"
144DEFINES += _USE_DRZ80
145SRCS_COMMON += $(R)cpu/DrZ80/drz80.s
146endif
147#
148ifeq "$(use_cz80)" "1"
149DEFINES += _USE_CZ80
150SRCS_COMMON += $(R)cpu/cz80/cz80.c
151endif
152
153# --- SH2 ---
154SRCS_COMMON += $(R)cpu/drc/cmn.c
155ifneq "$(no_32x)" "1"
156SRCS_COMMON += $(R)cpu/sh2/sh2.c
157#
158ifeq "$(use_sh2drc)" "1"
159DEFINES += DRC_SH2
160SRCS_COMMON += $(R)cpu/sh2/compiler.c
161ifdef drc_debug
162DEFINES += DRC_DEBUG=$(drc_debug)
163SRCS_COMMON += $(R)cpu/sh2/mame/sh2dasm.c
164SRCS_COMMON += $(R)platform/libpicofe/linux/host_dasm.c
165LDFLAGS += -lbfd -lopcodes -liberty
166endif
167endif # use_sh2drc
168#
169ifeq "$(use_sh2mame)" "1"
170SRCS_COMMON += $(R)cpu/sh2/mame/sh2pico.c
171endif
172endif # !no_32x
173
174OBJS_COMMON := $(SRCS_COMMON:.c=.o)
175OBJS_COMMON := $(OBJS_COMMON:.s=.o)
176OBJS_COMMON := $(OBJS_COMMON:.S=.o)
177
178ifneq ($(deps_set),yes)
179ifeq "$(use_cyclone)" "1"
180$(FR)pico/pico.c: $(FR)cpu/cyclone/Cyclone.h
181endif
182
183$(FR)cpu/cyclone/Cyclone.h:
184 @echo "Cyclone submodule is missing, please run 'git submodule update --init'"
185 @false
186
187$(FR)cpu/cyclone/Cyclone.s:
188 @echo building Cyclone...
189 @make -C $(R)cpu/cyclone/ CONFIG_FILE=../cyclone_config.h
190
191$(FR)cpu/musashi/m68kops.c:
192 @make -C $(R)cpu/musashi
193
194deps_set = yes
195endif # deps_set