summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/Makefile23
1 files changed, 17 insertions, 6 deletions
diff --git a/kernel/Makefile b/kernel/Makefile
index 6c1b3ae..7250696 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -1,16 +1,27 @@
all: kernel.elf
+OBJS=entry.o tty.o
+HEADERS=tty.h
+
+.SUFFIXES: .asm
+
.c.o :
gcc -std=gnu99 -m32 -fno-builtin -ffreestanding -nostdlib -Wall -Wextra -c $< -o $@
-kernel.elf: kernel.o tty.o tty.h entry.o
- ld -Tlinker.ld -melf_i386 entry.o tty.o kernel.o -o kernel.elf
+.S.o :
+ as -32 $< -o $@
+
+.asm.o :
+ nasm -felf32 $< -o $@
-# entry.o: entry.S
-# as -32 $< -o entry.o
+
+kernel.elf: kernel.o $(OBJS) $(HEADERS)
+ ld -Tlinker.ld -melf_i386 $(OBJS) kernel.o -o kernel.elf
entry.o: entry.asm
- nasm -f elf32 $<
+
+tty.o: tty.c tty.h
+
clean:
- rm -f *.o kernel.elf
+ rm -f kernel.elf *.o