move select from evdev to upper level
[picodrive.git] / platform / gp2x / Makefile
CommitLineData
cc68a136 1\r
2# you may or may not need to change this\r
3#devkit_path = x:/stuff/dev/devkitgp2x/\r
da42200b 4export CROSS = arm-linux-\r
cc68a136 5#CROSS = $(devkit_path)bin/arm-linux-\r
6\r
7# settings\r
cc68a136 8#mz80 = 1\r
0af33fe0 9#debug_cyclone = 1\r
66fdc0f0 10asm_memory = 1\r
cc68a136 11asm_render = 1\r
12asm_ym2612 = 1\r
3a81ecde 13asm_misc = 1\r
7336a99a 14asm_cdpico = 1\r
4ff2d527 15asm_cdmemory = 1\r
e8151fd5 16amalgamate = 0\r
cc68a136 17#profile = 1\r
18#use_musashi = 1\r
19#up = 1\r
20\r
2d0b15bb 21\r
22ifeq "$(debug_cyclone)" "1"\r
23use_cyclone = 1\r
24use_musashi = 1\r
2270612a 25endif\r
26ifeq "$(use_musashi)" "1"\r
27asm_cdpico = 0\r
2d0b15bb 28asm_memory = 0\r
29asm_cdmemory = 0\r
2270612a 30else\r
2d0b15bb 31use_cyclone = 1\r
32endif\r
33\r
3ec29f01 34DEFINC = -I../.. -I. -DARM -D__GP2X__ # -DBENCHMARK\r
1dceadae 35COPT_COMMON = -static -Wall -Winline\r
36ifeq ($(DEBUG),)\r
ca61ee42 37COPT_COMMON += -O3 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
1dceadae 38else\r
39COPT_COMMON += -ggdb\r
40endif\r
cc68a136 41ifeq "$(profile)" "1"\r
42COPT_COMMON += -fprofile-generate\r
43endif\r
44ifeq "$(profile)" "2"\r
45COPT_COMMON += -fprofile-use\r
46endif\r
ca482e5d 47CFLAGS = $(COPT_COMMON) -mcpu=arm920t -mtune=arm920t\r
48SFLAGS = $(CFLAGS)\r
49ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r
50CC = $(CROSS)gcc\r
cc68a136 51STRIP = $(CROSS)strip\r
52AS = $(CROSS)as\r
53LD = $(CROSS)ld\r
54OBJCOPY = $(CROSS)objcopy\r
55\r
56# frontend\r
e5ab6faf 57OBJS += main.o menu.o gp2x.o emu.o squidgehack.o cpuctrl.o\r
cc68a136 58# 940 core control\r
85f8e929 59OBJS += 940ctl.o\r
eff55556 60\r
e5f426aa 61# common\r
8187ba84 62OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r
16b0afd0 63 platform/common/arm_utils.o platform/common/arm_linux.o platform/common/readpng.o \\r
e5ab6faf 64 platform/common/mp3_helix.o platform/linux/usbjoy.o platform/linux/sndout_oss.o\r
e5f426aa 65\r
cc68a136 66# Pico\r
eff55556 67ifeq "$(amalgamate)" "1"\r
efcba75f 68OBJS += ../../picoAll.o\r
eff55556 69else\r
efcba75f 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
8c1952f0 72# Pico - CD\r
efcba75f 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
eff55556 76endif\r
c9e1affc 77# Pico - Pico\r
efcba75f 78OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o\r
0ffefdb8 79# Pico - carthw\r
efcba75f 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
eff55556 82\r
cc68a136 83# Pico - sound\r
eff55556 84ifneq "$(amalgamate)" "1"\r
efcba75f 85OBJS += pico/sound/sound.o\r
eff55556 86endif\r
efcba75f 87OBJS += pico/sound/mix_arm.o\r
88OBJS += pico/sound/sn76496.o pico/sound/ym2612.o\r
cc68a136 89# zlib\r
8187ba84 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
cc68a136 92# unzip\r
8187ba84 93OBJS += unzip/unzip.o unzip/unzip_stream.o\r
2d0b15bb 94# debug\r
95ifeq "$(debug_cyclone)" "1"\r
efcba75f 96OBJS += pico/DebugCPU.o cpu/musashi/m68kdasm.o\r
2d0b15bb 97endif\r
cc68a136 98# CPU cores\r
99ifeq "$(use_musashi)" "1"\r
100DEFINC += -DEMU_M68K\r
8187ba84 101OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r
2d0b15bb 102endif\r
103ifeq "$(use_cyclone)" "1"\r
cc68a136 104DEFINC += -DEMU_C68K\r
8187ba84 105OBJS += cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r
cc68a136 106endif\r
107# drz80/mz80\r
108ifeq "$(mz80)" "1"\r
109DEFINC += -D_USE_MZ80\r
8187ba84 110OBJS += cpu/mz80/mz80.o\r
cc68a136 111else\r
112DEFINC += -D_USE_DRZ80\r
8187ba84 113OBJS += cpu/DrZ80/drz80.o\r
cc68a136 114endif\r
115\r
8187ba84 116vpath %.c = ../..\r
117vpath %.s = ../..\r
118vpath %.S = ../..\r
e5ab6faf 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
cb0316e4 121\r
8187ba84 122\r
123all: mkdirs PicoDrive.gpe\r
cc68a136 124\r
efcba75f 125include ../common/common_arm.mak\r
126\r
e55f0cbb 127PicoDrive.gpe : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r
b542be46 128 @echo ">>>" $@\r
ca482e5d 129 $(CC) -o $@ $(CFLAGS) $^ -lm -lpng -Wl,-Map=PicoDrive.map\r
7336a99a 130ifeq ($(DEBUG),)\r
b542be46 131 $(STRIP) $@\r
cc68a136 132endif\r
133\r
4f265db7 134up: PicoDrive.gpe\r
d5d11924 135 @cp -v PicoDrive.gpe /mnt/gp2x/mnt/sd/emus/PicoDrive/\r
672ad671 136\r
8187ba84 137clean: tidy\r
138 $(RM) PicoDrive.gpe\r
139tidy:\r
140 $(RM) $(OBJS)\r
8187ba84 141\r
7eed09b3 142readme.txt: ../../tools/textfilter ../base_readme.txt\r
143 ../../tools/textfilter ../base_readme.txt $@ GP2X\r
144\r
cb0316e4 145# ----------- release -----------\r
146ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
147ifeq ($(VER),)\r
148$(error need VER)\r
149endif\r
150endif\r
151\r
ab6653d8 152rel: PicoDrive.gpe code940/pico940_v3.bin readme.txt PicoDrive.man.txt PicoDrive.png ../game_def.cfg\r
cb0316e4 153 zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o\r
a4f0cc86 154 zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r
c0fcf293 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
cb0316e4 159\r
160code940/code940.bin:\r
161 make -C code940/\r
162\r