sram bugfix + savestate refactoring
[picodrive.git] / platform / pandora / Makefile
... / ...
CommitLineData
1#export CROSS = arm-none-linux-gnueabi-\r
2LIBROOT = /home/notaz/dev/pnd/libroot\r
3\r
4# settings\r
5#mz80 = 1\r
6#cz80 = 1\r
7#debug_cyclone = 1\r
8asm_memory = 1\r
9asm_render = 1\r
10asm_ym2612 = 1\r
11asm_misc = 1\r
12asm_cdpico = 1\r
13asm_cdmemory = 1\r
14amalgamate = 0\r
15#profile = 1\r
16#use_musashi = 1\r
17#use_famec = 1\r
18\r
19\r
20ifeq "$(debug_cyclone)" "1"\r
21use_cyclone = 1\r
22use_musashi = 1\r
23endif\r
24ifeq "$(use_musashi)" "1"\r
25asm_cdpico = 0\r
26asm_memory = 0\r
27asm_cdmemory = 0\r
28else\r
29use_cyclone = 1\r
30endif\r
31\r
32DEFINC = -I../.. -I. -DARM -DPANDORA -DIN_EVDEV\r
33COPT_COMMON = -Wall -Winline -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -I$(LIBROOT)/include\r
34ifeq ($(DEBUG),)\r
35COPT_COMMON += -O2 # -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
36else\r
37COPT_COMMON += -ggdb\r
38endif\r
39ifeq "$(profile)" "1"\r
40COPT_COMMON += -fprofile-generate\r
41endif\r
42ifeq "$(profile)" "2"\r
43COPT_COMMON += -fprofile-use\r
44endif\r
45CFLAGS = $(COPT_COMMON)\r
46SFLAGS = $(CFLAGS)\r
47ASFLAGS = -mcpu=cortex-a8\r
48CC = $(CROSS)gcc\r
49STRIP = $(CROSS)strip\r
50AS = $(CROSS)as\r
51LD = $(CROSS)ld\r
52OBJCOPY = $(CROSS)objcopy\r
53\r
54# frontend\r
55OBJS += pandora.o emu.o asm_utils.o plat.o\r
56\r
57# common\r
58OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r
59 platform/common/arm_utils.o platform/common/mp3_helix.o platform/common/arm_linux.o \\r
60 platform/common/readpng.o platform/common/input.o platform/common/main.o \\r
61 platform/linux/in_evdev.o platform/linux/sndout_oss.o platform/linux/plat.o\r
62\r
63# Pico\r
64ifeq "$(amalgamate)" "1"\r
65OBJS += ../../picoAll.o\r
66else\r
67OBJS += pico/area.o pico/cart.o pico/memory.o pico/misc.o pico/pico.o pico/sek.o \\r
68 pico/videoport.o pico/draw2.o pico/draw.o pico/patch.o pico/debug.o\r
69# Pico - CD\r
70OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \\r
71 pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \\r
72 pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o\r
73endif\r
74# Pico - Pico\r
75OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o\r
76# Pico - carthw\r
77OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \\r
78 pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o\r
79\r
80# Pico - sound\r
81ifneq "$(amalgamate)" "1"\r
82OBJS += pico/sound/sound.o\r
83endif\r
84OBJS += pico/sound/mix_arm.o\r
85OBJS += pico/sound/sn76496.o pico/sound/ym2612.o\r
86# zlib\r
87OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \\r
88 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o\r
89# unzip\r
90OBJS += unzip/unzip.o unzip/unzip_stream.o\r
91# debug\r
92ifeq "$(debug_cyclone)" "1"\r
93OBJS += pico/DebugCPU.o cpu/musashi/m68kdasm.o\r
94endif\r
95# CPU cores\r
96ifeq "$(use_musashi)" "1"\r
97DEFINC += -DEMU_M68K\r
98OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r
99endif\r
100ifeq "$(use_cyclone)" "1"\r
101DEFINC += -DEMU_C68K\r
102OBJS += cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r
103endif\r
104ifeq "$(use_famec)" "1"\r
105DEFINC += -DEMU_F68K\r
106OBJS += cpu/fame/famec.o\r
107endif\r
108# drz80/mz80\r
109ifeq "$(mz80)" "1"\r
110DEFINC += -D_USE_MZ80\r
111OBJS += cpu/mz80/mz80.o\r
112else\r
113ifeq "$(cz80)" "1"\r
114DEFINC += -D_USE_CZ80\r
115OBJS += cpu/cz80/cz80.o\r
116else\r
117DEFINC += -D_USE_DRZ80\r
118OBJS += cpu/DrZ80/drz80.o\r
119endif\r
120endif\r
121\r
122vpath %.c = ../..\r
123vpath %.s = ../..\r
124vpath %.S = ../..\r
125DIRS = platform platform/gp2x platform/linux platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \\r
126 zlib unzip cpu cpu/musashi cpu/Cyclone/proj cpu/Cyclone/tools cpu/mz80 cpu/DrZ80\r
127\r
128\r
129all: mkdirs PicoDrive\r
130\r
131include ../common/common_arm.mak\r
132\r
133PicoDrive : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r
134 @echo ">>>" $@\r
135 $(CC) -o $@ $(CFLAGS) $^ -lm -Wl,-Map=PicoDrive.map -lpng -L$(LIBROOT)/lib -static\r
136ifeq ($(DEBUG),)\r
137 $(STRIP) $@\r
138endif\r
139\r
140clean: tidy\r
141 $(RM) PicoDrive\r
142tidy:\r
143 $(RM) $(OBJS)\r
144\r
145readme.txt: ../../tools/textfilter ../base_readme.txt\r
146 ../../tools/textfilter ../base_readme.txt $@ GP2X\r
147\r
148# ----------- release -----------\r
149ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
150$(error TODO)\r
151ifeq ($(VER),)\r
152$(error need VER)\r
153endif\r
154endif\r
155\r