diff options
author | Regina König | 2022-09-07 23:24:55 +0200 |
---|---|---|
committer | Regina König | 2022-09-07 23:24:55 +0200 |
commit | 09e1b4fb40878ef29b8ca36b93172fcd89c70883 (patch) | |
tree | f731cd63f8a6511d1b1bbad6ed4eb01111e77995 /GNU_efi_HelloWorld/Makefile_save | |
parent | hiuhi (diff) | |
parent | Rename dir and experiment with cmdline options (diff) | |
download | memtest86-master.tar.gz memtest86-master.tar.xz memtest86-master.zip |
Diffstat (limited to 'GNU_efi_HelloWorld/Makefile_save')
-rw-r--r-- | GNU_efi_HelloWorld/Makefile_save | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/GNU_efi_HelloWorld/Makefile_save b/GNU_efi_HelloWorld/Makefile_save new file mode 100644 index 0000000..6ae963d --- /dev/null +++ b/GNU_efi_HelloWorld/Makefile_save @@ -0,0 +1,36 @@ +ARCH = $(shell uname -m | sed s,i[3456789]86,ia32,) + +OBJS = hello.o +TARGET = hello.efi + +EFIINC = /usr/include/efi +EFFINCS = -I$(EFIINC) -I$(EFIINC)/$(ARCH) -I$(EFIINC)/protocol +EFILIB = /usr/lib +EFI_CRT_OBJS = $(EFILIB)/crt0-efi-$(ARCH).o +EFI_LDS = $(EFILIB)/elf_$(ARCH)_efi.lds + +CFLAGS = $(EFFINCS) -fno-stack-protector -fpic \ + -fshort-wchar -mno-red-zone -Wall + +ifeq ($(ARCH),x86_64) + CFLAGS += -DEFI_FUNCTION_WRAPPER +endif + +LDFLAGS = -nostdlib -znocombreloc -T $(EFI_LDS) -shared \ + -Bsymbolic -L $(EFILIB) $(EFI_CRT_OBJS) + +all: $(TARGET) + cp hello.efi ../test_code/hda-contents/ + +hello.so: $(OBJS) + ld $(LDFLAGS) $(OBJS) -o $@ -lefi -lgnuefi + +%.efi: %.so + objcopy -j .text -j .sdata -j .data -j .dynamic \ + -j .dynsym -j .rel -j .rela -j .reloc \ + --target=efi-app-$(ARCH) $^ $@ + +clear: + rm *.efi + rm *.o + rm *.so |