-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (23 loc) · 766 Bytes
/
Makefile
File metadata and controls
31 lines (23 loc) · 766 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
OBJECTS = start.o scrn.o gdt.o idt.o isrs.o irq.o timer.o kb.o kheap.o paging.o ordered_array.o main.o
CC = gcc
CFLAGS = -m32 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -I./include -c
LDFLAGS = -T link.ld -melf_i386
AS = nasm
ASFLAGS = -f elf
all: kernel
kernel: $(OBJECTS)
ld $(LDFLAGS) $(OBJECTS) -o kernel
kerndev.iso: kernel
cp kernel boot
grub-mkrescue -o kerndev.iso .
run: kerndev.iso
qemu-system-i386 -cdrom kerndev.iso
debug: kernel
objcopy --only-keep-debug kernel kernel.debug
qemu-system-i386 -s -S -kernel kernel
%.o: %.c
$(CC) $(CFLAGS) $< -o $@
%.o: %.asm
$(AS) $(ASFLAGS) $< -o $@
clean:
rm *.o kernel boot/kernel kerndev.iso