X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2FMakefile;h=030bab67d5b0cc325dae3dc08c08d5cea6dc58a8;hb=ca69c3e5a0ecf407c02dc85c6f3282ebb1efc5a2;hp=06761a30b89779f0bae390d9ce5060c4cd857201;hpb=36f6fd5afec3bd982c715f6d39d5712dacb237cd;p=libpicofe.git diff --git a/gp2x/Makefile b/gp2x/Makefile index 06761a3..030bab6 100644 --- a/gp2x/Makefile +++ b/gp2x/Makefile @@ -1,52 +1,44 @@ - -# you may or may not need to change this -#devkit_path = x:/stuff/dev/devkitgp2x/ -export CROSS = arm-linux- -#CROSS = $(devkit_path)bin/arm-linux- +CROSS ?= arm-linux- # settings -#mz80 = 1 -#debug_cyclone = 1 +use_cyclone = 1 +#use_musashi = 1 +use_drz80 = 1 +use_sh2drc = 1 +#use_sh2mame = 1 + asm_memory = 1 asm_render = 1 asm_ym2612 = 1 asm_misc = 1 asm_cdpico = 1 asm_cdmemory = 1 -amalgamate = 0 +asm_32xdraw = 1 #profile = 1 -#use_musashi = 1 -#up = 1 +#drc_debug = 3 +-include Makefile.local ifeq "$(debug_cyclone)" "1" use_cyclone = 1 use_musashi = 1 endif ifeq "$(use_musashi)" "1" +# due to CPU stop flag acces asm_cdpico = 0 -asm_memory = 0 asm_cdmemory = 0 -else -use_cyclone = 1 endif -DEFINC = -I../.. -I. -DARM -D__GP2X__ # -DBENCHMARK -COPT_COMMON = -static -Wall -Winline +ARCH = arm +DEFINES += ARM __GP2X__ IN_GP2X IN_EVDEV # BENCHMARK +CFLAGS += -Wall -Winline -I../.. -I. ifeq ($(DEBUG),) -COPT_COMMON += -O3 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math -else -COPT_COMMON += -ggdb +CFLAGS += -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math endif -ifeq "$(profile)" "1" -COPT_COMMON += -fprofile-generate -endif -ifeq "$(profile)" "2" -COPT_COMMON += -fprofile-use -endif -CFLAGS = $(COPT_COMMON) -mcpu=arm920t -mtune=arm920t -SFLAGS = $(CFLAGS) +CFLAGS += -mcpu=arm920t -mtune=arm920t ASFLAGS = -mcpu=arm920t -mfloat-abi=soft +LDFLAGS += -lm -lpng + CC = $(CROSS)gcc STRIP = $(CROSS)strip AS = $(CROSS)as @@ -54,141 +46,83 @@ LD = $(CROSS)ld OBJCOPY = $(CROSS)objcopy # frontend -OBJS += main.o menu.o gp2x.o usbjoy.o emu.o squidgehack.o cpuctrl.o asm_utils.o +OBJS += plat.o warm.o pollux_set.o soc.o soc_mmsp2.o soc_pollux.o soc_dummy.o emu.o in_gp2x.o # 940 core control OBJS += 940ctl.o +# ARM stuff +OBJS += pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o +OBJS += pico/sound/mix_arm.o + # common -OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \ - platform/common/arm_utils.o platform/common/readpng.o platform/common/mp3_helix.o - -# Pico -ifeq "$(amalgamate)" "1" -OBJS += ../../PicoAll.o -else -OBJS += Pico/Area.o Pico/Cart.o Pico/Memory.o Pico/Misc.o Pico/Pico.o Pico/Sek.o \ - Pico/VideoPort.o Pico/Draw2.o Pico/Draw.o Pico/Patch.o Pico/Debug.o -# Pico - CD -OBJS += Pico/cd/Pico.o Pico/cd/Memory.o Pico/cd/Sek.o Pico/cd/LC89510.o \ - Pico/cd/cd_sys.o Pico/cd/cd_file.o Pico/cd/cue.o Pico/cd/gfx_cd.o \ - Pico/cd/Area.o Pico/cd/Misc.o Pico/cd/pcm.o Pico/cd/buffering.o -endif -# Pico - Pico -OBJS += Pico/Pico/Pico.o Pico/Pico/Memory.o Pico/Pico/xpcm.o -# Pico - carthw -OBJS += Pico/carthw/carthw.o Pico/carthw/svp/svp.o Pico/carthw/svp/Memory.o \ - Pico/carthw/svp/ssp16.o Pico/carthw/svp/compiler.o Pico/carthw/svp/stub_arm.o - -# asm stuff -ifeq "$(asm_render)" "1" -DEFINC += -D_ASM_DRAW_C -OBJS += Pico/draw_asm.o Pico/draw2_asm.o -endif -ifeq "$(asm_memory)" "1" -DEFINC += -D_ASM_MEMORY_C -OBJS += Pico/memory_asm.o -endif -ifeq "$(asm_ym2612)" "1" -DEFINC += -D_ASM_YM2612_C -OBJS += Pico/sound/ym2612_asm.o -endif -ifeq "$(asm_misc)" "1" -DEFINC += -D_ASM_MISC_C -OBJS += Pico/misc_asm.o -OBJS += Pico/cd/misc_asm.o -endif -ifeq "$(asm_cdpico)" "1" -DEFINC += -D_ASM_CD_PICO_C -OBJS += Pico/cd/pico_asm.o -endif -ifeq "$(asm_cdmemory)" "1" -DEFINC += -D_ASM_CD_MEMORY_C -OBJS += Pico/cd/memory_asm.o -endif +OBJS += platform/common/emu.o platform/common/menu_pico.o platform/common/fonts.o platform/common/config.o \ + platform/common/arm_utils.o platform/common/arm_linux.o platform/common/readpng.o \ + platform/common/mp3_helix.o platform/common/input.o platform/common/main.o platform/common/mp3.o \ + platform/linux/sndout_oss.o platform/linux/plat.o platform/linux/in_evdev.o -# Pico - sound -ifneq "$(amalgamate)" "1" -OBJS += Pico/sound/sound.o -endif -OBJS += Pico/sound/mix_asm.o -OBJS += Pico/sound/sn76496.o Pico/sound/ym2612.o +# unzip +OBJS += unzip/unzip.o unzip/unzip_stream.o # zlib OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \ zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o -# unzip -OBJS += unzip/unzip.o unzip/unzip_stream.o -# debug -ifeq "$(debug_cyclone)" "1" -OBJS += Pico/DebugCPU.o cpu/musashi/m68kdasm.o -endif -# CPU cores -ifeq "$(use_musashi)" "1" -DEFINC += -DEMU_M68K -OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o -endif -ifeq "$(use_cyclone)" "1" -DEFINC += -DEMU_C68K -OBJS += cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o -endif -# drz80/mz80 -ifeq "$(mz80)" "1" -DEFINC += -D_USE_MZ80 -OBJS += cpu/mz80/mz80.o -else -DEFINC += -D_USE_DRZ80 -OBJS += cpu/DrZ80/drz80.o -endif vpath %.c = ../.. vpath %.s = ../.. vpath %.S = ../.. -DIRS = platform platform/gp2x platform/common Pico Pico/cd Pico/Pico Pico/sound Pico/carthw/svp \ - zlib unzip cpu cpu/musashi cpu/Cyclone/proj cpu/Cyclone/tools cpu/mz80 cpu/DrZ80 +DIRS += platform/gp2x platform/linux zlib unzip + + +all: mkdirs PicoDrive + +include ../common/common.mak +include ../common/common_arm.mak +include ../common/revision.mak + +CFLAGS += $(addprefix -D,$(DEFINES)) -all: mkdirs PicoDrive.gpe +# partial linking helps profiled builds due to section merging +PicoDrive.o : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a + $(LD) -r -o $@ $^ -PicoDrive.gpe : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a +# still using static, dynamic linking slows Wiz 1-10% +# also libm on F100 is not compatible +PicoDrive : PicoDrive.o @echo ">>>" $@ - $(CC) -o $@ $(CFLAGS) $^ -lm -lpng -Wl,-Map=PicoDrive.map + $(CC) -static -o $@ $(CFLAGS) $^ $(LDFLAGS) -Wl,-Map=$@.map ifeq ($(DEBUG),) $(STRIP) $@ endif -up: PicoDrive.gpe - @cp -v PicoDrive.gpe /mnt/gp2x/mnt/sd/emus/PicoDrive/ - -# @cmd //C copy PicoDrive.gpe \\\\10.0.1.2\\gp2x\\mnt\\sd\\games\\PicoDrive\\ +up: PicoDrive + @cp -v PicoDrive /mnt/gp2x/mnt/sd/emus/PicoDrive/ -# cleanup clean: tidy - $(RM) PicoDrive.gpe + $(RM) PicoDrive tidy: $(RM) $(OBJS) -# rm -rf $(DIRS) # don't clean, gcda may be there -# @make -C ../../cpu/Cyclone/proj -f Makefile.linux clean - readme.txt: ../../tools/textfilter ../base_readme.txt ../../tools/textfilter ../base_readme.txt $@ GP2X -include ../common/common_arm.mak - # ----------- release ----------- -ifneq ($(findstring rel,$(MAKECMDGOALS)),) -ifeq ($(VER),) -$(error need VER) -endif -endif - -rel: PicoDrive.gpe code940/pico940_v3.bin readme.txt PicoDrive.man.txt PicoDrive.png ../game_def.cfg - zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o - zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt - mkdir bin_to_cso_mp3 - cp ../../tools/bin_to_cso_mp3/* bin_to_cso_mp3/ - zip -9 -r ../../PicoDrive_$(VER).zip bin_to_cso_mp3 - rm -rf bin_to_cso_mp3 - -code940/code940.bin: +VER ?= $(shell head -n 1 version.h | sed 's/.*"\(.*\)\.\(.*\)".*/\1\2/g') +CODE940 = code940/pico940_v3.bin + +rel: PicoDrive PicoDrive.gpe $(CODE940) readme.txt ../game_def.cfg \ + PicoDrive.png PicoDrive_s.png PicoDrive_t.png \ + warm_2.4.25.o warm_2.4.26-open2x.o warm_2.6.24.ko \ + ../../pico/carthw.cfg + mkdir -p out/PicoDrive/skin/ + cp $^ out/PicoDrive/ + cp PicoDrive.ini out/ + cp skin/*.png out/PicoDrive/skin/ + cp skin/*.txt out/PicoDrive/skin/ + mkdir out/bin_to_cso_mp3 + cp ../../tools/bin_to_cso_mp3/* out/bin_to_cso_mp3/ + cd out && zip -9 -r ../../../PicoDrive_$(VER).zip * + rm -rf out + +$(CODE940): make -C code940/