-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (51 loc) · 1.42 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
59
60
61
62
63
64
65
.SILENT:
CONFIG ?= release
TARGET ?= x86_64
ifeq ($(TARGET), x86_64)
endif
ifeq ($(CONFIG), debug)
else ifeq ($(CONFIG), release)
else ifeq ($(CONFIG), dist)
endif
CC := clang-18
CXX := clang++-18
LD := ld.lld-18
BOOT_FILES :=
QEMU_ARGS :=
.PHONY: all
all: Kernel
.PHONY: clean
clean:
rm -rf Bin/
rm -rf Bin-Int/
include Targets/$(TARGET).mk
include Boot/make.mk
include FontBitmap/make.mk
include Kernel/make.mk
BOOT_FILES += Bin/$(CONFIG)/UEFI/hyper.cfg
Bin/$(CONFIG)/UEFI/hyper.cfg: Boot/hyper.cfg
mkdir -p $(dir $@)
cp -T $< $@
Bin/$(CONFIG)/Boot/Drive.img: Kernel ImgGen FontBitmap $(BOOT_FILES)
mkdir -p $(dir $@)
mkdir -p $(dir Bin/$(CONFIG)/UEFI/secure-os/)
Bin/$(CONFIG)/FontBitmap FontBitmap/BasicLatin.font 'Bin/$(CONFIG)/UEFI/secure-os/bsclatin.fnt'
Bin/$(CONFIG)/Boot/ImgGen \
-o $@ \
-s 2GiB \
-p 'start=~,end=+550MiB,type=EF00,name="EFI Partition"' \
-p 'start=~,end=^,type=d236c553-8661-4925-907d-2fbd318e038b,name="Primary Partition"' \
-f 'p=1,type=FAT32' \
-c 'p=1,from=Bin/$(CONFIG)/UEFI/,to=/'
echo Created Drive.img
Drive.img: Bin/$(CONFIG)/Boot/Drive.img
QEMU_ARGS += -drive format=raw,file=Bin/$(CONFIG)/Boot/Drive.img
QEMU_ARGS += --vga vmware -debugcon stdio -m 128M -smp sockets=1,cpus=4,maxcpus=4,cores=4,threads=1
ifeq ($(CONFIG), debug)
QEMU_ARGS += -s -S
else ifeq ($(CONFIG), release)
QEMU_ARGS += -s -S
endif
run: Drive.img
$(QEMU) $(QEMU_ARGS)
configure: Kernel ImgGen FontBitmap