-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (71 loc) · 1.19 KB
/
Copy pathMakefile
File metadata and controls
89 lines (71 loc) · 1.19 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
include config.mk
VPATH = src/ src/bootloader src/w
# C sources
C = \
ata.c \
clk.c \
elf.c \
ext2.c \
idt.c \
init.c \
intr.c \
io.c \
kbd.c \
kmain.c \
kmalloc.c \
kprintf.c \
mouse.c \
pmm.c \
proc.c \
pq.c \
queue.c \
sched.c \
sem.c \
syscall.c \
tty.c \
vfs.c \
vmm.c \
w.c
# asm sources
ASM = \
ctxsw.s \
enter_usermode.s \
intr.s \
start.s
OBJ = $(addprefix bin/, $(C:.c=.c.o) $(ASM:.s=.s.o))
all: libs maestro.bin bootloader img user
maestro.bin: $(OBJ)
$(LD) -o $@ $^ $(LDFLAGS)
stage1.bin: stage1.s
$(AS) -i src/bootloader -f bin $< -o $@
dd if=stage1.bin of=disk.img conv=notrunc
stage2.bin: stage2.s
$(AS) -i src/bootloader -f bin $< -o $@
e2cp stage2.bin disk.img:/
bin/%.c.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
bin/%.s.o: %.s
$(AS) -f elf32 $< -o $@
libs:
$(MAKE) -C lib
disk:
meta/make_disk.sh
toolchain:
meta/make_toolchain.sh
bootloader: stage1.bin stage2.bin
img: maestro.bin
e2cp maestro.bin disk.img:/
.PHONY: user
user:
$(MAKE) -C user
.PHONY: start
start:
qemu-system-i386 \
-m 16M \
-serial stdio \
-drive file=disk.img,format=raw,index=0,media=disk
.PHONY: clean
clean:
rm -f bin/* *.bin
$(MAKE) -C lib clean
$(MAKE) -C user clean