summaryrefslogtreecommitdiffstats
path: root/kernel/Makefile
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-11-04 09:04:47 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-11-04 09:04:47 +0100
commit53201e79cf34b288083c2e7e7fe95e9fe58fea0f (patch)
tree498b61ab752850f797791b91b95d171eb8b8e09f /kernel/Makefile
parent495c452bc7e0fabef5599136aabc9cf5b369cfdc (diff)
downloadjeyzuos-53201e79cf34b288083c2e7e7fe95e9fe58fea0f.zip
jeyzuos-53201e79cf34b288083c2e7e7fe95e9fe58fea0f.tar.gz
kernel/Makefile: learn about .asm and .S
Diffstat (limited to 'kernel/Makefile')
-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