-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
56 lines (41 loc) · 990 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
include Config.mk
MAKEFLAGS += --jobs=$(shell nproc)
SUBDIRS := kernel userland tools
export CFLAGS := \
-std=c11 \
-m32 \
-static \
-nostdlib -ffreestanding \
-U_FORTIFY_SOURCE \
-Wall -Wextra -pedantic \
-O2 -g \
$(CONFIG)
.PHONY: all run clean $(SUBDIRS) base
all: kernel initrd
run: kernel initrd
scripts/run.sh
initrd: base
find $< -mindepth 1 ! -name '.gitkeep' -printf "%P\n" | sort | cpio -oc -D $< -F $@
base: $@/* userland
$(RM) -r $@/root/src
-git clone . $@/root/src
$(RM) -r $@/root/src/.git
$(SUBDIRS):
$(MAKE) -C $@ all
cdrom.iso: kernel initrd
cp kernel/kernel initrd disk/boot
grub-mkrescue -o '$@' disk
clean:
for dir in $(SUBDIRS); do $(MAKE) -C $$dir $@; done
$(RM) -r base/root/src
$(RM) initrd disk_image disk/boot/kernel disk/boot/initrd
runsh: kernel initrd
scripts/run.sh shell
shell: kernel initrd
scripts/run.sh shell
test: kernel initrd
scripts/run_tests.sh
tool:
make -C tools
toolchain:
scripts/toolchain.sh $(CROSS_TYPE)