some audio problems fixed, missing files added
[libpicofe.git] / gp2x / Makefile
... / ...
CommitLineData
1\r
2# you may or may not need to change this\r
3#devkit_path = x:/stuff/dev/devkitgp2x/\r
4CROSS = arm-linux-\r
5#CROSS = $(devkit_path)bin/arm-linux-\r
6\r
7# settings\r
8dprint = 1\r
9#mz80 = 1\r
10#debug_cyclone = 1\r
11asm_memory = 0 # TODO\r
12asm_render = 1\r
13asm_ym2612 = 1\r
14#profile = 1\r
15#use_musashi = 1\r
16#up = 1\r
17\r
18DEFINC = -I../.. -I. -DARM -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK\r
19COPT_COMMON = -static -s -O3 -ftracer -fstrength-reduce -Wall -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
20ifeq "$(profile)" "1"\r
21COPT_COMMON += -fprofile-generate\r
22endif\r
23ifeq "$(profile)" "2"\r
24COPT_COMMON += -fprofile-use\r
25endif\r
26COPT = $(COPT_COMMON) -mtune=arm920t\r
27ASOPT = -mcpu=arm920t -mfloat-abi=soft\r
28GCC = $(CROSS)gcc\r
29STRIP = $(CROSS)strip\r
30AS = $(CROSS)as\r
31LD = $(CROSS)ld\r
32OBJCOPY = $(CROSS)objcopy\r
33\r
34# frontend\r
35OBJS += main.o menu.o gp2x.o usbjoy.o emu.o squidgehack.o asmutils.o cpuctrl.o\r
36# 940 core control\r
37OBJS += 940ctl_ym2612.o\r
38# Pico\r
39OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Utils.o ../../Pico/Memory.o ../../Pico/Misc.o \\r
40 ../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o\r
41# Pico - CD\r
42OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \\r
43 ../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \\r
44 ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o\r
45# asm stuff\r
46ifeq "$(asm_render)" "1"\r
47DEFINC += -D_ASM_DRAW_C\r
48OBJS += ../../Pico/draw_asm.o ../../Pico/draw2_asm.o\r
49endif\r
50ifeq "$(asm_memory)" "1"\r
51DEFINC += -D_ASM_MEMORY_C\r
52OBJS += ../../Pico/memory_asm.o\r
53endif\r
54ifeq "$(asm_ym2612)" "1"\r
55DEFINC += -D_ASM_YM2612_C\r
56OBJS += ../../Pico/sound/ym2612_asm.o\r
57endif\r
58# Pico - sound\r
59OBJS += ../../Pico/sound/mix_asm.o\r
60OBJS += ../../Pico/sound/sound.o ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o\r
61# zlib\r
62OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \\r
63 ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o\r
64# unzip\r
65OBJS += ../../unzip/unzip.o\r
66# mp3\r
67OBJS += mp3.o\r
68# CPU cores\r
69ifeq "$(use_musashi)" "1"\r
70DEFINC += -DEMU_M68K\r
71OBJS += _build\m68kcpu.o _build\m68kopac.o _build\m68kopdm.o _build\m68kopnz.o _build\m68kops.o\r
72else\r
73DEFINC += -DEMU_C68K\r
74OBJS += ../../cpu/Cyclone/proj/Cyclone.o\r
75endif\r
76# drz80/mz80\r
77ifeq "$(mz80)" "1"\r
78DEFINC += -D_USE_MZ80\r
79OBJS += ../../cpu/mz80/mz80.o\r
80else\r
81DEFINC += -D_USE_DRZ80\r
82OBJS += ../../cpu/DrZ80/drz80.o\r
83endif\r
84\r
85\r
86all: PicoDrive.gpe\r
87\r
88PicoDrive.gpe : $(OBJS) helix/helix_mp3.a\r
89 @echo $@\r
90 @$(GCC) -o $@ $(COPT) $^ -lm\r
91 @$(STRIP) $@\r
92# @$(GCC) $(COPT) $(OBJS) -lm -o PicoDrive_.gpe\r
93# @gpecomp PicoDrive_.gpe $@\r
94ifeq "$(up)" "1"\r
95 @cmd //C copy $@ \\\\10.0.1.2\\gp2x\\mnt\\sd\\games\\PicoDrive\\\r
96endif\r
97\r
98up: PicoDrive.gpe\r
99 @cp -v PicoDrive.gpe /mnt/gp2x/mnt/sd/games/PicoDrive/\r
100\r
101# @cmd //C copy PicoDrive.gpe \\\\10.0.1.2\\gp2x\\mnt\\sd\\games\\PicoDrive\\\r
102\r
103\r
104testrefr.gpe : test.o gp2x.o asmutils.o\r
105 @echo $@\r
106 @$(GCC) $(COPT) $^ -o $@\r
107 @$(STRIP) $@\r
108\r
109.c.o:\r
110 @echo $<\r
111 @$(GCC) $(COPT) $(DEFINC) -c $< -o $@\r
112.s.o:\r
113 @echo $<\r
114 @$(GCC) $(COPT) $(DEFINC) -c $< -o $@\r
115\r
116../../Pico/draw_asm.o : ../../Pico/Draw.s\r
117 @echo $<\r
118 @$(AS) $(ASOPT) $< -o $@\r
119../../Pico/draw2_asm.o : ../../Pico/Draw2.s\r
120 @echo $<\r
121 @$(AS) $(ASOPT) $< -o $@\r
122../../Pico/memory_asm.o : ../../Pico/Memory.s\r
123 @echo $<\r
124 @$(AS) $(ASOPT) $< -o $@\r
125../../Pico/sound/ym2612_asm.o : ../../Pico/sound/ym2612.s\r
126 @echo $<\r
127 @$(AS) $(ASOPT) $< -o $@\r
128../../Pico/sound/mix_asm.o : ../../Pico/sound/mix.s\r
129 @echo $<\r
130 @$(AS) $(ASOPT) $< -o $@\r
131\r
132# build Cyclone\r
133../../cpu/Cyclone/proj/Cyclone.s :\r
134 @echo building Cyclone...\r
135 @make -C ../../cpu/Cyclone/proj -f Makefile.linux\r
136\r
137# build helix libs\r
138helix/helix_mp3.a:\r
139 make -C helix\r
140\r
141\r
142# cleanup\r
143clean: tidy\r
144 @$(RM) PicoDrive.gpe\r
145tidy:\r
146 @$(RM) $(OBJS)\r
147# @make -C ../../cpu/Cyclone/proj -f Makefile.linux clean\r
148\r
149\r
150clean_prof:\r
151 find ../.. -name '*.gcno' -delete\r
152 find ../.. -name '*.gcda' -delete\r
153\r
154# ----------- release -----------\r
155ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
156ifeq ($(VER),)\r
157$(error need VER)\r
158endif\r
159endif\r
160\r
161rel: PicoDrive.gpe code940/code940.bin ../readme.txt config.txt\r
162 zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o\r
163\r
164code940/code940.bin:\r
165 make -C code940/\r
166\r
167\r
168# test\r
169usbjoy.o : usbjoy.c\r
170 @echo $<\r
171 @$(GCC) $(COPT) $(DEFINC) -fno-profile-generate -c $< -o $@\r
172\r
173../../Pico/Cart.o : ../../Pico/Cart.c\r
174 @echo $<\r
175 @$(GCC) $(COPT) $(DEFINC) -fno-profile-generate -c $< -o $@\r
176\r
177../../zlib/trees.o : ../../zlib/trees.c\r
178 @echo $<\r
179 @$(GCC) $(COPT) $(DEFINC) -fno-profile-generate -c $< -o $@\r
180\r