-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathMakefile
More file actions
102 lines (80 loc) · 2.27 KB
/
Copy pathMakefile
File metadata and controls
102 lines (80 loc) · 2.27 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
include common.mk
OS := $(shell uname)
FS_DIRS := fs/redos/system
ifeq ($(OS),Darwin)
BOOTFS := /Volumes/bootfs
else
BOOTFS := /media/bootfs
endif
.PHONY: all shared user kernel clean raspi virt run debug dump prepare-fs help install
all: kshared modules kernel shared user tools libs docs
@echo "Build complete."
./createfs
kshared:
$(MAKE) -C shared kern
modules: kshared
$(MAKE) -C modules XHCI_CTX_SIZE=$(XHCI_CTX_SIZE) QEMU=$(QEMU) TEST=$(TEST) DRIVER_TARGET=$(MODE)
shared:
$(MAKE) -C shared BUILD_DIR=./build
user: shared prepare-fs
$(MAKE) -C user
kernel: kshared modules
$(MAKE) -C kernel LOAD_ADDR=$(LOAD_ADDR) XHCI_CTX_SIZE=$(XHCI_CTX_SIZE) QEMU=$(QEMU) TEST=$(TEST)
tools: shared libs prepare-fs
$(MAKE) -C tools
libs: shared
$(MAKE) -C libs
test:
$(MAKE) $(MODE) QEMU=true TEST=true all
./run_$(MODE)
docs:
$(MAKE) -C docs all
clean:
$(MAKE) -C shared $@
$(MAKE) -C user $@
$(MAKE) -C kernel $@
$(MAKE) -C tools $@
$(MAKE) -C modules $@
$(MAKE) -C libs $@
@echo "removing images"
$(RM) kernel.img kernel.elf dump
raspi:
$(MAKE) LOAD_ADDR=0x80000 XHCI_CTX_SIZE=64 QEMU=true MODE=raspi all
./run_raspi
virt:
$(MAKE) LOAD_ADDR=0x41000000 XHCI_CTX_SIZE=32 QEMU=true MODE=virt all
run:
$(MAKE) $(MODE)
./run_$(MODE)
debug:
$(MAKE) $(MODE)
./rundebug MODE=$(MODE) $(ARGS)
dump:
$(ARCH)objdump -S -D kernel.elf > dump
$(MAKE) -C user $@
$(MAKE) -C tools $@
$(MAKE) -C modules $@
install:
$(MAKE) clean
$(MAKE) LOAD_ADDR=0x80000 XHCI_CTX_SIZE=64 QEMU=false MODE=raspi all
cp kernel.img $(BOOTFS)/kernel8.img
cp kernel.img $(BOOTFS)/kernel_2712.img
cp config.txt $(BOOTFS)/config.txt
cp kernel.elf $(BOOTFS)/kernel.elf
# TODO: Install basic fs
prepare-fs:
@echo "creating dirs"
@mkdir -p $(FS_DIRS)
help:
@printf "usage:\n\
make all build the os\n\
make clean remove all build artifacts\n\
make raspi build for raspberry pi\n\
make virt build for qemu virt board\n\
make run build and run in virt mode\n\
make debug build and run with debugger\n\
make dump disassemble kernel.elf\n\
make install create raspi kernel and mount it on a bootable partition\n\
make prepare-fs create directories for the filesystem\n\n"\
\n\
Use 'make V=1' for verbose build output.