swissChili | d813792 | 2021-02-17 15:34:07 -0800 | [diff] [blame^] | 1 | SOURCES = boot.o main.o descriptor_tables.o mem.o vga.o gdt_flush.o idt.o interrupts.o |
| 2 | CFLAGS = -nostdlib -nostdinc -fno-builtin -fno-stack-protector -ffreestanding -m32 -O2 -g |
| 3 | LDFLAGS = -Tlink.ld -melf_i386 |
| 4 | ASMFLAGS = -felf |
| 5 | |
| 6 | kernel.elf: $(SOURCES) |
| 7 | ld $(LDFLAGS) -o $@ $^ |
| 8 | |
| 9 | clean: |
| 10 | rm -f *.o *.bin *.elf |
| 11 | |
| 12 | qemu: install |
| 13 | qemu-system-i386 -monitor stdio ../bin/bluejay.iso |
| 14 | |
| 15 | .s.o: |
| 16 | nasm $(ASMFLAGS) $< |
| 17 | |
| 18 | install: kernel.elf |
| 19 | cp kernel.elf ../boot/ |
| 20 | grub-mkrescue -o ../bin/bluejay.iso .. |
| 21 | |
| 22 | .PHONY: install qemu clean |