coreboot-kgpe-d16/payloads/external/LinuxBoot/Makefile
Patrick Rudolph 599d46bbf4 payloads/external/LinuxBoot: Fix build
Fix regression introduced in I25e757108e0dd473969fe5a192ad0733f1fe6286
"payloads/external/LinuxBoot: Clean up".

Add creation of the build folder as necessary dependency.

Change-Id: Ie76c914f6a705de0c275a05b5af82ac21243d522
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/77202
Reviewed-by: Marvin Drees <marvin.drees@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Maximilian Brune <maximilian.brune@9elements.com>
2023-08-17 15:07:34 +00:00

57 lines
1.4 KiB
Makefile

## SPDX-License-Identifier: GPL-2.0-only
unexport $(COREBOOT_EXPORTS)
DTC ?= dtc
LINUX_ARCH-$(CONFIG_LINUXBOOT_X86_64) = x86_64
LINUX_ARCH-$(CONFIG_LINUXBOOT_X86) = i386
LINUX_ARCH-$(CONFIG_LINUXBOOT_ARM64) = arm64
LINUX_ARCH-$(CONFIG_LINUXBOOT_RISCV_RV32) = riscv
LINUX_ARCH-$(CONFIG_LINUXBOOT_RISCV_RV64) = riscv
build/Image: $(CONFIG_LINUXBOOT_KERNEL_PATH) | build
ln -s -r $< $@
ifeq ($(CONFIG_LINUXBOOT_COMPILE_KERNEL),y)
include targets/linux.mk
endif
ifeq ($(CONFIG_LINUXBOOT_UROOT),y)
include targets/u-root.mk
endif
build/initramfs: $(CONFIG_LINUXBOOT_INITRAMFS_PATH) | build
ifeq ($(CONFIG_LINUXBOOT_INITRAMFS_COMPRESSION_XZ),y)
xz --keep --force --check=crc32 --lzma2=dict=1MiB $(CONFIG_LINUXBOOT_INITRAMFS_PATH)
endif
cp $(CONFIG_LINUXBOOT_INITRAMFS_PATH)$(CONFIG_LINUXBOOT_INITRAMFS_SUFFIX) $@
ifeq ($(CONFIG_LINUXBOOT_KERNEL_BZIMAGE),y)
build/bzImage: $(kernel_dir)/arch/x86/boot/bzImage | build
cp $< $@
else ifeq ($(CONFIG_LINUXBOOT_KERNEL_UIMAGE),y)
build/target.dtb: $(CONFIG_LINUXBOOT_DTS_FILE)
$(DTC) -o $@ $<
build/uImage: build/vmlinux.bin.lzma build/initramfs build/target.dtb $(LINUX_ARCH-y)/kernel_fdt_lzma.its | build
mkimage -f $(LINUX_ARCH-y)/kernel_fdt_lzma.its $@
endif # CONFIG_LINUXBOOT_KERNEL_BZIMAGE
build:
mkdir build
clean:
rm -rf build/kernel*
rm -f build/u-root
rm -f build/initramfs*
rm -f build/bzImage
distclean:
rm -rf build
.PHONY: linuxboot clean distclean