vulcanos/Makefile

84 lines
1.9 KiB
Makefile
Raw Normal View History

LD = i686-elf-ld
2021-02-03 15:59:42 +01:00
LFLAGS = -melf_i386 -nostdlib -O2 -T link.ld
all: prepare cpu kernel_code drivers libc userspace mem link iso
prepare:
@mkdir -p obj/
@mkdir -p isodir/boot/grub/
@echo [MKDIR] obj/
@echo [MKDIR] isodir/boot/grub
@cp grub.cfg isodir/boot/grub/grub.cfg
@echo [CP] grub.cfg isodir/boot/grub.cfg
2021-02-03 15:59:42 +01:00
cpu:
@echo [DIR] kernel/cpu
@make -sC kernel/cpu
@cp kernel/cpu/*.o_asm obj/
@echo [CP] kernel/cpu/*.o obj/
2021-02-03 15:59:42 +01:00
kernel_code:
@echo [DIR] kernel/
@make -sC kernel
@cp kernel/*.o obj/
@echo [CP] kernel/*.o obj/
2021-02-03 15:59:42 +01:00
drivers:
@echo [DIR] kernel/drivers/
@make -sC kernel/drivers
@cp kernel/drivers/*.o obj/
@echo [CP] kernel/drivers/*.o obj/
2021-02-03 15:59:42 +01:00
libc:
@echo [DIR] kernel/libc/
@make -sC kernel/libc
@cp kernel/libc/*.o obj/
@echo [CP] kernel/libc/*.o obj/
2021-02-03 15:59:42 +01:00
userspace:
@echo [DIR] kernel/userspace/
@make -sC kernel/userspace
@cp kernel/userspace/*.o obj/
@echo [CP] kernel/userspace/*.o obj/
2021-02-03 15:59:42 +01:00
mem:
@echo [DIR] kernel/mem
@make -sC kernel/mem
@cp kernel/mem/*.o obj/
@echo [CP] kernel/mem/*.o obj/
2021-02-03 15:59:42 +01:00
link:
@$(LD) $(LFLAGS) -o isodir/boot/vulcanos.bin obj/*.o obj/*.o_asm
@echo [LD] Linking blob...
2021-02-03 15:59:42 +01:00
iso:
@echo [ISO] Creating ISO file...
@grub-mkrescue isodir -o vulcanos.iso > /dev/null 2>&1
2021-02-03 15:59:42 +01:00
clean:
@rm -rf obj/ kernel/*.o kernel/cpu/*.o_asm
@echo [RM] obj
@echo [RM] kernel/*.o
@echo [RM] kernel/cpu/*.o_asm
@rm -rf kernel/userspace/*.o kernel/mem/*.o
@echo [RM] kernel/userspace/*.o
@echo [RM] kernel/mem/*.o
@rm -rf kernel/drivers/*.o kernel/libc/*.o
@echo [RM] kernel/drivers/*.o
@echo [RM] kernel/libc/*.o
@rm -rf vulcanos.iso bochslog.txt commands isodir
@echo [RM] vulcanos.iso
@echo [RM] isodir
2021-02-03 15:59:42 +01:00
bochs:
bochs -f bochs_cfg -q
run:
qemu-system-x86_64 -cdrom vulcanos.iso -cpu qemu32
run-debug:
qemu-system-x86_64 -cdrom vulcanos.iso -d exec,cpu
run-curses:
qemu-system-x86_64 -cdrom vulcanos.iso -curses -cpu qemu32