Skip to content
Snippets Groups Projects
Commit b0763108 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt Committed by Alexander Graf
Browse files

scripts/Makefile.lib: generalize building built in EFI app


Replace all occurences of helloworld by generalized forms.
This allows us to build additional EFI applications that are
included into the U-Boot binary without loading
scripts/Makefile.lib with specific filenames.

Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 5e44489b
No related branches found
No related tags found
No related merge requests found
...@@ -359,20 +359,22 @@ cmd_S_ttf= \ ...@@ -359,20 +359,22 @@ cmd_S_ttf= \
$(obj)/%.S: $(src)/%.ttf $(obj)/%.S: $(src)/%.ttf
$(call cmd,S_ttf) $(call cmd,S_ttf)
# EFI Hello World application # EFI applications
# A Makefile target *.efi is built as EFI application.
# A Makefile target *_efi.S wraps *.efi as built-in EFI application.
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Generate an assembly file to wrap the EFI app # Generate an assembly file to wrap the EFI app
cmd_S_efi= \ cmd_S_efi= \
( \ ( \
echo '.section .rodata.efi.init,"a"'; \ echo '.section .rodata.$*.init,"a"'; \
echo '.balign 16'; \ echo '.balign 16'; \
echo '.global __efi_helloworld_begin'; \ echo '.global __efi_$*_begin'; \
echo '__efi_helloworld_begin:'; \ echo '__efi_$*_begin:'; \
echo '.incbin "$<" '; \ echo '.incbin "$<" '; \
echo '__efi_helloworld_end:'; \ echo '__efi_$*_end:'; \
echo '.global __efi_helloworld_end'; \ echo '.global __efi_$*_end'; \
echo '.balign 16'; \ echo '.balign 16'; \
) > $@ ) > $@
$(obj)/%_efi.S: $(obj)/%.efi $(obj)/%_efi.S: $(obj)/%.efi
...@@ -383,7 +385,7 @@ cmd_efi_objcopy = $(OBJCOPY) -j .header -j .text -j .sdata -j .data -j \ ...@@ -383,7 +385,7 @@ cmd_efi_objcopy = $(OBJCOPY) -j .header -j .text -j .sdata -j .data -j \
.dynamic -j .dynsym -j .rel* -j .rela* -j .reloc \ .dynamic -j .dynsym -j .rel* -j .rela* -j .reloc \
$(if $(EFI_TARGET),$(EFI_TARGET),-O binary) $^ $@ $(if $(EFI_TARGET),$(EFI_TARGET),-O binary) $^ $@
$(obj)/%.efi: $(obj)/%.so $(obj)/%.efi: $(obj)/%_efi.so
$(call cmd,efi_objcopy) $(call cmd,efi_objcopy)
quiet_cmd_efi_ld = LD $@ quiet_cmd_efi_ld = LD $@
...@@ -392,7 +394,7 @@ cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \ ...@@ -392,7 +394,7 @@ cmd_efi_ld = $(LD) -nostdlib -znocombreloc -T $(EFI_LDS_PATH) -shared \
EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS) EFI_LDS_PATH = $(srctree)/arch/$(ARCH)/lib/$(EFI_LDS)
$(obj)/helloworld.so: $(obj)/helloworld.o arch/$(ARCH)/lib/$(EFI_CRT0) \ $(obj)/%_efi.so: $(obj)/%.o arch/$(ARCH)/lib/$(EFI_CRT0) \
arch/$(ARCH)/lib/$(EFI_RELOC) arch/$(ARCH)/lib/$(EFI_RELOC)
$(call cmd,efi_ld) $(call cmd,efi_ld)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment