From 132d3236bb884433bf94e961f6d32264e0334aec Mon Sep 17 00:00:00 2001 From: ornitorrincos Date: Tue, 18 Aug 2026 12:15:05 +0200 Subject: --- hello-efi/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 hello-efi/Makefile (limited to 'hello-efi/Makefile') 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 -- cgit v1.2.3-70-g09d2