readme updated
[picodrive.git] / platform / gizmondo / Makefile
CommitLineData
e5f426aa 1\r
2# you may or may not need to change this\r
da42200b 3export CROSS = /opt/cegcc/arm-wince-cegcc/bin/\r
e5f426aa 4\r
5# settings\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\r
15\r
16\r
3ec29f01 17DEFINC = -I../.. -I. -D__GIZ__ -DNO_SYNC\r
2ec14aec 18COPT_COMMON = -Wall -Winline\r
ea8c405f 19ifeq ($(DEBUG),)\r
2ec14aec 20COPT_COMMON += -O2 -ftracer -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
ea8c405f 21else\r
22COPT_COMMON += -ggdb\r
23endif\r
e5f426aa 24ifeq "$(profile)" "1"\r
25COPT_COMMON += -fprofile-generate\r
26endif\r
27ifeq "$(profile)" "2"\r
28COPT_COMMON += -fprofile-use\r
29endif\r
30COPT = $(COPT_COMMON) -mtune=arm920t\r
31ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r
32GCC = $(CROSS)gcc\r
33STRIP = $(CROSS)strip\r
34AS = $(CROSS)as\r
35LD = $(CROSS)ld\r
36\r
37# frontend\r
ea8c405f 38OBJS += main.o emu.o menu.o giz.o asm_utils.o\r
e5f426aa 39\r
40# common\r
da42200b 41OBJS += ../common/emu.o ../common/menu.o ../common/fonts.o ../common/arm_utils.o \\r
42 ../common/readpng.o ../common/mp3_helix.o\r
e5f426aa 43\r
44# Pico\r
45ifeq "$(amalgamate)" "1"\r
46OBJS += ../../PicoAll.o\r
47else\r
48OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Memory.o ../../Pico/Misc.o \\r
49 ../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \\r
50 ../../Pico/Patch.o\r
51# Pico - CD\r
52OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \\r
53 ../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \\r
54 ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.o\r
55endif\r
56\r
57# asm stuff\r
58ifeq "$(asm_render)" "1"\r
59DEFINC += -D_ASM_DRAW_C\r
60OBJS += ../../Pico/draw_asm.o ../../Pico/draw2_asm.o\r
61endif\r
62ifeq "$(asm_memory)" "1"\r
63DEFINC += -D_ASM_MEMORY_C\r
64OBJS += ../../Pico/memory_asm.o\r
65endif\r
66ifeq "$(asm_ym2612)" "1"\r
67DEFINC += -D_ASM_YM2612_C\r
68OBJS += ../../Pico/sound/ym2612_asm.o\r
69endif\r
70ifeq "$(asm_misc)" "1"\r
71DEFINC += -D_ASM_MISC_C\r
72OBJS += ../../Pico/misc_asm.o\r
73OBJS += ../../Pico/cd/misc_asm.o\r
74endif\r
75ifeq "$(asm_cdpico)" "1"\r
76DEFINC += -D_ASM_CD_PICO_C\r
77OBJS += ../../Pico/cd/pico_asm.o\r
78endif\r
79ifeq "$(asm_cdmemory)" "1"\r
80DEFINC += -D_ASM_CD_MEMORY_C\r
81OBJS += ../../Pico/cd/memory_asm.o\r
82endif\r
83\r
84# Pico - sound\r
85ifneq "$(amalgamate)" "1"\r
86OBJS += ../../Pico/sound/sound.o\r
87endif\r
88OBJS += ../../Pico/sound/mix_asm.o\r
89OBJS += ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o\r
90# zlib\r
91OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \\r
92 ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o\r
93# unzip\r
94OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o\r
e5f426aa 95# CPU cores\r
96# Cyclone\r
97DEFINC += -DEMU_C68K\r
98OBJS += ../../cpu/Cyclone/proj/Cyclone.o\r
99# drz80\r
100DEFINC += -D_USE_DRZ80\r
101OBJS += ../../cpu/DrZ80/drz80.o\r
102\r
103\r
7eed09b3 104all: PicoDrive.exe readme.txt\r
e5f426aa 105\r
da42200b 106PicoDrive.exe : $(OBJS) ../common/helix/helix_mp3.a\r
2ec14aec 107 @echo ">>>" $@\r
499a0be3 108 $(GCC) -o $@ -static $(COPT) $^ -lm -lpng -Lkgsdk/ -lKGSDK -Wl,-Map=PicoDrive.map 2>&1 | \\r
109 grep -v ".idata$$4" # | grep -v "supports interworking, whereas"\r
e5f426aa 110ifeq ($(DEBUG),)\r
2ec14aec 111 $(STRIP) $@\r
e5f426aa 112endif\r
113\r
114\r
115.c.o:\r
2ec14aec 116 @echo ">>>" $<\r
117 $(GCC) $(COPT) $(DEFINC) -c $< -o $@\r
e5f426aa 118#.s.o:\r
119# @echo $<\r
120# $(GCC) $(COPT) $(DEFINC) -c $< -o $@\r
121\r
122../../Pico/draw_asm.o : ../../Pico/Draw.s\r
fa283c9a 123 @echo ">>>" $@\r
e5f426aa 124 @$(AS) $(ASFLAGS) $< -o $@\r
125../../Pico/draw2_asm.o : ../../Pico/Draw2.s\r
fa283c9a 126 @echo ">>>" $@\r
e5f426aa 127 @$(AS) $(ASFLAGS) $< -o $@\r
128../../Pico/memory_asm.o : ../../Pico/Memory.s\r
fa283c9a 129 @echo ">>>" $@\r
e5f426aa 130 @$(AS) $(ASFLAGS) $< -o $@\r
131../../Pico/sound/ym2612_asm.o : ../../Pico/sound/ym2612.s\r
fa283c9a 132 @echo ">>>" $@\r
e5f426aa 133 @$(AS) $(ASFLAGS) $< -o $@\r
134../../Pico/sound/mix_asm.o : ../../Pico/sound/mix.s\r
fa283c9a 135 @echo ">>>" $@\r
e5f426aa 136 @$(AS) $(ASFLAGS) $< -o $@\r
ea8c405f 137../../Pico/misc_asm.o : ../../Pico/Misc.s\r
fa283c9a 138 @echo ">>>" $@\r
e5f426aa 139 @$(AS) $(ASFLAGS) $< -o $@\r
140../../Pico/cd/pico_asm.o : ../../Pico/cd/Pico.s\r
fa283c9a 141 @echo ">>>" $@\r
e5f426aa 142 @$(AS) $(ASFLAGS) $< -o $@\r
143../../Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s\r
fa283c9a 144 @echo ">>>" $@\r
e5f426aa 145 @$(AS) $(ASFLAGS) $< -o $@\r
ea8c405f 146../../Pico/cd/misc_asm.o : ../../Pico/cd/Misc.s\r
fa283c9a 147 @echo ">>>" $@\r
e5f426aa 148 @$(AS) $(ASFLAGS) $< -o $@\r
149\r
150# build Cyclone\r
7eed09b3 151../../cpu/Cyclone/proj/Cyclone.s:\r
e5f426aa 152 @echo building Cyclone...\r
153 @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h\r
154\r
da42200b 155# build helix libs\r
156../common/helix/helix_mp3.a:\r
157 make -C ../common/helix\r
e5f426aa 158\r
7eed09b3 159readme.txt: ../../tools/textfilter ../base_readme.txt\r
160 ../../tools/textfilter ../base_readme.txt $@ GIZ\r
161\r
162../../tools/textfilter: ../../tools/textfilter.c\r
163 make -C ../../tools/ textfilter\r
164\r
e5f426aa 165\r
166# cleanup\r
167clean: tidy\r
168 @$(RM) PicoDrive.exe\r
169tidy:\r
170 @$(RM) $(OBJS)\r
171\r
172\r
173clean_prof:\r
174 find ../.. -name '*.gcno' -delete\r
175 find ../.. -name '*.gcda' -delete\r
176\r
ea8c405f 177up: PicoDrive.exe\r
178 synce-pcp -d 3 PicoDrive.exe ":/SD Card/emus/PicoDrive/PicoDrive.exe"\r
179\r
180run: up\r
181 synce-prun "/SD Card/emus/PicoDrive/PicoDrive.exe"\r
182\r
183run_only:\r
184 synce-prun "/SD Card/emus/PicoDrive/PicoDrive.exe"\r
185\r
e5f426aa 186# ----------- release -----------\r
187ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
188ifeq ($(VER),)\r
189$(error need VER)\r
190endif\r
191endif\r
192\r
7eed09b3 193rel: PicoDrive.exe kgsdk/ARMV4IRel/KGSDK.dll readme.txt\r
e5f426aa 194 zip -9 -j ../../PicoDrive_$(VER).zip $^\r
2ec14aec 195 ln -s ../gp2x/skin skin\r
e5f426aa 196 zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r
2ec14aec 197 rm skin\r
e5f426aa 198\r