Improved build system

This commit is contained in:
ice-bit 2019-07-11 20:13:47 +02:00
parent 512beb4173
commit 6aca949f50
2 changed files with 49 additions and 9 deletions

View File

@ -1,17 +1,50 @@
LD = i686-elf-ld
LFLAGS = -melf_i386 -nostdlib -O2 -T link.ld
all: prepare cpu kernel_code drivers libc shell link iso
prepare:
mkdir -p obj/
mkdir -p isodir/boot/grub/
cp grub.cfg isodir/boot/grub/grub.cfg
cpu:
make -C kernel/cpu
cp kernel/cpu/*.o obj/
kernel_code:
make -C kernel
cp kernel/*.o obj/
drivers:
make -C kernel/drivers/
cp kernel/drivers/*.o obj/
libc:
make -C kernel/libc
cp kernel/libc/*.o obj/
shell:
make -C kernel/shell
cp kernel/shell/*.o obj/
link:
$(LD) $(LFLAGS) -o isodir/boot/iceOS.bin obj/*.o
iso:
grub-mkrescue isodir -o iceOS.iso
run:
qemu-system-x86_64 -cdrom iceOS.iso
run-curses:
qemu-system-x86_64 -cdrom iceOS.iso -curses
bochs:
bochs -f bochs_cfg -q
clean:
rm -rf obj/ kernel/*.o kernel/cpu/*.o
rm -rf kernel/shell/*.o
rm -rf kernel/drivers/*.o kernel/libc/*.o
rm -rf iceOS.iso bochslog.txt commands isodir
bochs:
bochs -f bochs_cfg -q
run:
qemu-system-x86_64 -cdrom iceOS:iso
run-curses:
qemu-system-x86_64 -cdrom iceOS.iso -curses

7
grub.cfg Normal file
View File

@ -0,0 +1,7 @@
set timeout = 0
set default = 0
menuentry "iceOS" {
multiboot2 /boot/iceOS.bin
boot
}