| 1 | \r |
| 2 | # you may or may not need to change this\r |
| 3 | #devkit_path = x:/stuff/dev/devkitgp2x/\r |
| 4 | export CROSS = arm-linux-\r |
| 5 | #CROSS = $(devkit_path)bin/arm-linux-\r |
| 6 | \r |
| 7 | # settings\r |
| 8 | #mz80 = 1\r |
| 9 | #debug_cyclone = 1\r |
| 10 | asm_memory = 1\r |
| 11 | asm_render = 1\r |
| 12 | asm_ym2612 = 1\r |
| 13 | asm_misc = 1\r |
| 14 | asm_cdpico = 1\r |
| 15 | asm_cdmemory = 1\r |
| 16 | amalgamate = 0\r |
| 17 | #profile = 1\r |
| 18 | #use_musashi = 1\r |
| 19 | #up = 1\r |
| 20 | \r |
| 21 | \r |
| 22 | ifeq "$(debug_cyclone)" "1"\r |
| 23 | use_cyclone = 1\r |
| 24 | use_musashi = 1\r |
| 25 | endif\r |
| 26 | ifeq "$(use_musashi)" "1"\r |
| 27 | asm_cdpico = 0\r |
| 28 | asm_memory = 0\r |
| 29 | asm_cdmemory = 0\r |
| 30 | else\r |
| 31 | use_cyclone = 1\r |
| 32 | endif\r |
| 33 | \r |
| 34 | DEFINC = -I../.. -I. -DARM -D__GP2X__ # -DBENCHMARK\r |
| 35 | COPT_COMMON = -static -Wall -Winline\r |
| 36 | ifeq ($(DEBUG),)\r |
| 37 | COPT_COMMON += -O3 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r |
| 38 | else\r |
| 39 | COPT_COMMON += -ggdb\r |
| 40 | endif\r |
| 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 |
| 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 |
| 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 |
| 57 | OBJS += main.o menu.o gp2x.o emu.o squidgehack.o cpuctrl.o\r |
| 58 | # 940 core control\r |
| 59 | OBJS += 940ctl.o\r |
| 60 | \r |
| 61 | # common\r |
| 62 | OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r |
| 63 | platform/common/arm_utils.o platform/common/arm_linux.o platform/common/readpng.o \\r |
| 64 | platform/common/mp3_helix.o platform/linux/usbjoy.o platform/linux/sndout_oss.o\r |
| 65 | \r |
| 66 | # Pico\r |
| 67 | ifeq "$(amalgamate)" "1"\r |
| 68 | OBJS += ../../picoAll.o\r |
| 69 | else\r |
| 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 |
| 72 | # Pico - CD\r |
| 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 |
| 76 | endif\r |
| 77 | # Pico - Pico\r |
| 78 | OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o\r |
| 79 | # Pico - carthw\r |
| 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 |
| 82 | \r |
| 83 | # Pico - sound\r |
| 84 | ifneq "$(amalgamate)" "1"\r |
| 85 | OBJS += pico/sound/sound.o\r |
| 86 | endif\r |
| 87 | OBJS += pico/sound/mix_arm.o\r |
| 88 | OBJS += pico/sound/sn76496.o pico/sound/ym2612.o\r |
| 89 | # zlib\r |
| 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 |
| 92 | # unzip\r |
| 93 | OBJS += unzip/unzip.o unzip/unzip_stream.o\r |
| 94 | # debug\r |
| 95 | ifeq "$(debug_cyclone)" "1"\r |
| 96 | OBJS += pico/DebugCPU.o cpu/musashi/m68kdasm.o\r |
| 97 | endif\r |
| 98 | # CPU cores\r |
| 99 | ifeq "$(use_musashi)" "1"\r |
| 100 | DEFINC += -DEMU_M68K\r |
| 101 | OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r |
| 102 | endif\r |
| 103 | ifeq "$(use_cyclone)" "1"\r |
| 104 | DEFINC += -DEMU_C68K\r |
| 105 | OBJS += cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r |
| 106 | endif\r |
| 107 | # drz80/mz80\r |
| 108 | ifeq "$(mz80)" "1"\r |
| 109 | DEFINC += -D_USE_MZ80\r |
| 110 | OBJS += cpu/mz80/mz80.o\r |
| 111 | else\r |
| 112 | DEFINC += -D_USE_DRZ80\r |
| 113 | OBJS += cpu/DrZ80/drz80.o\r |
| 114 | endif\r |
| 115 | \r |
| 116 | vpath %.c = ../..\r |
| 117 | vpath %.s = ../..\r |
| 118 | vpath %.S = ../..\r |
| 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 |
| 121 | \r |
| 122 | \r |
| 123 | all: mkdirs PicoDrive.gpe\r |
| 124 | \r |
| 125 | include ../common/common_arm.mak\r |
| 126 | \r |
| 127 | PicoDrive.gpe : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r |
| 128 | @echo ">>>" $@\r |
| 129 | $(CC) -o $@ $(CFLAGS) $^ -lm -lpng -Wl,-Map=PicoDrive.map\r |
| 130 | ifeq ($(DEBUG),)\r |
| 131 | $(STRIP) $@\r |
| 132 | endif\r |
| 133 | \r |
| 134 | up: PicoDrive.gpe\r |
| 135 | @cp -v PicoDrive.gpe /mnt/gp2x/mnt/sd/emus/PicoDrive/\r |
| 136 | \r |
| 137 | clean: tidy\r |
| 138 | $(RM) PicoDrive.gpe\r |
| 139 | tidy:\r |
| 140 | $(RM) $(OBJS)\r |
| 141 | \r |
| 142 | readme.txt: ../../tools/textfilter ../base_readme.txt\r |
| 143 | ../../tools/textfilter ../base_readme.txt $@ GP2X\r |
| 144 | \r |
| 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 |
| 152 | rel: PicoDrive.gpe code940/pico940_v3.bin readme.txt PicoDrive.man.txt PicoDrive.png ../game_def.cfg\r |
| 153 | zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o\r |
| 154 | zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r |
| 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 |
| 159 | \r |
| 160 | code940/code940.bin:\r |
| 161 | make -C code940/\r |
| 162 | \r |