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