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