-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
35 lines (26 loc) · 946 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
include libfdt/Makefile.libfdt
GCC = nspire-gcc
LD = nspire-ld
GCCFLAGS = -mcpu=arm926ej-s -Os -nostdlib -Wall -Werror -marm -Ilibfdt/
# Feel free to comment the following lines out if you're
# not using git or you don't want the build date included
BUILDFLAGS := -DBUILD_DATE="\"$(shell date --rfc-2822)\""
BUILDFLAGS += -DGIT_COMMIT="\"$(shell git rev-parse --short HEAD)\""
LDFLAGS = -lnspireio
EXE = linuxloader2.tns
OBJS = $(patsubst %.c,%.o,$(wildcard *.c))
OBJS += $(patsubst %.S,%.o,$(wildcard *.S))
OBJS += $(addprefix libfdt/, $(LIBFDT_OBJS))
vpath %.tns $(DISTDIR)
all: $(EXE)
%.o: %.c
$(GCC) $(BUILDFLAGS) $(GCCFLAGS) -c $< -o $@
%.o: %.S
$(GCC) $(BUILDFLAGS) $(GCCFLAGS) -c $< -o $@
$(EXE): $(OBJS)
$(LD) $^ -o $(@:.tns=.elf) $(LDFLAGS)
genzehn --input $(@:.tns=.elf) --output $(@:.tns=.zehn) --name "Linux Loader v2" --version 1 --author "tangrs"
make-prg $(@:.tns=.zehn) $@
clean:
rm -f $(OBJS) *.elf
rm -f $(EXE)