[make] Restructure directories.
This commit is contained in:
parent
94de5f557b
commit
21ed31f8da
18
Makefile
18
Makefile
|
@ -1,4 +1,8 @@
|
||||||
.PHONY: all clean install
|
include Makefile.inc
|
||||||
|
|
||||||
|
DIRS = core
|
||||||
|
|
||||||
|
.PHONY: all clean install core
|
||||||
|
|
||||||
all: kernel
|
all: kernel
|
||||||
|
|
||||||
|
@ -8,14 +12,18 @@ install: kernel
|
||||||
umount /mnt
|
umount /mnt
|
||||||
cp kernel /boot/toaruos-kernel
|
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
|
kernel: start.o link.ld main.o core
|
||||||
ld -m elf_i386 -T link.ld -o kernel *.o
|
${LD} -T link.ld -o kernel *.o core/*.o
|
||||||
|
|
||||||
%.o: %.c
|
%.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
|
start.o: start.asm
|
||||||
nasm -f elf -o start.o start.asm
|
nasm -f elf -o start.o start.asm
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.o kernel
|
-rm -f *.o kernel
|
||||||
|
-for d in ${DIRS}; do (cd $$d; ${MAKE} clean); done
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue