[make] Restructure directories.

This commit is contained in:
Kevin Lange 2011-01-17 13:58:31 -06:00
parent 94de5f557b
commit 21ed31f8da
11 changed files with 28 additions and 5 deletions

View File

@ -1,4 +1,8 @@
.PHONY: all clean install
include Makefile.inc
DIRS = core
.PHONY: all clean install core
all: kernel
@ -8,14 +12,18 @@ install: kernel
umount /mnt
cp kernel /boot/toaruos-kernel
kernel: start.o link.ld main.o vga.o gdt.o idt.o isrs.o irq.o timer.o kbd.o kprintf.o
ld -m elf_i386 -T link.ld -o kernel *.o
kernel: start.o link.ld main.o core
${LD} -T link.ld -o kernel *.o core/*.o
%.o: %.c
gcc -Wall -m32 -O0 -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o $@ $<
${CC} ${CFLAGS} -I./include -c -o $@ $<
core:
cd core; ${MAKE} ${MFLAGS}
start.o: start.asm
nasm -f elf -o start.o start.asm
clean:
rm -f *.o kernel
-rm -f *.o kernel
-for d in ${DIRS}; do (cd $$d; ${MAKE} clean); done

5
Makefile.inc Normal file
View File

@ -0,0 +1,5 @@
CC = gcc
LD = ld -m elf_i386
CFLAGS = -Wall -m32 -O0 -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin
NASM = nasm -f elf

10
core/Makefile Normal file
View File

@ -0,0 +1,10 @@
include ../Makefile.inc
.PHONY: all clean install core
all: gdt.o idt.o irq.o isrs.o kbd.o kprintf.o timer.o vga.o
%.o: %.c
${CC} ${CFLAGS} -I../include -c -o $@ $<
clean:
-rm -f *.o

View File

View File

View File

View File

View File

View File