-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (28 loc) · 948 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
ISO_IMAGE = disk.iso
.PHONY: all run clean distclean
all: $(ISO_IMAGE)
run: $(ISO_IMAGE)
qemu-system-x86_64 -M q35 -m 2G -cdrom $(ISO_IMAGE) -enable-kvm -no-reboot
limine:
git clone https://github.com/limine-bootloader/limine.git --branch=v2.0-branch-binary --depth=1
make -C limine
kernel/kernel.elf:
$(MAKE) -C kernel
$(ISO_IMAGE): limine kernel/kernel.elf
rm -rf iso_root
mkdir -p iso_root
cp kernel/kernel.elf \
limine.cfg limine/limine.sys limine/limine-cd.bin limine/limine-eltorito-efi.bin iso_root/
# mv iso_root/kernel2.elf iso_root/kernel.elf
xorriso -as mkisofs -b limine-cd.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
--efi-boot limine-eltorito-efi.bin \
-efi-boot-part --efi-boot-image --protective-msdos-label \
iso_root -o $(ISO_IMAGE)
limine/limine-install $(ISO_IMAGE)
rm -rf iso_root
clean:
rm -f $(ISO_IMAGE)
$(MAKE) -C kernel clean
distclean: clean
rm -rf limine kernel/stivale2.h