forked from gameblabla/pocketsnes-nspire
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.nspire
62 lines (45 loc) · 1.47 KB
/
Makefile.nspire
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
# Define the applications properties here:
TARGET = PocketSNES
CC := nspire-gcc
CXX := nspire-g++
STRIP :=
ifdef V
CMD:=
SUM:=@\#
else
CMD:=@
SUM:=@echo
endif
INCLUDE = -Dndlib -I pocketsnes -Isal/linux/ -Isal/ -I sal/linux/include -I sal/include -I pocketsnes/include -I menu -I pocketsnes/linux -I pocketsnes/snes9x
CFLAGS = -Os -nostdlib -fdata-sections -ffunction-sections -fomit-frame-pointer -marm -march=armv5te -mtune=arm926ej-s -DRC_OPTIMIZED -D__LINUX__ -DFOREVER_16_BIT -DNO_ASM -DNO_ROM_BROWSER $(INCLUDE)
CXXFLAGS = $(CFLAGS)
LDFLAGS = $(CXXFLAGS) -nostdlib -Wl,--gc-sections -Wl,--as-needed -flto -lm
# Find all source files
SOURCE = pocketsnes/snes9x menu sal/linux sal
SRC_CPP = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.cpp))
SRC_C = $(foreach dir, $(SOURCE), $(wildcard $(dir)/*.c))
OBJ_CPP = $(patsubst %.cpp, %.o, $(SRC_CPP))
OBJ_C = $(patsubst %.c, %.o, $(SRC_C))
OBJS = $(OBJ_CPP) $(OBJ_C)
all: $(TARGET) gen pack removeth
gen :
genzehn --input PocketSNES --output pocket.t --compress
make-prg pocket.t pocketsnes.tns
pack:
zip -r PocketSNES-nspire.zip pocketsnes.tns README.md
removeth:
rm PocketSNES
rm pocket.t
$(TARGET) : $(OBJS)
$(SUM) " LD $@"
$(CMD)$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
%.o: %.c
$(SUM) " CC $@"
$(CMD)$(CC) $(CFLAGS) -c $< -o $@
%.o: %.cpp
$(SUM) " CXX $@"
$(CMD)$(CXX) $(CFLAGS) -c $< -o $@
clean :
$(SUM) " CLEAN ."
$(CMD)rm -f $(OBJS) $(TARGET)
$(CMD)rm -rf .opk_data $(TARGET).opk