From 53201e79cf34b288083c2e7e7fe95e9fe58fea0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 4 Nov 2015 09:04:47 +0100 Subject: kernel/Makefile: learn about .asm and .S --- kernel/Makefile | 23 +++++++++++++++++------ 1 file 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 -- cgit v1.1-2-g2b99