-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (48 loc) · 1.64 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
58
59
60
61
62
CC=armclang
AS=armclang
LD=armlink
ASFLAGS= -gdwarf-3 -c --target=aarch64-arm-none-eabi
CFLAGS= -gdwarf-3 -c --target=aarch64-arm-none-eabi -I"./include" -O1 -DDEBUG
# Select build rules based on Windows or Unix
ifdef WINDIR
DONE=@if exist $(1) if exist $(2) echo Build completed.
RM=if exist $(1) del /q $(1)
SHELL=$(WINDIR)\system32\cmd.exe
else
ifdef windir
DONE=@if exist $(1) if exist $(2) echo Build completed.
RM=if exist $(1) del /q $(1)
SHELL=$(windir)\system32\cmd.exe
else
DONE=@if [ -f $(1) ]; then if [ -f $(2) ]; then echo Build completed.; fi; fi
RM=rm -f $(1)
endif
endif
TESTCASE_SRCS := $(wildcard test_case/*.c)
TESTCASE_OBJS := $(TESTCASE_SRCS:.c=.o)
all: image_smmu.axf
$(call DONE,$(EXECUTABLE))
clean:
@$(call RM, image_smmu.axf)
@$(call RM, image_smmu.hex)
@$(call RM, *.o)
@$(call RM, $(TESTCASE_OBJS))
$(TESTCASE_OBJS) : %.o : %.c
$(CC) ${CFLAGS} -o $@ -c $^
interrupts.o: ./src/interrupts.c
$(CC) ${CFLAGS} ./src/interrupts.c
pl011_uart.o: ./src/pl011_uart.c
$(CC) ${CFLAGS} ./src/pl011_uart.c
kernel.o: ./src/kernel.c
$(CC) ${CFLAGS} ./src/kernel.c
gicv3.o: ./asm/gicv3.s
$(AS) ${ASFLAGS} ./asm/gicv3.s
vector.o: ./asm/vector.s
$(AS) ${ASFLAGS} ./asm/vector.s
startup.o: ./asm/startup.s
$(AS) ${ASFLAGS} ./asm/startup.s
image_smmu.axf: startup.o vector.o gicv3.o kernel.o pl011_uart.o interrupts.o $(TESTCASE_OBJS) scatter.txt
$(LD) --scatter=scatter.txt startup.o vector.o gicv3.o kernel.o pl011_uart.o interrupts.o $(TESTCASE_OBJS) -o image_smmu.axf --entry=start64
@fromelf --vhx image_smmu.axf --output image_smmu.hex
run:
@FVP_Base_RevC-2xAEMvA -a ./image_smmu.hex -C bp.secure_memory=false -C cache_state_modelled=0