-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (21 loc) · 750 Bytes
/
Copy pathMakefile
File metadata and controls
31 lines (21 loc) · 750 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
include lib/Makefile
.PHONY: all kernel
NAME=kernel
BINARY=bin/$(NAME)
DEBUG=-g -Wall -pedantic
INCLUDE=-I include/ -I include/libc/
NO_STDLIB=-nostdlib -nostdinc -fno-builtin -fno-stack-protector
CFLAGS=-m32 -std=c89 $(NO_STDLIB) $(DEBUG) $(INCLUDE)
LDFLAGS=-T boot/link.ld -m elf_i386
ASFLAGS=-m32
OBJECTS=boot/loader.o kernel/kernel.o kernel/io.o kernel/interrupt.o kernel/drivers/tty/tty.o kernel/drivers/timer/timer.o kernel/drivers/keyboard/keyboard.o
LIBRARIES=lib/libc.a
all: $(OBJECTS) $(NAME)
$(NAME): $(LIBRARIES) $(OBJECTS)
ld $(LDFLAGS) $(OBJECTS) $(LIBRARIES) -o $(BINARY)
test:
qemu-system-i386 -kernel $(BINARY)
clean: lib_clean
rm -f $(BINARY)
rm -f $(shell find boot/ -name *.o)
rm -f $(shell find kernel/ -name *.o)