f0d7b1fa |
1 | CROSS ?= arm-linux-\r |
cc68a136 |
2 | \r |
3 | # settings\r |
f0d7b1fa |
4 | use_cyclone = 1\r |
5 | #use_musashi = 1\r |
6 | use_drz80 = 1\r |
7 | use_sh2drc = 1\r |
8 | #use_sh2mame = 1\r |
9 | \r |
0ace9b9a |
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 |
0ace9b9a |
15 | asm_cdmemory = 1\r |
5a681086 |
16 | asm_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 |
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 |
553c3eaa |
27 | # due to CPU stop flag acces\r |
2270612a |
28 | asm_cdpico = 0\r |
2d0b15bb |
29 | asm_cdmemory = 0\r |
2d0b15bb |
30 | endif\r |
31 | \r |
f0d7b1fa |
32 | ARCH = arm\r |
274f95a9 |
33 | DEFINES += ARM __GP2X__ IN_GP2X IN_EVDEV # BENCHMARK\r |
34 | CFLAGS += -Wall -Winline -I../.. -I.\r |
1dceadae |
35 | ifeq ($(DEBUG),)\r |
e39e0acb |
36 | CFLAGS += -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math\r |
cc68a136 |
37 | endif\r |
ee2a3bdf |
38 | CFLAGS += -mcpu=arm920t -mtune=arm920t\r |
ca482e5d |
39 | ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r |
274f95a9 |
40 | LDFLAGS += -lm -lpng\r |
41 | \r |
ca482e5d |
42 | CC = $(CROSS)gcc\r |
cc68a136 |
43 | STRIP = $(CROSS)strip\r |
44 | AS = $(CROSS)as\r |
45 | LD = $(CROSS)ld\r |
46 | OBJCOPY = $(CROSS)objcopy\r |
47 | \r |
48 | # frontend\r |
274f95a9 |
49 | OBJS += 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 |
51 | OBJS += 940ctl.o\r |
eff55556 |
52 | \r |
697746df |
53 | # ARM stuff\r |
54 | OBJS += pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o\r |
55 | OBJS += pico/sound/mix_arm.o\r |
56 | \r |
e5f426aa |
57 | # common\r |
21ebcfd3 |
58 | OBJS += 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 |
64 | OBJS += unzip/unzip.o unzip/unzip_stream.o\r |
cc68a136 |
65 | # zlib\r |
8187ba84 |
66 | OBJS += 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 |
69 | vpath %.c = ../..\r |
70 | vpath %.s = ../..\r |
71 | vpath %.S = ../..\r |
490eb480 |
72 | \r |
697746df |
73 | DIRS += platform/gp2x platform/linux zlib unzip \r |
cb0316e4 |
74 | \r |
8187ba84 |
75 | \r |
490eb480 |
76 | all: mkdirs PicoDrive\r |
cc68a136 |
77 | \r |
f0d7b1fa |
78 | include ../common/common.mak\r |
efcba75f |
79 | include ../common/common_arm.mak\r |
87b0845f |
80 | include ../common/revision.mak\r |
b3158e98 |
81 | \r |
697746df |
82 | CFLAGS += $(addprefix -D,$(DEFINES))\r |
83 | \r |
490eb480 |
84 | # partial linking helps profiled builds due to section merging\r |
e39e0acb |
85 | PicoDrive.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 |
90 | PicoDrive : PicoDrive.o\r |
b542be46 |
91 | @echo ">>>" $@\r |
274f95a9 |
92 | $(CC) -static -o $@ $(CFLAGS) $^ $(LDFLAGS) -Wl,-Map=$@.map\r |
7336a99a |
93 | ifeq ($(DEBUG),)\r |
b542be46 |
94 | $(STRIP) $@\r |
cc68a136 |
95 | endif\r |
96 | \r |
ee2a3bdf |
97 | up: PicoDrive\r |
98 | @cp -v PicoDrive /mnt/gp2x/mnt/sd/emus/PicoDrive/\r |
672ad671 |
99 | \r |
8187ba84 |
100 | clean: tidy\r |
ee2a3bdf |
101 | $(RM) PicoDrive\r |
8187ba84 |
102 | tidy:\r |
103 | $(RM) $(OBJS)\r |
8187ba84 |
104 | \r |
7eed09b3 |
105 | readme.txt: ../../tools/textfilter ../base_readme.txt\r |
106 | ../../tools/textfilter ../base_readme.txt $@ GP2X\r |
107 | \r |
cb0316e4 |
108 | # ----------- release -----------\r |
8340e7c9 |
109 | VER ?= $(shell head -n 1 version.h | sed 's/.*"\(.*\)\.\(.*\)".*/\1\2/g')\r |
4010330c |
110 | CODE940 = code940/pico940_v3.bin\r |
cb0316e4 |
111 | \r |
8340e7c9 |
112 | rel: 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 |