debug, unbreaking castlevania 3
[fceu.git] / Makefile.gp2x
CommitLineData
937bf65b 1CROSS = arm-linux-
2CC = $(CROSS)gcc
3STRIP = $(CROSS)strip
4AS = $(CROSS)as
5TFLAGS = -Winline -mcpu=arm920t -Izlib -DGP2X=1 -DLSB_FIRST -DUNIX -DPSS_STYLE=1 -DZLIB -DFRAMESKIP -D_REENTRANT
6ASFLAGS = -mcpu=arm920t -mfloat-abi=soft
98733207 7RM = rm -f
22f08d95 8B = drivers/gp2x/
15300263 9ifdef DEBUG
10TFLAGS += -ggdb
937bf65b 11LDRIVER += -ggdb
15300263 12else
937bf65b 13TFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math
14TFLAGS += -O3 # -pg
15LDRIVER += -O3 # -pg
15300263 16endif
98733207 17
af32b6c2 18asm_6502=1
81bd66a1 19debug_asm_6502=1
af32b6c2 20
98733207 21all: fceu
15300263 22
23gpfce: fceu
24 cp fceu gpfce
98733207 25
26include zlib/Makefile
27
937bf65b 28OBJDRIVER = ${B}minimal.o ${B}squidgehack.o ${B}asmutils.o ${B}gp2x.o ${B}main.o ${B}throttle.o \
29 ${B}unix-netplay.o ${B}gp2x-sound.o ${B}gp2x-video.o ${B}lnx-joystick.o \
5a2aa426 30 drivers/common/cheat.o drivers/common/config.o drivers/common/args.o drivers/common/vidblit.o ${UNZIPOBJS} ppu.o movie.o
af32b6c2 31LDRIVER += -L /mnt/sd/lib -L/mnt/sd/gp2x/usr/lib -lm -lz -static -Wl,-Map=fceu.map
32
33ifeq ($(asm_6502),1)
34TFLAGS += -DASM_6502
35OBJDRIVER += ncpu.o
36ifeq ($(debug_asm_6502),1)
37TFLAGS += -DDEBUG_ASM_6502
38OBJDRIVER += x6502.o ncpu_debug.o
39endif
40else
41OBJDRIVER += x6502.o
42endif
43
44x6502.o: x6502.c x6502.h ops.h fce.h sound.h
81bd66a1 45
af32b6c2 46ncpu.o: ncpu.S ncpu.h
92e249b1 47 $(CC) $(TFLAGS) -c $< -o $@
98733207 48
49include Makefile.base
50
9e1b19d0 51${B}main.o: ${B}main.c ${B}main.h ${B}usage.h ${B}input.c
22f08d95 52${B}gp2x.o: ${B}gp2x.c ${B}gp2x.h
98733207 53${B}throttle.o: ${B}throttle.c ${B}main.h ${B}throttle.h
54ppu.o: ppu.c ppu.h
55
56include Makefile.common
15300263 57
937bf65b 58#x6502.o: x6502.c x6502.h ops.h fce.h sound.h
59# $(CC) $(CFLAGS) -finline-limit=60000 -c $< -o $@
60
15300263 61up: fceu
62 cp -v fceu /mnt/gp2x/mnt/sd/emus/Gpfce_v02/gpfce
63
aa2dba92 64# ----------- release -----------
65ifneq ($(findstring rel,$(MAKECMDGOALS)),)
66ifeq ($(VER),)
67$(error need VER)
68endif
69endif
70
71rel: gpfce
72 zip -9 -j Gpfce_v$(VER).zip $^ drivers/gp2x/mmuhack.o out_gp2x/*
73
74