-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (21 loc) · 713 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (21 loc) · 713 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
ASM = nasm
CC = gcc
LD = ld
ASM_FLAGS = -f elf32
CC_FLAGS = -m32 -c -nostdlib -nostdinc -fno-builtin -fno-stack-protector -ffreestanding
LD_FLAGS = -m elf_i386 -T linker.ld
all: krypton.bin
boot.o: boot/boot.asm
$(ASM) $(ASM_FLAGS) boot/boot.asm -o boot.o
kernel.o: kernel/kernel.c
$(CC) $(CC_FLAGS) kernel/kernel.c -o kernel.o
idt.o: kernel/idt.c
$(CC) $(CC_FLAGS) kernel/idt.c -o idt.o
keyboard.o: drivers/keyboard.c
$(CC) $(CC_FLAGS) drivers/keyboard.c -o keyboard.o
krypton.bin: boot.o kernel.o idt.o keyboard.o
$(LD) $(LD_FLAGS) boot.o kernel.o idt.o keyboard.o -o krypton.bin
run: krypton.bin
qemu-system-i386 -kernel krypton.bin
clean:
rm -f *.o boot.o kernel.o idt.o keyboard.o krypton.bin