| 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 -DHAVE_ASPRINTF -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 | NOSTRIP = 1 |
| 13 | else |
| 14 | TFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math |
| 15 | TFLAGS += -O3 #-pg -fno-omit-frame-pointer |
| 16 | LDRIVER += -O3 #-pg -fno-omit-frame-pointer |
| 17 | endif |
| 18 | |
| 19 | #NOSTRIP = 1 |
| 20 | |
| 21 | asm_6502=1 |
| 22 | #debug_asm_6502=1 |
| 23 | |
| 24 | all: fceu |
| 25 | |
| 26 | gpfce: fceu |
| 27 | cp fceu gpfce |
| 28 | |
| 29 | include zlib/Makefile |
| 30 | |
| 31 | OBJDRIVER = ${B}minimal.o ${B}cpuctrl.o ${B}squidgehack.o ${B}asmutils.o ${B}gp2x.o ${B}main.o ${B}throttle.o \ |
| 32 | ${B}unix-netplay.o ${B}gp2x-sound.o ${B}gp2x-video.o ${B}lnx-joystick.o ${B}usbjoy.o ${B}menu.o ${B}fonts.o \ |
| 33 | drivers/common/cheat.o drivers/common/config.o drivers/common/args.o drivers/common/vidblit.o ${UNZIPOBJS} ppu.o movie.o |
| 34 | LDRIVER += -L /mnt/sd/lib -L/mnt/sd/gp2x/usr/lib -lm -lz -static -Wl,-Map=fceu.map |
| 35 | |
| 36 | ifeq ($(asm_6502),1) |
| 37 | TFLAGS += -DASM_6502 |
| 38 | OBJDRIVER += ncpu.o |
| 39 | ifeq ($(debug_asm_6502),1) |
| 40 | TFLAGS += -DDEBUG_ASM_6502 |
| 41 | OBJDRIVER += x6502.o ncpu_debug.o |
| 42 | endif |
| 43 | else |
| 44 | OBJDRIVER += x6502.o |
| 45 | endif |
| 46 | |
| 47 | x6502.o: x6502.c x6502.h ops.h fce.h sound.h dprintf.h |
| 48 | |
| 49 | ncpu.o: ncpu.S ncpu.h |
| 50 | $(CC) $(TFLAGS) -c $< -o $@ |
| 51 | |
| 52 | include Makefile.base |
| 53 | |
| 54 | ${B}main.o: ${B}main.c ${B}main.h ${B}usage.h ${B}input.c |
| 55 | ${B}gp2x.o: ${B}gp2x.c ${B}gp2x.h |
| 56 | ${B}throttle.o: ${B}throttle.c ${B}main.h ${B}throttle.h |
| 57 | ppu.o: ppu.c ppu.h |
| 58 | |
| 59 | include Makefile.common |
| 60 | |
| 61 | #x6502.o: x6502.c x6502.h ops.h fce.h sound.h |
| 62 | # $(CC) $(CFLAGS) -finline-limit=60000 -c $< -o $@ |
| 63 | |
| 64 | up: fceu |
| 65 | cp -v fceu /mnt/gp2x/mnt/sd/emus/Gpfce_v02/gpfce |
| 66 | |
| 67 | # ----------- release ----------- |
| 68 | ifneq ($(findstring rel,$(MAKECMDGOALS)),) |
| 69 | ifeq ($(VER),) |
| 70 | $(error need VER) |
| 71 | endif |
| 72 | endif |
| 73 | |
| 74 | rel: gpfce |
| 75 | zip -9 -j Gpfce_v$(VER).zip $^ drivers/gp2x/mmuhack.o out_gp2x/* |
| 76 | |
| 77 | |