xref: /openbmc/linux/arch/loongarch/boot/Makefile (revision c5d5cba7)
1fa96b57cSHuacai Chen#
2fa96b57cSHuacai Chen# arch/loongarch/boot/Makefile
3fa96b57cSHuacai Chen#
4fa96b57cSHuacai Chen# Copyright (C) 2020-2022 Loongson Technology Corporation Limited
5fa96b57cSHuacai Chen#
6fa96b57cSHuacai Chen
7fa96b57cSHuacai Chendrop-sections := .comment .note .options .note.gnu.build-id
8fa96b57cSHuacai Chenstrip-flags   := $(addprefix --remove-section=,$(drop-sections)) -S
9fa96b57cSHuacai ChenOBJCOPYFLAGS_vmlinux.efi := -O binary $(strip-flags)
10fa96b57cSHuacai Chen
11fa96b57cSHuacai Chenquiet_cmd_strip = STRIP	  $@
12fa96b57cSHuacai Chen      cmd_strip = $(STRIP) -s -o $@ $<
13fa96b57cSHuacai Chen
14ead384d9SHuacai Chentargets := vmlinux.elf
15ead384d9SHuacai Chen$(obj)/vmlinux.elf: vmlinux FORCE
16fa96b57cSHuacai Chen	$(call if_changed,strip)
17ead384d9SHuacai Chen
18ead384d9SHuacai Chentargets += vmlinux.efi
19ead384d9SHuacai Chen$(obj)/vmlinux.efi: vmlinux FORCE
20ead384d9SHuacai Chen	$(call if_changed,objcopy)
21*c5d5cba7SArd Biesheuvel
22*c5d5cba7SArd BiesheuvelEFI_ZBOOT_PAYLOAD      := vmlinux.efi
23*c5d5cba7SArd BiesheuvelEFI_ZBOOT_BFD_TARGET   := elf64-loongarch
24*c5d5cba7SArd BiesheuvelEFI_ZBOOT_MACH_TYPE    := LOONGARCH64
25*c5d5cba7SArd Biesheuvel
26*c5d5cba7SArd Biesheuvelinclude $(srctree)/drivers/firmware/efi/libstub/Makefile.zboot
27