hippOS/Makefile

26 lines
660 B
Makefile
Raw Normal View History

CC=i686-elf-gcc
.PHONY: iso run clean
%.o: %.c
2022-02-22 21:20:57 +02:00
$(CC) -c $< -o $@ -std=gnu99 -mgeneral-regs-only -ffreestanding -O2 -Wall -Wextra -pedantic -I.
bootstrap.o: bootstrap.s
i686-elf-as bootstrap.s -o bootstrap.o
kernel.bin: bootstrap.o vga.o std/std.o std/kstd.o cpu/idt.o cpu/pic.o cpu/exception.o kernel.o
2022-02-22 21:20:57 +02:00
$(CC) -T linker.ld -o $@ -ffreestanding -O2 -nostdlib -lgcc $^
iso: kernel.bin
mkdir -p isodir/boot/grub
cp kernel.bin isodir/boot/kernel.bin
cp extra/grub.cfg isodir/boot/grub/grub.cfg
grub-mkrescue -o generated-iso.iso isodir
run: iso
qemu-system-i386 -d int -M smm=off -cdrom generated-iso.iso
clean:
2022-02-22 14:10:43 +02:00
rm -rf *.o kernel.bin *.iso isodir/