-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·39 lines (33 loc) · 962 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
35
36
37
38
39
drivers_dir := drivers
boot_dir := boot
init_dir := init
lib_dir := lib
mm_dir := mm
vmlinux_elf := kernel.elf
vmlinux_img := kernel8.img
link_script := kernel.lds
modules := boot drivers init lib mm user
objects := $(boot_dir)/*.o \
$(init_dir)/*.o \
$(drivers_dir)/rpi3/*.o \
$(lib_dir)/*.o \
$(mm_dir)/*.o \
user/*.o
.PHONY: all $(modules) clean debug run
all: $(modules) vmlinux
vmlinux: $(modules)
$(LD) -o $(vmlinux_elf) -T$(link_script) $(objects)
$(CROSS_COMPILE)objcopy $(vmlinux_elf) -O binary $(vmlinux_img)
$(modules):
$(MAKE) --directory=$@
clean:
for d in $(modules); \
do \
$(MAKE) --directory=$$d clean; \
done; \
rm -rf *.o *~ $(vmlinux_elf) $(vmlinux_img)
run:
qemu-system-aarch64 -M raspi3 -serial stdio -kernel kernel8.img
debug:
qemu-system-aarch64 -S -s -M raspi3 -serial stdio -kernel kernel8.img
include include.mk