-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (45 loc) · 1.42 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
export
CROSS_=riscv64-linux-gnu-
GCC=${CROSS_}gcc
LD=${CROSS_}ld
OBJCOPY=${CROSS_}objcopy
ISA=rv64imafd_zifencei
ABI=lp64
INCLUDE = -I $(shell pwd)/include -I $(shell pwd)/arch/riscv/include
CF = -march=$(ISA) -mabi=$(ABI) -mcmodel=medany -fno-builtin -ffunction-sections -fdata-sections -nostartfiles -nostdlib -nostdinc -static -lgcc -Wl,--nmagic -Wl,--gc-sections -g
CFLAG = ${CF} ${INCLUDE} -DSJF
.PHONY:all run debug clean
all: clean
${MAKE} -C lib all
${MAKE} -C test all
${MAKE} -C init all
${MAKE} -C user all
${MAKE} -C arch/riscv all
@echo -e '\n'Build Finished OK
TEST1:
@echo "Building TEST"
${MAKE} -C lib all
${MAKE} -C test test
${MAKE} -C init all
${MAKE} -C arch/riscv all
@echo -e '\n'Build Finished OK
r: all
@echo Launch the qemu ......
@qemu-system-riscv64 -nographic -machine virt -kernel vmlinux -bios default
tr: TEST1
@echo Launch the qemu ......
@qemu-system-riscv64 -nographic -machine virt -kernel vmlinux -bios default
d: all
@echo Launch the qemu for debug ......
@qemu-system-riscv64 -nographic -machine virt -kernel vmlinux -bios default -S -s
td: TEST
@echo Launch the qemu for debug ......
@qemu-system-riscv64 -nographic -machine virt -kernel vmlinux -bios default -S -s
clean:
${MAKE} -C lib clean
${MAKE} -C test clean
${MAKE} -C init clean
${MAKE} -C arch/riscv clean
$(shell test -f vmlinux && rm vmlinux)
$(shell test -f System.map && rm System.map)
@echo -e '\n'Clean Finished