-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile_aarch64
43 lines (35 loc) · 1 KB
/
makefile_aarch64
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
.PHONY: bootstrap
bootstrap: bin/kernelaa64.elf
# we want to use clang and output a PE/COFF formatted file
# these are the zig flags
ZFLAGS = \
-target aarch64-uefi \
-fClang \
-ofmt=coff \
--subsystem efi_application \
-fLLD
# we want a freestanding executable
CFLAGS+= \
-target aarch64-unknown-windows \
-ffreestanding \
-mcmodel=large \
-fno-pic \
-fshort-wchar \
-mno-red-zone \
-Wall \
-MMD \
-Werror \
-pedantic
# force use of LLVM Linker and output a PE/COFF formatted file
LDFLAGS+= \
-flavor link \
-entry:efi_main \
-subsystem:efi_application
bin/kernelaa64.elf: bin/efi/boot bin/uefi_bootstrap.obj bin/efi/boot/bootaa64.efi
cd kernel && make -f makefile_aarch64
bin/efi/boot:
mkdir -p $@
bin/uefi_bootstrap.obj: bootstrap/uefi_bootstrap.zig
zig build-obj $(ZFLAGS) -femit-bin=$@ -cflags $(CFLAGS) -- $^
bin/efi/boot/bootaa64.efi: bin/uefi_bootstrap.obj
lld $(LDFLAGS) $^ -out:$@