forked from gmh5225/OS-lyre
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
71 lines (55 loc) · 1.57 KB
/
GNUmakefile
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
59
60
61
62
63
64
65
66
67
68
69
70
71
QEMUFLAGS ?= -M q35,smm=off -m 8G -boot order=dc -cdrom lyre.iso -serial stdio -smp 4
.PHONY: all
all:
rm -f lyre.iso
$(MAKE) lyre.iso
lyre.iso: jinx
rm -f builds/kernel.built builds/kernel.installed
$(MAKE) distro-base
./build-support/makeiso.sh
.PHONY: debug
debug:
JINX_CONFIG_FILE=jinx-config-debug $(MAKE) all
jinx:
curl -o jinx https://raw.githubusercontent.com/mintsuki/jinx/trunk/jinx
chmod +x jinx
.PHONY: distro-full
distro-full: jinx
./jinx build-all
.PHONY: distro-base
distro-base: jinx
./jinx build base-files kernel init bash coreutils nano less binutils gcc
.PHONY: run-kvm
run-kvm: lyre.iso
qemu-system-x86_64 -enable-kvm -cpu host $(QEMUFLAGS)
.PHONY: run-hvf
run-hvf: lyre.iso
qemu-system-x86_64 -accel hvf -cpu host $(QEMUFLAGS)
ovmf:
mkdir -p ovmf
cd ovmf && curl -o OVMF.fd https://retrage.github.io/edk2-nightly/bin/RELEASEX64_OVMF.fd
.PHONY: run-uefi
run-uefi: lyre.iso ovmf
qemu-system-x86_64 -enable-kvm -cpu host $(QEMUFLAGS) -bios ovmf/OVMF.fd
.PHONY: run
run: lyre.iso
qemu-system-x86_64 $(QEMUFLAGS)
.PHONY: kernel-clean
kernel-clean:
rm -rf builds/kernel* pkgs/kernel*
.PHONY: init-clean
init-clean:
rm -rf builds/init* pkgs/init*
.PHONY: base-files-clean
base-files-clean:
rm -rf builds/base-files* pkgs/base-files*
.PHONY: clean
clean: kernel-clean init-clean base-files-clean
rm -rf iso_root sysroot lyre.iso initramfs.tar
.PHONY: distclean
distclean: jinx
cd kernel && ./bootstrap && ./configure && make maintainer-clean
./jinx clean
rm -rf iso_root sysroot lyre.iso initramfs.tar jinx ovmf
chmod -R 777 .jinx-cache
rm -rf .jinx-cache