input: support analog read
[picodrive.git] / platform / gp2x / Makefile
CommitLineData
f0d7b1fa 1CROSS ?= arm-linux-\r
cc68a136 2\r
3# settings\r
f0d7b1fa 4use_cyclone = 1\r
5#use_musashi = 1\r
6use_drz80 = 1\r
7use_sh2drc = 1\r
8#use_sh2mame = 1\r
9\r
0ace9b9a 10asm_memory = 1\r
cc68a136 11asm_render = 1\r
12asm_ym2612 = 1\r
3a81ecde 13asm_misc = 1\r
7336a99a 14asm_cdpico = 1\r
0ace9b9a 15asm_cdmemory = 1\r
5a681086 16asm_32xdraw = 1\r
490eb480 17#profile = 1\r
80599a42 18#drc_debug = 3\r
cc68a136 19\r
553c3eaa 20-include Makefile.local\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
553c3eaa 27# due to CPU stop flag acces\r
2270612a 28asm_cdpico = 0\r
2d0b15bb 29asm_cdmemory = 0\r
2d0b15bb 30endif\r
31\r
f0d7b1fa 32ARCH = arm\r
274f95a9 33DEFINES += ARM __GP2X__ IN_GP2X IN_EVDEV # BENCHMARK\r
34CFLAGS += -Wall -Winline -I../.. -I.\r
1dceadae 35ifeq ($(DEBUG),)\r
e39e0acb 36CFLAGS += -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
cc68a136 37endif\r
ee2a3bdf 38CFLAGS += -mcpu=arm920t -mtune=arm920t\r
ca482e5d 39ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r
274f95a9 40LDFLAGS += -lm -lpng\r
41\r
ca482e5d 42CC = $(CROSS)gcc\r
cc68a136 43STRIP = $(CROSS)strip\r
44AS = $(CROSS)as\r
45LD = $(CROSS)ld\r
46OBJCOPY = $(CROSS)objcopy\r
47\r
48# frontend\r
274f95a9 49OBJS += plat.o warm.o pollux_set.o soc.o soc_mmsp2.o soc_pollux.o soc_dummy.o emu.o in_gp2x.o\r
cc68a136 50# 940 core control\r
85f8e929 51OBJS += 940ctl.o\r
eff55556 52\r
697746df 53# ARM stuff\r
54OBJS += pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o\r
55OBJS += pico/sound/mix_arm.o\r
56\r
e5f426aa 57# common\r
21ebcfd3 58OBJS += platform/common/emu.o platform/common/menu_pico.o platform/common/fonts.o platform/common/config.o \\r
490eb480 59 platform/common/arm_utils.o platform/common/arm_linux.o platform/common/readpng.o \\r
7c18e34a 60 platform/common/mp3_helix.o platform/common/input.o platform/common/main.o platform/common/mp3.o \\r
bbc8ceb9 61 platform/linux/sndout_oss.o platform/linux/plat.o platform/linux/in_evdev.o\r
e5f426aa 62\r
e39e0acb 63# unzip\r
64OBJS += unzip/unzip.o unzip/unzip_stream.o\r
cc68a136 65# zlib\r
8187ba84 66OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \\r
67 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o\r
cc68a136 68\r
8187ba84 69vpath %.c = ../..\r
70vpath %.s = ../..\r
71vpath %.S = ../..\r
490eb480 72\r
697746df 73DIRS += platform/gp2x platform/linux zlib unzip \r
cb0316e4 74\r
8187ba84 75\r
490eb480 76all: mkdirs PicoDrive\r
cc68a136 77\r
f0d7b1fa 78include ../common/common.mak\r
efcba75f 79include ../common/common_arm.mak\r
87b0845f 80include ../common/revision.mak\r
b3158e98 81\r
697746df 82CFLAGS += $(addprefix -D,$(DEFINES))\r
83\r
490eb480 84# partial linking helps profiled builds due to section merging\r
e39e0acb 85PicoDrive.o : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r
86 $(LD) -r -o $@ $^\r
87\r
490eb480 88# still using static, dynamic linking slows Wiz 1-10%\r
89# also libm on F100 is not compatible\r
90PicoDrive : PicoDrive.o\r
b542be46 91 @echo ">>>" $@\r
274f95a9 92 $(CC) -static -o $@ $(CFLAGS) $^ $(LDFLAGS) -Wl,-Map=$@.map\r
7336a99a 93ifeq ($(DEBUG),)\r
b542be46 94 $(STRIP) $@\r
cc68a136 95endif\r
96\r
ee2a3bdf 97up: PicoDrive\r
98 @cp -v PicoDrive /mnt/gp2x/mnt/sd/emus/PicoDrive/\r
672ad671 99\r
8187ba84 100clean: tidy\r
ee2a3bdf 101 $(RM) PicoDrive\r
8187ba84 102tidy:\r
103 $(RM) $(OBJS)\r
8187ba84 104\r
7eed09b3 105readme.txt: ../../tools/textfilter ../base_readme.txt\r
106 ../../tools/textfilter ../base_readme.txt $@ GP2X\r
107\r
cb0316e4 108# ----------- release -----------\r
8340e7c9 109VER ?= $(shell head -n 1 version.h | sed 's/.*"\(.*\)\.\(.*\)".*/\1\2/g')\r
4010330c 110CODE940 = code940/pico940_v3.bin\r
cb0316e4 111\r
8340e7c9 112rel: PicoDrive PicoDrive.gpe $(CODE940) readme.txt ../game_def.cfg \\r
113 PicoDrive.png PicoDrive_s.png PicoDrive_t.png \\r
114 warm_2.4.25.o warm_2.4.26-open2x.o warm_2.6.24.ko \\r
115 ../../pico/carthw.cfg\r
116 mkdir -p out/PicoDrive/skin/\r
117 cp $^ out/PicoDrive/\r
118 cp PicoDrive.ini out/\r
119 cp skin/*.png out/PicoDrive/skin/\r
120 cp skin/*.txt out/PicoDrive/skin/\r
121 mkdir out/bin_to_cso_mp3\r
122 cp ../../tools/bin_to_cso_mp3/* out/bin_to_cso_mp3/\r
123 cd out && zip -9 -r ../../../PicoDrive_$(VER).zip *\r
124 rm -rf out\r
cb0316e4 125\r
4010330c 126$(CODE940):\r
cb0316e4 127 make -C code940/\r
128\r