-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (26 loc) · 769 Bytes
/
Makefile
File metadata and controls
38 lines (26 loc) · 769 Bytes
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
CC = gcc
ASM = nasm
LD = ld
all: os-image
run: clean all
qemu-system-x86_64 -fda os-image
kernel.o: kernel.c
$(CC) -fno-pie -m32 -ffreestanding -c $< -o $@
keyb.o: keyb.c
$(CC) -fno-pie -m32 -ffreestanding -c $< -o $@
idt_init.o: idt_init.c
$(CC) -fno-pie -m32 -ffreestanding -c $< -o $@
user_utils.o: user_utils.c
$(CC) -fno-pie -m32 -ffreestanding -c $< -o $@
kernel_entry.o: kernel_entry.asm
$(ASM) $< -f elf32 -o $@
io_functions.o: io_functions.asm
$(ASM) $< -f elf32 -o $@
bootstrap.bin: bootstrap.asm
$(ASM) $< -f bin -o $@
kernel.bin: kernel_entry.o kernel.o keyb.o idt_init.o user_utils.o io_functions.o
$(LD) -m elf_i386 -o $@ -Ttext 0x1000 $^ --oformat binary
os-image: bootstrap.bin kernel.bin
cat $^ > $@
clean:
rm *.bin *.o os-image