-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakefile.gpi
86 lines (69 loc) · 2.94 KB
/
makefile.gpi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
CIRCLEHOME = $(CIRCLE_STDLIB)/libs/circle
TARGET=Fceux215
APP_FILE = Fceux215
APP_VERSION = 1.7
APP_NAME = NES emulator
APP_TYPES = NES|FDS
# If you have any directories with include files, add them here with -I on
# the front of each
TOOLCHAIN_INC = -I $(CIRCLE_STDLIB)/install/arm-none-circle/include \
-I $(CIRCLE_STDLIB)/include
PLATFORM = platform.gpi
# Platform sources
PLATFORM_SRC = ../platform/$(PLATFORM) \
../platform/components \
../platform/components/zip \
../platform
# Platform includes
PLATFORM_INC = -I ../platform/$(PLATFORM) \
-I ../platform/components \
-I ../platform/components/zip \
-I ../platform
# Emulator sources
EMULATOR_SRC = ./fceux215 \
./fceux215/boards \
./fceux215/input \
./fceux215/mappers \
./fceux215/utils \
./emulator
# Emulator includes
EMULATOR_INC = -I ./fceux215 \
-I ./fceux215/boards \
-I ./fceux215/input \
-I ./fceux215/mappers \
-I ./fceux215/utils \
-I ./resources \
-I ./emulator
SOURCE = $(PLATFORM_SRC) $(EMULATOR_SRC)
INCLUDE = $(TOOLCHAIN_INC) $(PLATFORM_INC) $(EMULATOR_INC)
DEFINE = -D_GPI -DNDEBUG -DINDEXED_IMAGE
DEFINE += -DEMU_DISPLAY_NAME="\"$(APP_NAME)\"" -DEMU_VERSION="\"$(APP_VERSION)\"" -DEMU_FILE_NAME="\"$(APP_FILE)\"" -DEMU_FILE_TYPES="\"$(APP_TYPES)\""
DEFINE += -DEMU_SYS_PATH="\"/Fceux215\"" -DEMU_ROM_PATH="\"/roms/nes\""
DEFINE += -DHAVE_ASPRINTF -DPSS_STYLE=2 -DLSB_FIRST -D_NEED_TRANSPOSE
SRC_CPP = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.cpp))
SRC_C = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.c))
SRC_S = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.s))
OBJ_CPP = $(patsubst %.cpp, %.o, $(SRC_CPP))
OBJ_C = $(patsubst %.c, %.o, $(SRC_C))
OBJ_S = $(patsubst %.s, %.o, $(SRC_S))
OBJS = $(OBJ_CPP) $(OBJ_C) $(OBJ_S)
EXTRACLEAN = $(OBJS)
LIBS = $(CIRCLE_STDLIB)/install/arm-none-circle/lib/libm.a \
$(CIRCLE_STDLIB)/install/arm-none-circle/lib/libc.a \
$(CIRCLE_STDLIB)/install/arm-none-circle/lib/libz.a \
$(CIRCLE_STDLIB)/install/arm-none-circle/lib/libpng.a \
$(CIRCLE_STDLIB)/install/arm-none-circle/lib/libcirclenewlib.a \
$(CIRCLE_STDLIB)/libs/circle/lib/libcircle.a \
$(CIRCLE_STDLIB)/libs/circle/addon/fatfs/libfatfs.a \
$(CIRCLE_STDLIB)/libs/circle/lib/usb/libusb.a \
$(CIRCLE_STDLIB)/libs/circle/lib/input/libinput.a \
$(CIRCLE_STDLIB)/libs/circle/lib/sched/libsched.a \
$(CIRCLE_STDLIB)/libs/circle/addon/SDCard/libsdcard.a \
$(CIRCLE_STDLIB)/libs/circle/lib/fs/libfs.a \
$(CIRCLE_STDLIB)/libs/circle/lib/sound/libsound.a
include $(CIRCLEHOME)/Rules.mk
%.o: %.s
@echo " AS $@"
@$(AS) $(AFLAGS) -c -o $@ $<
%.d: %.s
@$(AS) $(AFLAGS) -M -MG -MT $*.o -MT $@ -MF $@ $<