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