-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (49 loc) · 1.01 KB
/
Makefile
File metadata and controls
62 lines (49 loc) · 1.01 KB
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
# Use our cross-compile prefix to set up our basic cross compile environment.
CC = $(CROSS_COMPILE)gcc
LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy
# Pull in information about our "hosted" libfdt.
include lib/fdt/Makefile.libfdt
# Allow user of our libraries.
VPATH = .:lib:lib/fdt
# Build the discharge binary.
TARGET = bfstub
OBJS = \
entry.o \
uart_tegra.o \
main.o \
exceptions.o \
microlib.o \
printf.o \
memmove.o \
cache.o \
image.o \
$(LIBFDT_OBJS)
CFLAGS = \
-Iinclude \
-Iinclude/compat \
-Ilib/fdt \
-march=armv8-a \
-mlittle-endian \
-fno-stack-protector \
-mgeneral-regs-only \
-fno-common \
-fno-builtin \
-ffreestanding \
-std=gnu99 \
-Werror \
-Wall
LDFLAGS =
%.o: %.S
$(CC) $(CFLAGS) $< -c -o $@
%.o: %.c
$(CC) $(CFLAGS) $< -c -o $@
$(TARGET).bin: $(TARGET).elf
$(OBJCOPY) -v -O binary $< $@
$(TARGET).elf: $(OBJS)
$(LD) -T boot.lds $(LDFLAGS) $^ -o $@
clean:
rm -f *.o $(TARGET) $(TARGET).bin $(TARGET).elf
test:
make -C tests run_tests
.PHONY: all clean test