minor xlib fix
[picodrive.git] / platform / gp2x / Makefile
... / ...
CommitLineData
1export CROSS = arm-linux-\r
2\r
3# settings\r
4#mz80 = 1\r
5#debug_cyclone = 1\r
6asm_memory = 1\r
7asm_render = 1\r
8asm_ym2612 = 1\r
9asm_misc = 1\r
10asm_cdpico = 1\r
11asm_cdmemory = 1\r
12amalgamate = 0\r
13#profile = 1\r
14#use_musashi = 1\r
15#up = 1\r
16\r
17\r
18ifeq "$(debug_cyclone)" "1"\r
19use_cyclone = 1\r
20use_musashi = 1\r
21endif\r
22ifeq "$(use_musashi)" "1"\r
23asm_cdpico = 0\r
24asm_memory = 0\r
25asm_cdmemory = 0\r
26else\r
27use_cyclone = 1\r
28endif\r
29\r
30DEFINC = -I../.. -I. -DARM -D__GP2X__ -DIN_GP2X -DIN_EVDEV # -DBENCHMARK\r
31CFLAGS += -Wall -Winline\r
32ifeq ($(DEBUG),)\r
33CFLAGS += -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
34else\r
35CFLAGS += -ggdb\r
36endif\r
37ifeq "$(profile)" "1"\r
38CFLAGS += -fprofile-generate\r
39endif\r
40ifeq "$(profile)" "2"\r
41CFLAGS += -fprofile-use\r
42endif\r
43CFLAGS += -mcpu=arm920t -mtune=arm920t\r
44SFLAGS = $(CFLAGS)\r
45ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r
46CC = $(CROSS)gcc\r
47STRIP = $(CROSS)strip\r
48AS = $(CROSS)as\r
49LD = $(CROSS)ld\r
50OBJCOPY = $(CROSS)objcopy\r
51\r
52# frontend\r
53OBJS += plat.o warm.o pollux_set.o soc.o soc_mmsp2.o soc_pollux.o emu.o in_gp2x.o\r
54# 940 core control\r
55OBJS += 940ctl.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/arm_linux.o platform/common/readpng.o \\r
60 platform/common/mp3_helix.o platform/common/input.o platform/common/main.o \\r
61 platform/linux/sndout_oss.o platform/linux/plat.o platform/linux/in_evdev.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 pico/z80if.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# unzip\r
87OBJS += unzip/unzip.o unzip/unzip_stream.o\r
88# zlib\r
89OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \\r
90 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.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 "$(mz80)" "1"\r
105DEFINC += -D_USE_MZ80\r
106OBJS += cpu/mz80/mz80.o\r
107else\r
108DEFINC += -D_USE_DRZ80\r
109OBJS += cpu/DrZ80/drz80.o\r
110endif\r
111\r
112vpath %.c = ../..\r
113vpath %.s = ../..\r
114vpath %.S = ../..\r
115\r
116DIRS = platform platform/gp2x platform/linux platform/common pico pico/cd pico/pico pico/sound \\r
117 pico/carthw/svp zlib unzip cpu cpu/musashi cpu/Cyclone/proj cpu/Cyclone/tools cpu/mz80 cpu/DrZ80\r
118\r
119\r
120all: mkdirs PicoDrive\r
121\r
122include ../common/common_arm.mak\r
123\r
124platform/common/menu.o : revision.h\r
125\r
126revision.h:\r
127 @echo "#define REVISION \"`svn info | grep Revision | cut -c 11-`\"" > /tmp/r.tmp\r
128 @diff -q $@ /tmp/r.tmp > /dev/null 2>&1 || mv -f /tmp/r.tmp $@\r
129\r
130# partial linking helps profiled builds due to section merging\r
131PicoDrive.o : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r
132 $(LD) -r -o $@ $^\r
133\r
134# still using static, dynamic linking slows Wiz 1-10%\r
135# also libm on F100 is not compatible\r
136PicoDrive : PicoDrive.o\r
137 @echo ">>>" $@\r
138 $(CC) -static -o $@ $(CFLAGS) $^ -lm -lpng -Wl,-Map=$@.map\r
139ifeq ($(DEBUG),)\r
140 $(STRIP) $@\r
141endif\r
142\r
143up: PicoDrive\r
144 @cp -v PicoDrive /mnt/gp2x/mnt/sd/emus/PicoDrive/\r
145\r
146clean: tidy\r
147 $(RM) PicoDrive\r
148tidy:\r
149 $(RM) $(OBJS)\r
150\r
151readme.txt: ../../tools/textfilter ../base_readme.txt\r
152 ../../tools/textfilter ../base_readme.txt $@ GP2X\r
153\r
154# ----------- release -----------\r
155ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
156ifeq ($(VER),)\r
157$(error need VER)\r
158endif\r
159endif\r
160CODE940 = code940/pico940_v3.bin\r
161\r
162rel: PicoDrive PicoDrive.gpe $(CODE940) readme.txt PicoDrive.png ../game_def.cfg \\r
163 warm_2.4.25.o warm_2.4.26-open2x.o warm_2.6.24.ko\r
164 zip -9 -j ../../PicoDrive_$(VER).zip $^\r
165 zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r
166 mkdir bin_to_cso_mp3\r
167 cp ../../tools/bin_to_cso_mp3/* bin_to_cso_mp3/\r
168 zip -9 -r ../../PicoDrive_$(VER).zip bin_to_cso_mp3\r
169 rm -rf bin_to_cso_mp3\r
170\r
171$(CODE940):\r
172 make -C code940/\r
173\r