diff options
| author | 2026-08-18 12:15:05 +0200 | |
|---|---|---|
| committer | 2026-08-18 12:15:05 +0200 | |
| commit | 132d3236bb884433bf94e961f6d32264e0334aec (patch) | |
| tree | 06638976b06f019ea4037175ff228f8271057c44 /hello-efi/Makefile | |
Diffstat (limited to 'hello-efi/Makefile')
| -rw-r--r-- | hello-efi/Makefile | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/hello-efi/Makefile b/hello-efi/Makefile new file mode 100644 index 0000000..e509176 --- /dev/null +++ b/hello-efi/Makefile @@ -0,0 +1,12 @@ +EFI_ARCH = x86_64 +EFIINC = /usr/include/efi +EFIINCS = -I$(EFIINC) -I$(EFIINC)/$(EFI_ARCH) -I$(EFIINC)/protocol +LIB = /usr/lib +EFILIB = /usr/lib +EFI_CRT_OBJS = $(EFILIB)/crt0-efi-$(EFI_ARCH).o +EFI_LDS = $(EFILIB)/elf_$(EFI_ARCH)_efi.lds + +all: + gcc $(EFIINCS) -fpic -ffreestanding -fno-stack-protector -fno-stack-check -fshort-wchar -mno-red-zone -maccumulate-outgoing-args -c main.c -o main.o + ld -shared -Bsymbolic -T $(EFI_LDS) -L $(EFILIB) $(EFI_CRT_OBJS) main.o -o main.so -lefi -lgnuefi + objcopy -j .text -j .sdata -j .data -j .rodata -j .dynamic -j .dynsym -j .rel -j .rela -j .rel.* -j .rela.* -j .reloc --output-target efi-app-x86_64 --subsystem=10 main.so main.efi
\ No newline at end of file |
