forked from Mathewnd/Astral
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (45 loc) · 1.63 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
ISODIR=$(shell pwd)/iso
ISO=astral.iso
LIMINEDIR=$(shell pwd)/host-pkgs/limine/usr/local/share/limine/
KERNEL=$(shell pwd)/pkgs/astral/boot/astral
QEMUFLAGS=-M q35 -cdrom $(ISO) -m 2G -smp cpus=1 -no-shutdown -no-reboot -monitor stdio -debugcon file:/dev/stdout -serial file:/dev/stdout # hacky but works :')
INITRD=$(shell pwd)/iso/initrd
DISTROTYPE=full
.PHONY: all kernel clean clean-kernel iso initrd full minimal
all: jinx
make kernel
./jinx build-all
make $(ISO)
jinx:
curl https://raw.githubusercontent.com/mintsuki/jinx/87867554aa157115dde0899b1b8fd0bf9f949096/jinx > jinx
chmod +x jinx
$(ISO): limine.cfg liminebg.bmp $(KERNEL) initrd
mkdir -p $(ISODIR)
cp $(KERNEL) liminebg.bmp limine.cfg $(LIMINEDIR)/limine-bios.sys $(LIMINEDIR)/limine-bios-cd.bin $(LIMINEDIR)/limine-uefi-cd.bin $(ISODIR)
xorriso -as mkisofs -b limine-bios-cd.bin -no-emul-boot -boot-load-size 4 -boot-info-table --efi-boot limine-uefi-cd.bin -efi-boot-part --efi-boot-image --protective-msdos-label $(ISODIR) -o $(ISO)
initrd:
mkdir -p $(ISODIR)
make $(DISTROTYPE)
full:
./jinx sysroot
cd sysroot; tar --format=ustar -cf $(INITRD) *
minimal:
./jinx install minimalsysroot mlibc bash coreutils init distro-files vim nano mount netd
cd minimalsysroot; tar --format=ustar -cf $(INITRD) *
kernel:
rm -f builds/astral.packaged
rm -f builds/astral.built
./jinx build astral
clean-kernel:
find builds/astral/ -name *.o -delete
find builds/astral/ -name *.asmo -delete
clean:
make clean-kernel
./jinx clean
rm jinx
run:
qemu-system-x86_64 $(QEMUFLAGS)
run-gdb:
qemu-system-x86_64 $(QEMUFLAGS) -S -s
run-kvm:
qemu-system-x86_64 $(QEMUFLAGS) -enable-kvm -cpu host