(ctr/3ds) optimize build, add support for 32x/svp dynamic recompilers.
[picodrive.git] / platform / gizmondo / Makefile
CommitLineData
e5f426aa 1\r
2# you may or may not need to change this\r
84100c0f 3export CROSS = arm-wince-cegcc-\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
84100c0f 30CFLAGS = $(COPT_COMMON) -mcpu=arm920t -mtune=arm920t\r
ca482e5d 31SFLAGS = $(CFLAGS)\r
e5f426aa 32ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r
ca482e5d 33CC = $(CROSS)gcc\r
e5f426aa 34STRIP = $(CROSS)strip\r
35AS = $(CROSS)as\r
36LD = $(CROSS)ld\r
37\r
38# frontend\r
ea8c405f 39OBJS += main.o emu.o menu.o giz.o asm_utils.o\r
e5f426aa 40\r
41# common\r
84100c0f 42OBJS += 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
46ifeq "$(amalgamate)" "1"\r
efcba75f 47OBJS += picoAll.o\r
e5f426aa 48else\r
efcba75f 49OBJS += 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 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 pico/cd/cue.o \\r
54 pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o\r
e5f426aa 55endif\r
84100c0f 56# Pico - Pico\r
efcba75f 57OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o\r
84100c0f 58# Pico - carthw\r
efcba75f 59OBJS += 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
63ifneq "$(amalgamate)" "1"\r
efcba75f 64OBJS += pico/sound/sound.o\r
e5f426aa 65endif\r
efcba75f 66OBJS += pico/sound/mix_asm.o\r
67OBJS += pico/sound/sn76496.o pico/sound/ym2612.o\r
e5f426aa 68# zlib\r
84100c0f 69OBJS += 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 72OBJS += unzip/unzip.o unzip/unzip_stream.o\r
e5f426aa 73# CPU cores\r
74# Cyclone\r
75DEFINC += -DEMU_C68K\r
84100c0f 76OBJS += cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r
e5f426aa 77# drz80\r
78DEFINC += -D_USE_DRZ80\r
84100c0f 79OBJS += cpu/DrZ80/drz80.o\r
e5f426aa 80\r
84100c0f 81vpath %.c = ../..\r
82vpath %.s = ../..\r
83vpath %.S = ../..\r
efcba75f 84DIRS = 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 88all: mkdirs PicoDrive.exe readme.txt\r
89\r
90PicoDrive.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 94ifeq ($(DEBUG),)\r
2ec14aec 95 $(STRIP) $@\r
e5f426aa 96endif\r
84100c0f 97ifeq "$(profile)" "1"\r
98 ../../tools/gcda $@\r
99endif\r
e5f426aa 100\r
101\r
7eed09b3 102readme.txt: ../../tools/textfilter ../base_readme.txt\r
103 ../../tools/textfilter ../base_readme.txt $@ GIZ\r
104\r
ca482e5d 105include ../common/common_arm.mak\r
7eed09b3 106\r
e5f426aa 107\r
108# cleanup\r
109clean: tidy\r
110 @$(RM) PicoDrive.exe\r
111tidy:\r
112 @$(RM) $(OBJS)\r
113\r
114\r
ea8c405f 115up: PicoDrive.exe\r
116 synce-pcp -d 3 PicoDrive.exe ":/SD Card/emus/PicoDrive/PicoDrive.exe"\r
117\r
118run: up\r
119 synce-prun "/SD Card/emus/PicoDrive/PicoDrive.exe"\r
120\r
121run_only:\r
122 synce-prun "/SD Card/emus/PicoDrive/PicoDrive.exe"\r
123\r
e5f426aa 124# ----------- release -----------\r
125ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
126ifeq ($(VER),)\r
127$(error need VER)\r
128endif\r
129endif\r
130\r
84100c0f 131rel: 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