starting input layer integration work
[picodrive.git] / platform / gp2x / Makefile
... / ...
CommitLineData
1\r
2# you may or may not need to change this\r
3#devkit_path = x:/stuff/dev/devkitgp2x/\r
4export CROSS = arm-linux-\r
5#CROSS = $(devkit_path)bin/arm-linux-\r
6\r
7# settings\r
8#mz80 = 1\r
9#debug_cyclone = 1\r
10asm_memory = 1\r
11asm_render = 1\r
12asm_ym2612 = 1\r
13asm_misc = 1\r
14asm_cdpico = 1\r
15asm_cdmemory = 1\r
16amalgamate = 0\r
17#profile = 1\r
18#use_musashi = 1\r
19#up = 1\r
20\r
21\r
22ifeq "$(debug_cyclone)" "1"\r
23use_cyclone = 1\r
24use_musashi = 1\r
25endif\r
26ifeq "$(use_musashi)" "1"\r
27asm_cdpico = 0\r
28asm_memory = 0\r
29asm_cdmemory = 0\r
30else\r
31use_cyclone = 1\r
32endif\r
33\r
34DEFINC = -I../.. -I. -DARM -D__GP2X__ # -DBENCHMARK\r
35COPT_COMMON = -static -Wall -Winline\r
36ifeq ($(DEBUG),)\r
37COPT_COMMON += -O3 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
38else\r
39COPT_COMMON += -ggdb\r
40endif\r
41ifeq "$(profile)" "1"\r
42COPT_COMMON += -fprofile-generate\r
43endif\r
44ifeq "$(profile)" "2"\r
45COPT_COMMON += -fprofile-use\r
46endif\r
47CFLAGS = $(COPT_COMMON) -mcpu=arm920t -mtune=arm920t\r
48SFLAGS = $(CFLAGS)\r
49ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r
50CC = $(CROSS)gcc\r
51STRIP = $(CROSS)strip\r
52AS = $(CROSS)as\r
53LD = $(CROSS)ld\r
54OBJCOPY = $(CROSS)objcopy\r
55\r
56# frontend\r
57OBJS += main.o menu.o gp2x.o emu.o squidgehack.o cpuctrl.o\r
58# 940 core control\r
59OBJS += 940ctl.o\r
60\r
61# common\r
62OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r
63 platform/common/arm_utils.o platform/common/arm_linux.o platform/common/readpng.o \\r
64 platform/common/mp3_helix.o platform/linux/usbjoy.o platform/linux/sndout_oss.o\r
65\r
66# Pico\r
67ifeq "$(amalgamate)" "1"\r
68OBJS += ../../picoAll.o\r
69else\r
70OBJS += pico/area.o pico/cart.o pico/memory.o pico/misc.o pico/pico.o pico/sek.o \\r
71 pico/videoport.o pico/draw2.o pico/draw.o pico/patch.o pico/debug.o\r
72# Pico - CD\r
73OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \\r
74 pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \\r
75 pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o\r
76endif\r
77# Pico - Pico\r
78OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o\r
79# Pico - carthw\r
80OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \\r
81 pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o\r
82\r
83# Pico - sound\r
84ifneq "$(amalgamate)" "1"\r
85OBJS += pico/sound/sound.o\r
86endif\r
87OBJS += pico/sound/mix_arm.o\r
88OBJS += pico/sound/sn76496.o pico/sound/ym2612.o\r
89# zlib\r
90OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \\r
91 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o\r
92# unzip\r
93OBJS += unzip/unzip.o unzip/unzip_stream.o\r
94# debug\r
95ifeq "$(debug_cyclone)" "1"\r
96OBJS += pico/DebugCPU.o cpu/musashi/m68kdasm.o\r
97endif\r
98# CPU cores\r
99ifeq "$(use_musashi)" "1"\r
100DEFINC += -DEMU_M68K\r
101OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r
102endif\r
103ifeq "$(use_cyclone)" "1"\r
104DEFINC += -DEMU_C68K\r
105OBJS += cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r
106endif\r
107# drz80/mz80\r
108ifeq "$(mz80)" "1"\r
109DEFINC += -D_USE_MZ80\r
110OBJS += cpu/mz80/mz80.o\r
111else\r
112DEFINC += -D_USE_DRZ80\r
113OBJS += cpu/DrZ80/drz80.o\r
114endif\r
115\r
116vpath %.c = ../..\r
117vpath %.s = ../..\r
118vpath %.S = ../..\r
119DIRS = platform platform/gp2x platform/linux platform/common pico pico/cd pico/pico pico/sound \\r
120 pico/carthw/svp zlib unzip cpu cpu/musashi cpu/Cyclone/proj cpu/Cyclone/tools cpu/mz80 cpu/DrZ80\r
121\r
122\r
123all: mkdirs PicoDrive.gpe\r
124\r
125include ../common/common_arm.mak\r
126\r
127PicoDrive.gpe : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r
128 @echo ">>>" $@\r
129 $(CC) -o $@ $(CFLAGS) $^ -lm -lpng -Wl,-Map=PicoDrive.map\r
130ifeq ($(DEBUG),)\r
131 $(STRIP) $@\r
132endif\r
133\r
134up: PicoDrive.gpe\r
135 @cp -v PicoDrive.gpe /mnt/gp2x/mnt/sd/emus/PicoDrive/\r
136\r
137clean: tidy\r
138 $(RM) PicoDrive.gpe\r
139tidy:\r
140 $(RM) $(OBJS)\r
141\r
142readme.txt: ../../tools/textfilter ../base_readme.txt\r
143 ../../tools/textfilter ../base_readme.txt $@ GP2X\r
144\r
145# ----------- release -----------\r
146ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
147ifeq ($(VER),)\r
148$(error need VER)\r
149endif\r
150endif\r
151\r
152rel: PicoDrive.gpe code940/pico940_v3.bin readme.txt PicoDrive.man.txt PicoDrive.png ../game_def.cfg\r
153 zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o\r
154 zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r
155 mkdir bin_to_cso_mp3\r
156 cp ../../tools/bin_to_cso_mp3/* bin_to_cso_mp3/\r
157 zip -9 -r ../../PicoDrive_$(VER).zip bin_to_cso_mp3\r
158 rm -rf bin_to_cso_mp3\r
159\r
160code940/code940.bin:\r
161 make -C code940/\r
162\r