e5f426aa |
1 | \r |
2 | # you may or may not need to change this\r |
84100c0f |
3 | export CROSS = arm-wince-cegcc-\r |
e5f426aa |
4 | \r |
5 | # settings\r |
6 | asm_memory = 1\r |
7 | asm_render = 1\r |
8 | asm_ym2612 = 1\r |
9 | asm_misc = 1\r |
10 | asm_cdpico = 1\r |
11 | asm_cdmemory = 1\r |
12 | amalgamate = 0\r |
13 | #profile = 1\r |
14 | \r |
15 | \r |
16 | \r |
3ec29f01 |
17 | DEFINC = -I../.. -I. -D__GIZ__ -DNO_SYNC\r |
2ec14aec |
18 | COPT_COMMON = -Wall -Winline\r |
ea8c405f |
19 | ifeq ($(DEBUG),)\r |
2ec14aec |
20 | COPT_COMMON += -O2 -ftracer -fomit-frame-pointer -fstrict-aliasing -ffast-math\r |
ea8c405f |
21 | else\r |
22 | COPT_COMMON += -ggdb\r |
23 | endif\r |
e5f426aa |
24 | ifeq "$(profile)" "1"\r |
25 | COPT_COMMON += -fprofile-generate\r |
26 | endif\r |
27 | ifeq "$(profile)" "2"\r |
28 | COPT_COMMON += -fprofile-use\r |
29 | endif\r |
84100c0f |
30 | CFLAGS = $(COPT_COMMON) -mcpu=arm920t -mtune=arm920t\r |
ca482e5d |
31 | SFLAGS = $(CFLAGS)\r |
e5f426aa |
32 | ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r |
ca482e5d |
33 | CC = $(CROSS)gcc\r |
e5f426aa |
34 | STRIP = $(CROSS)strip\r |
35 | AS = $(CROSS)as\r |
36 | LD = $(CROSS)ld\r |
37 | \r |
38 | # frontend\r |
ea8c405f |
39 | OBJS += main.o emu.o menu.o giz.o asm_utils.o\r |
e5f426aa |
40 | \r |
41 | # common\r |
84100c0f |
42 | OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r |
43 | platform/common/arm_utils.o platform/common/readpng.o platform/common/mp3_helix.o\r |
e5f426aa |
44 | \r |
45 | # Pico\r |
46 | ifeq "$(amalgamate)" "1"\r |
efcba75f |
47 | OBJS += picoAll.o\r |
e5f426aa |
48 | else\r |
efcba75f |
49 | OBJS += pico/area.o pico/cart.o pico/memory.o pico/misc.o pico/pico.o pico/sek.o \\r |
c8d1e9b6 |
50 | pico/videoport.o pico/draw2.o pico/draw.o pico/z80if.o pico/patch.o pico/debug.o\r |
e5f426aa |
51 | # Pico - CD\r |
efcba75f |
52 | OBJS += 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 pico/cd/cue.o \\r |
54 | pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o\r |
e5f426aa |
55 | endif\r |
84100c0f |
56 | # Pico - Pico\r |
efcba75f |
57 | OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o\r |
84100c0f |
58 | # Pico - carthw\r |
efcba75f |
59 | OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \\r |
60 | pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o\r |
e5f426aa |
61 | \r |
62 | # Pico - sound\r |
63 | ifneq "$(amalgamate)" "1"\r |
efcba75f |
64 | OBJS += pico/sound/sound.o\r |
e5f426aa |
65 | endif\r |
efcba75f |
66 | OBJS += pico/sound/mix_asm.o\r |
67 | OBJS += pico/sound/sn76496.o pico/sound/ym2612.o\r |
e5f426aa |
68 | # zlib\r |
84100c0f |
69 | OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \\r |
70 | zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o\r |
e5f426aa |
71 | # unzip\r |
84100c0f |
72 | OBJS += unzip/unzip.o unzip/unzip_stream.o\r |
e5f426aa |
73 | # CPU cores\r |
74 | # Cyclone\r |
75 | DEFINC += -DEMU_C68K\r |
84100c0f |
76 | OBJS += cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r |
e5f426aa |
77 | # drz80\r |
78 | DEFINC += -D_USE_DRZ80\r |
84100c0f |
79 | OBJS += cpu/DrZ80/drz80.o\r |
e5f426aa |
80 | \r |
84100c0f |
81 | vpath %.c = ../..\r |
82 | vpath %.s = ../..\r |
83 | vpath %.S = ../..\r |
efcba75f |
84 | DIRS = platform platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \\r |
84100c0f |
85 | zlib unzip cpu cpu/musashi cpu/Cyclone/proj cpu/Cyclone/tools cpu/mz80 cpu/DrZ80\r |
e5f426aa |
86 | \r |
e5f426aa |
87 | \r |
84100c0f |
88 | all: mkdirs PicoDrive.exe readme.txt\r |
89 | \r |
90 | PicoDrive.exe : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r |
2ec14aec |
91 | @echo ">>>" $@\r |
ca482e5d |
92 | $(CC) -o $@ -static $(CFLAGS) $^ -lm -lpng -Lkgsdk/ -lKGSDK -Wl,-Map=PicoDrive.map \\r |
84100c0f |
93 | 2>&1 | grep -v ".idata$$4" # | grep -v "supports interworking, whereas"\r |
e5f426aa |
94 | ifeq ($(DEBUG),)\r |
2ec14aec |
95 | $(STRIP) $@\r |
e5f426aa |
96 | endif\r |
84100c0f |
97 | ifeq "$(profile)" "1"\r |
98 | ../../tools/gcda $@\r |
99 | endif\r |
e5f426aa |
100 | \r |
101 | \r |
7eed09b3 |
102 | readme.txt: ../../tools/textfilter ../base_readme.txt\r |
103 | ../../tools/textfilter ../base_readme.txt $@ GIZ\r |
104 | \r |
ca482e5d |
105 | include ../common/common_arm.mak\r |
7eed09b3 |
106 | \r |
e5f426aa |
107 | \r |
108 | # cleanup\r |
109 | clean: tidy\r |
110 | @$(RM) PicoDrive.exe\r |
111 | tidy:\r |
112 | @$(RM) $(OBJS)\r |
113 | \r |
114 | \r |
ea8c405f |
115 | up: PicoDrive.exe\r |
116 | synce-pcp -d 3 PicoDrive.exe ":/SD Card/emus/PicoDrive/PicoDrive.exe"\r |
117 | \r |
118 | run: up\r |
119 | synce-prun "/SD Card/emus/PicoDrive/PicoDrive.exe"\r |
120 | \r |
121 | run_only:\r |
122 | synce-prun "/SD Card/emus/PicoDrive/PicoDrive.exe"\r |
123 | \r |
e5f426aa |
124 | # ----------- release -----------\r |
125 | ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r |
126 | ifeq ($(VER),)\r |
127 | $(error need VER)\r |
128 | endif\r |
129 | endif\r |
130 | \r |
84100c0f |
131 | rel: PicoDrive.exe kgsdk/ARMV4IRel/KGSDK.dll ../game_def.cfg readme.txt\r |
132 | zip -9 -j ../../PicoDrive_giz_$(VER).zip $^\r |
2ec14aec |
133 | ln -s ../gp2x/skin skin\r |
84100c0f |
134 | zip -9 -r ../../PicoDrive_giz_$(VER).zip skin -i \*.png -i \*.txt\r |
2ec14aec |
135 | rm skin\r |
e5f426aa |
136 | \r |