-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (32 loc) · 863 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
RISCVC=riscv32-unknown-elf-gcc
RISCVCXX=riscv32-unknown-elf-g++
RISCVLD=riscv32-unknown-elf-ld
RISCVOBJCOPY=riscv32-unknown-elf-objcopy
RISCVOBJDUMP=riscv32-unknown-elf-objdump
SRC= tests/*.S tests/*.cpp
# 使用前请先make clean
all:cpupl monitor disk.img Makefile kernel.bin boot.bin
make -C boot
make -C tests
cpupl:cpupl.cpp device.hpp
g++ -o $@ $< -lpthread -Wall
monitor:monitor.cpp
g++ -o $@ $^
disk.img:kernel.bin boot.bin
if [ ! -e disk.img ]; then dd if=/dev/zero of=disk.img bs=1048576 count=256; fi
dd if=boot.bin of=disk.img bs=1024 count=4
dd if=kernel.bin of=disk.img bs=1024 count=8192 seek=4
boot.bin:
make -C boot
mv boot/boot.bin .
kernel.bin:
make -C tests
mv tests/kernel.bin .
moni:monitor
./monitor
pupl:cpupl
./cpupl disk.img
clean:
make clean -C boot
make clean -C tests
rm -rf *.o *.bin cpupl monitor reass.S *.elf