-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
57 lines (45 loc) · 1.54 KB
/
Makefile
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
DEBUG = FALSE
GCC = nspire-gcc
AS = nspire-as
GXX = nspire-g++
GCCFLAGS = -Wall -W -marm
ifeq ($(DEBUG),FALSE)
GCCFLAGS += -O3
else
GCCFLAGS += -O0 -g
endif
EXCLUDE = ./core/uae/build68k.c ./core/uae/cpustbl.c ./core/uae/fpp.c ./core/uae/gencpu.c ./core/uae/readcpu.c ./core/uae/cpudefs.c ./core/uae/missing.c ./core/uae/cpuemu.c
OBJS = $(patsubst %.c, %.o, $(filter-out $(EXCLUDE), $(shell find . -name \*.c)))
OBJS += $(patsubst %.cpp, %.o, $(shell find . -name \*.cpp))
OBJS += $(patsubst %.S, %.o, $(shell find . -name \*.S))
OBJS += ./core/uae/cpudefs.o ./core/uae/cpustbl.o ./core/uae/readcpu.o ./core/uae/fpp.o ./core/uae/missing.o ./core/uae/cpuemu1.o ./core/uae/cpuemu2.o ./core/uae/cpuemu3.o ./core/uae/cpuemu4.o ./core/uae/cpuemu5.o ./core/uae/cpuemu6.o ./core/uae/cpuemu7.o ./core/uae/cpuemu8.o
LIB = n-89
vpath %.tns $(DISTDIR)
vpath %.elf $(DISTDIR)
all: n-89.tns
uae:
cd core/uae && $(MAKE) CC="$(GCC)" CFLAGS="$(GCCFLAGS)" gen
cd core/uae && $(MAKE) CC="$(GCC)" CFLAGS="$(GCCFLAGS)" all
%.o: %.c
$(GCC) $(GCCFLAGS) -c $< -o $@
%.o: %.cpp
$(GXX) $(GCCFLAGS) -c $< -o $@
%.o: %.S
$(AS) -c $< -o $@
lib$(LIB).a: uae $(OBJS)
ar rcs lib$(LIB).a $(OBJS)
n-89.tns: lib$(LIB).a
ifeq (, $(shell which cargo-make))
cargo install cargo-make
endif
ifeq ($(DEBUG),FALSE)
cd n-89 && cargo make release
cp n-89/target/armv5te-nspire-eabi/release/n-89.tns .
else
cd n-89 && cargo make dev
cp n-89/target/armv5te-nspire-eabi/debug/n-89.tns .
endif
clean:
rm -f $(OBJS)
rm -f n-89.tns libn-89.a
cd core/uae && $(MAKE) clean && $(MAKE) distclean