summaryrefslogtreecommitdiffstats
path: root/kernel/Makefile
blob: ebaf3c5af4d874140475089644f7548ad5d62b51 (plain)
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
all: kernel.elf

OBJS=entry.o stdlib.o tty.o io_ports.o
HEADERS=stdlib.h tty.h io_ports.h

.SUFFIXES: .asm

.c.o :
	gcc -std=gnu99 -m32 -fno-builtin -ffreestanding -nostdlib -Wall -Wextra -c $< -o $@

.S.o :
	as -32 $< -o $@

.asm.o :
	nasm -felf32 $< -o $@


kernel.elf: kernel.o $(OBJS) $(HEADERS)
	ld -Tlinker.ld -melf_i386 $(OBJS) kernel.o -o kernel.elf

entry.o: entry.asm

stdlib.o: stdlib.c stdlib.h

tty.o: tty.c tty.h


clean:
	rm -f kernel.elf *.o