forked from Vogtinator/nGL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (27 loc) · 929 Bytes
/
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
GCC = nspire-gcc
GPP = nspire-g++
LD = nspire-ld
GENZEHN = genzehn
OPTIMIZE ?= fast
GCCFLAGS = -O$(OPTIMIZE) -Wall -W -marm -ffast-math -mcpu=arm926ej-s -fno-math-errno -fomit-frame-pointer -flto -fno-rtti -fgcse-sm -fgcse-las -funsafe-loop-optimizations -fno-fat-lto-objects -frename-registers -fprefetch-loop-arrays -Wno-narrowing
LDFLAGS = -lm -lnspireio
ZEHNFLAGS = --name "nGL" --version 07
EXE = nGL
OBJS = $(patsubst %.c, %.o, $(shell find . -name \*.c))
OBJS += $(patsubst %.cpp, %.o, $(shell find . -name \*.cpp))
OBJS += $(patsubst %.S, %.o, $(shell find . -name \*.S))
all: $(EXE).tns
lib: $(OBJS)
gl.o: triangle.inc.h
%.o: %.cpp
$(GPP) -std=gnu++11 $(GCCFLAGS) -c $< -o $@
$(EXE).elf: $(OBJS)
+$(LD) $^ -o $@ $(GCCFLAGS) $(LDFLAGS)
$(EXE).tns: $(EXE).elf
+$(GENZEHN) --input $^ --output [email protected]
+make-prg [email protected] $@
.PHONY: clean
clean:
rm -f `find . -name \*.o`
rm -f $(EXE).tns $(EXE).elf