X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgp2x%2FMakefile;h=e7b4326b812aa92c8198ae439cfd16d42755aeb6;hb=74e770b1ecb6f0f0e506fd20c511c801249b5f5f;hp=d6ba1d5bc191ee32a47bb084a39c5c2c8241e185;hpb=7336a99a49268970e0df89d15210b98dd7798f1e;p=picodrive.git diff --git a/platform/gp2x/Makefile b/platform/gp2x/Makefile index d6ba1d5..e7b4326 100644 --- a/platform/gp2x/Makefile +++ b/platform/gp2x/Makefile @@ -1,199 +1,36 @@ +# release packaging makefile -# you may or may not need to change this -#devkit_path = x:/stuff/dev/devkitgp2x/ -CROSS = arm-linux- -#CROSS = $(devkit_path)bin/arm-linux- - -# settings -dprint = 1 -#mz80 = 1 -#debug_cyclone = 1 -asm_memory = 0 # TODO -asm_render = 1 -asm_ym2612 = 1 -asm_misc = 1 -asm_cdpico = 1 -#profile = 1 -#use_musashi = 1 -#up = 1 - -DEFINC = -I../.. -I. -DARM -D__GP2X__ -D_UNZIP_SUPPORT # -DBENCHMARK -COPT_COMMON = -static -O3 -ftracer -fstrength-reduce -Wall -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math # -s -ifeq "$(profile)" "1" -COPT_COMMON += -fprofile-generate -endif -ifeq "$(profile)" "2" -COPT_COMMON += -fprofile-use -endif -COPT = $(COPT_COMMON) -mtune=arm920t -ASOPT = -mcpu=arm920t -mfloat-abi=soft -GCC = $(CROSS)gcc -STRIP = $(CROSS)strip -AS = $(CROSS)as -LD = $(CROSS)ld -OBJCOPY = $(CROSS)objcopy - -# frontend -OBJS += main.o menu.o fonts.o gp2x.o usbjoy.o emu.o squidgehack.o asmutils.o cpuctrl.o -# 940 core control -OBJS += 940ctl.o -# Pico -OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Utils.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 - 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/gfx_cd.o \ - ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.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 -endif -ifeq "$(asm_cdpico)" "1" -DEFINC += -D_ASM_CD_PICO_C -OBJS += ../../Pico/cd/pico_asm.o -endif -# Pico - sound -OBJS += ../../Pico/sound/mix_asm.o -OBJS += ../../Pico/sound/sound.o ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.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 -# mp3 -OBJS += mp3.o -# CPU cores -ifeq "$(use_musashi)" "1" -DEFINC += -DEMU_M68K -OBJS += _build\m68kcpu.o _build\m68kopac.o _build\m68kopdm.o _build\m68kopnz.o _build\m68kops.o -else -DEFINC += -DEMU_C68K -OBJS += ../../cpu/Cyclone/proj/Cyclone.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 - - -all: PicoDrive.gpe - -PicoDrive.gpe : $(OBJS) helix/helix_mp3.a - @echo $@ - @$(GCC) -o $@ $(COPT) $^ -lm -Wl,-Map=PicoDrive.map -ifeq ($(DEBUG),) - @$(STRIP) $@ -endif -# @$(GCC) $(COPT) $(OBJS) -lm -o PicoDrive_.gpe -# @gpecomp PicoDrive_.gpe $@ -ifeq "$(up)" "1" - @cmd //C copy $@ \\\\10.0.1.2\\gp2x\\mnt\\sd\\games\\PicoDrive\\ +VER := $(shell head -n 1 ../common/version.h | \ + sed 's/.*"\(.*\)\.\(.*\)".*/\1\2/g') +BUILD := $(shell git describe HEAD | grep -- - | \ + sed -e 's/.*\-\(.*\)\-.*/\1/') +ifneq "$(BUILD)" "" +VER := $(VER)_$(BUILD) endif -up: PicoDrive.gpe - @cp -v PicoDrive.gpe /mnt/gp2x/mnt/sd/games/PicoDrive/ +all: rel -# @cmd //C copy PicoDrive.gpe \\\\10.0.1.2\\gp2x\\mnt\\sd\\games\\PicoDrive\\ +../../tools/textfilter: ../../tools/textfilter.c + make -C ../../tools/ +readme.txt: ../../tools/textfilter ../base_readme.txt ../../ChangeLog + ../../tools/textfilter ../base_readme.txt $@ GP2X -testrefr.gpe : test.o gp2x.o asmutils.o - @echo $@ - @$(GCC) $(COPT) $^ -o $@ - @$(STRIP) $@ +CODE940 = code940/pico940_v3.bin -.c.o: - @echo $< - @$(GCC) $(COPT) $(DEFINC) -c $< -o $@ -.s.o: - @echo $< - @$(GCC) $(COPT) $(DEFINC) -c $< -o $@ +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 -../../Pico/draw_asm.o : ../../Pico/Draw.s - @echo $< - @$(AS) $(ASOPT) $< -o $@ -../../Pico/draw2_asm.o : ../../Pico/Draw2.s - @echo $< - @$(AS) $(ASOPT) $< -o $@ -../../Pico/memory_asm.o : ../../Pico/Memory.s - @echo $< - @$(AS) $(ASOPT) $< -o $@ -../../Pico/sound/ym2612_asm.o : ../../Pico/sound/ym2612.s - @echo $< - @$(AS) $(ASOPT) $< -o $@ -../../Pico/sound/mix_asm.o : ../../Pico/sound/mix.s - @echo $< - @$(AS) $(ASOPT) $< -o $@ -../../Pico/misc_asm.o : ../../Pico/misc.s - @echo $< - @$(AS) $(ASOPT) $< -o $@ -../../Pico/cd/pico_asm.o : ../../Pico/cd/Pico.s - @echo $< - @$(AS) $(ASOPT) $< -o $@ - -# build Cyclone -../../cpu/Cyclone/proj/Cyclone.s : - @echo building Cyclone... - @make -C ../../cpu/Cyclone/proj -f Makefile.linux - -# build helix libs -helix/helix_mp3.a: - make -C helix - - -# cleanup -clean: tidy - @$(RM) PicoDrive.gpe -tidy: - @$(RM) $(OBJS) -# @make -C ../../cpu/Cyclone/proj -f Makefile.linux clean - - -clean_prof: - find ../.. -name '*.gcno' -delete - find ../.. -name '*.gcda' -delete - -# ----------- release ----------- -ifneq ($(findstring rel,$(MAKECMDGOALS)),) -ifeq ($(VER),) -$(error need VER) -endif -endif - -rel: PicoDrive.gpe code940/code940.bin ../readme.txt config.txt - zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o - -code940/code940.bin: +$(CODE940): make -C code940/ - - -# test -usbjoy.o : usbjoy.c - @echo $< - @$(GCC) $(COPT) $(DEFINC) -fno-profile-generate -c $< -o $@ - -../../Pico/Cart.o : ../../Pico/Cart.c - @echo $< - @$(GCC) $(COPT) $(DEFINC) -fno-profile-generate -c $< -o $@ - -../../zlib/trees.o : ../../zlib/trees.c - @echo $< - @$(GCC) $(COPT) $(DEFINC) -fno-profile-generate -c $< -o $@ -