summaryrefslogtreecommitdiffstats
path: root/arch/efi/Makefile
blob: 32a1c152b791faacc804a0724a4c5f76f470b114 (plain) (blame)
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
KBUILD_DEFCONFIG := efi_defconfig

CFLAGS += -fpic -fshort-wchar -mno-sse -mno-mmx

ifeq ($(CONFIG_X86_32),y)
	UTS_MACHINE := i386
	biarch := $(call cc-option,-m32)
	AFLAGS += $(biarch)
	CFLAGS += $(biarch)
	TARGET = efi-app-ia32
else
	UTS_MACHINE := x86_64
	AFLAGS += -m64
	CFLAGS += -m64 -mno-red-zone
	TARGET = efi-app-x86_64
endif

lds-$(CONFIG_X86_32)   := arch/efi/lib/elf_ia32_efi.lds
lds-$(CONFIG_X86_64)   := arch/efi/lib/elf_x86_64_efi.lds

cmd_barebox__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_barebox) -o $@	\
		-T $(lds-y)					\
		-shared -Bsymbolic -nostdlib -znocombreloc	\
		--start-group $(barebox-common)			\
		--end-group					\
		$(filter-out $(barebox-lds) $(barebox-common) FORCE ,$^)

quiet_cmd_efi_image = EFI-IMG $@
      cmd_efi_image = $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
		      -j .dynsym -j .rel -j .rela -j .reloc -j __barebox_initcalls \
		      -j __barebox_exitcalls -j __barebox_cmd -j .barebox_magicvar \
		      -j .bbenv.* --target=$(TARGET) $< $@

KBUILD_BINARY := barebox

LDFLAGS := -m elf_$(UTS_MACHINE) --no-undefined

barebox.efi: $(KBUILD_BINARY) FORCE
	$(call if_changed,efi_image)

KBUILD_IMAGE := barebox.efi

common-y += arch/efi/efi/ arch/efi/lib/