e5ab6faf |
1 | #export CROSS = arm-none-linux-gnueabi-\r |
2 | LIBROOT = /home/notaz/dev/pnd/libroot\r |
3a3947cd |
3 | \r |
4 | # settings\r |
5 | #mz80 = 1\r |
3bb7bd19 |
6 | #cz80 = 1\r |
3a3947cd |
7 | #debug_cyclone = 1\r |
8 | asm_memory = 1\r |
9 | asm_render = 1\r |
10 | asm_ym2612 = 1\r |
11 | asm_misc = 1\r |
12 | asm_cdpico = 1\r |
13 | asm_cdmemory = 1\r |
14 | amalgamate = 0\r |
15 | #profile = 1\r |
16 | #use_musashi = 1\r |
3bb7bd19 |
17 | #use_famec = 1\r |
3a3947cd |
18 | \r |
19 | \r |
20 | ifeq "$(debug_cyclone)" "1"\r |
21 | use_cyclone = 1\r |
22 | use_musashi = 1\r |
23 | endif\r |
24 | ifeq "$(use_musashi)" "1"\r |
25 | asm_cdpico = 0\r |
26 | asm_memory = 0\r |
27 | asm_cdmemory = 0\r |
28 | else\r |
29 | use_cyclone = 1\r |
30 | endif\r |
31 | \r |
b6820926 |
32 | DEFINC = -I../.. -I. -DARM -DPANDORA -DIN_EVDEV\r |
e5ab6faf |
33 | COPT_COMMON = -Wall -Winline -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -I$(LIBROOT)/include\r |
3a3947cd |
34 | ifeq ($(DEBUG),)\r |
3bb7bd19 |
35 | COPT_COMMON += -O2 # -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r |
3a3947cd |
36 | else\r |
37 | COPT_COMMON += -ggdb\r |
38 | endif\r |
39 | ifeq "$(profile)" "1"\r |
40 | COPT_COMMON += -fprofile-generate\r |
41 | endif\r |
42 | ifeq "$(profile)" "2"\r |
43 | COPT_COMMON += -fprofile-use\r |
44 | endif\r |
efcba75f |
45 | CFLAGS = $(COPT_COMMON)\r |
46 | SFLAGS = $(CFLAGS)\r |
47 | ASFLAGS = -mcpu=cortex-a8\r |
48 | CC = $(CROSS)gcc\r |
3a3947cd |
49 | STRIP = $(CROSS)strip\r |
50 | AS = $(CROSS)as\r |
51 | LD = $(CROSS)ld\r |
52 | OBJCOPY = $(CROSS)objcopy\r |
53 | \r |
54 | # frontend\r |
e5ab6faf |
55 | OBJS += pandora.o main.o emu.o asm_utils.o platform/gp2x/menu.o\r |
3a3947cd |
56 | \r |
57 | # common\r |
58 | OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r |
e5ab6faf |
59 | platform/common/arm_utils.o platform/common/mp3_helix.o platform/common/arm_linux.o \\r |
b6820926 |
60 | platform/common/readpng.o platform/common/input.o platform/linux/in_evdev.o \\r |
61 | platform/linux/sndout_oss.o\r |
3a3947cd |
62 | \r |
63 | # Pico\r |
64 | ifeq "$(amalgamate)" "1"\r |
efcba75f |
65 | OBJS += ../../picoAll.o\r |
3a3947cd |
66 | else\r |
efcba75f |
67 | OBJS += pico/area.o pico/cart.o pico/memory.o pico/misc.o pico/pico.o pico/sek.o \\r |
68 | pico/videoport.o pico/draw2.o pico/draw.o pico/patch.o pico/debug.o\r |
3a3947cd |
69 | # Pico - CD\r |
efcba75f |
70 | OBJS += 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 |
3a3947cd |
73 | endif\r |
74 | # Pico - Pico\r |
efcba75f |
75 | OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o\r |
3a3947cd |
76 | # Pico - carthw\r |
efcba75f |
77 | OBJS += 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 |
3a3947cd |
79 | \r |
80 | # Pico - sound\r |
81 | ifneq "$(amalgamate)" "1"\r |
efcba75f |
82 | OBJS += pico/sound/sound.o\r |
3a3947cd |
83 | endif\r |
efcba75f |
84 | OBJS += pico/sound/mix_arm.o\r |
85 | OBJS += pico/sound/sn76496.o pico/sound/ym2612.o\r |
3a3947cd |
86 | # zlib\r |
87 | OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \\r |
88 | zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o\r |
89 | # unzip\r |
90 | OBJS += unzip/unzip.o unzip/unzip_stream.o\r |
91 | # debug\r |
92 | ifeq "$(debug_cyclone)" "1"\r |
efcba75f |
93 | OBJS += pico/DebugCPU.o cpu/musashi/m68kdasm.o\r |
3a3947cd |
94 | endif\r |
95 | # CPU cores\r |
96 | ifeq "$(use_musashi)" "1"\r |
97 | DEFINC += -DEMU_M68K\r |
98 | OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r |
99 | endif\r |
100 | ifeq "$(use_cyclone)" "1"\r |
101 | DEFINC += -DEMU_C68K\r |
102 | OBJS += cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r |
103 | endif\r |
3bb7bd19 |
104 | ifeq "$(use_famec)" "1"\r |
105 | DEFINC += -DEMU_F68K\r |
106 | OBJS += cpu/fame/famec.o\r |
107 | endif\r |
3a3947cd |
108 | # drz80/mz80\r |
109 | ifeq "$(mz80)" "1"\r |
110 | DEFINC += -D_USE_MZ80\r |
111 | OBJS += cpu/mz80/mz80.o\r |
112 | else\r |
3bb7bd19 |
113 | ifeq "$(cz80)" "1"\r |
114 | DEFINC += -D_USE_CZ80\r |
115 | OBJS += cpu/cz80/cz80.o\r |
116 | else\r |
3a3947cd |
117 | DEFINC += -D_USE_DRZ80\r |
118 | OBJS += cpu/DrZ80/drz80.o\r |
119 | endif\r |
3bb7bd19 |
120 | endif\r |
3a3947cd |
121 | \r |
122 | vpath %.c = ../..\r |
123 | vpath %.s = ../..\r |
124 | vpath %.S = ../..\r |
e5ab6faf |
125 | DIRS = platform platform/gp2x platform/linux platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \\r |
3a3947cd |
126 | zlib unzip cpu cpu/musashi cpu/Cyclone/proj cpu/Cyclone/tools cpu/mz80 cpu/DrZ80\r |
127 | \r |
128 | \r |
129 | all: mkdirs PicoDrive\r |
130 | \r |
efcba75f |
131 | include ../common/common_arm.mak\r |
132 | \r |
e55f0cbb |
133 | PicoDrive : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r |
3a3947cd |
134 | @echo ">>>" $@\r |
b6820926 |
135 | $(CC) -o $@ $(CFLAGS) $^ -lm -Wl,-Map=PicoDrive.map -lpng -L$(LIBROOT)/lib -static\r |
3a3947cd |
136 | ifeq ($(DEBUG),)\r |
137 | $(STRIP) $@\r |
138 | endif\r |
139 | \r |
3a3947cd |
140 | clean: tidy\r |
141 | $(RM) PicoDrive\r |
142 | tidy:\r |
143 | $(RM) $(OBJS)\r |
3a3947cd |
144 | \r |
145 | readme.txt: ../../tools/textfilter ../base_readme.txt\r |
146 | ../../tools/textfilter ../base_readme.txt $@ GP2X\r |
147 | \r |
3a3947cd |
148 | # ----------- release -----------\r |
149 | ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r |
150 | $(error TODO)\r |
151 | ifeq ($(VER),)\r |
152 | $(error need VER)\r |
153 | endif\r |
154 | endif\r |
155 | \r |