nvramcui: Use libpayload's new `Makefile.payload`
Change-Id: I34bf659c1a069ccc27ca613bbf86780d4da49259 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47636 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
552163ef79
commit
dd11bf9fe3
|
@ -10,7 +10,7 @@ img/coreinfo-type := payload
|
||||||
img/coreinfo-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
|
img/coreinfo-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
|
||||||
|
|
||||||
cbfs-files-$(CONFIG_NVRAMCUI_SECONDARY_PAYLOAD) += img/nvramcui
|
cbfs-files-$(CONFIG_NVRAMCUI_SECONDARY_PAYLOAD) += img/nvramcui
|
||||||
img/nvramcui-file := payloads/nvramcui/nvramcui.elf
|
img/nvramcui-file := payloads/nvramcui/build/nvramcui.elf
|
||||||
img/nvramcui-type := payload
|
img/nvramcui-type := payload
|
||||||
img/nvramcui-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
|
img/nvramcui-compression := $(CBFS_SECONDARY_PAYLOAD_COMPRESS_FLAG)
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ payloads/external/Yabits \
|
||||||
payloads/coreinfo/build/coreinfo.elf coreinfo:
|
payloads/coreinfo/build/coreinfo.elf coreinfo:
|
||||||
$(MAKE) -C payloads/coreinfo defaultbuild
|
$(MAKE) -C payloads/coreinfo defaultbuild
|
||||||
|
|
||||||
payloads/nvramcui/nvramcui.elf nvramcui:
|
payloads/nvramcui/build/nvramcui.elf nvramcui:
|
||||||
$(MAKE) -C payloads/nvramcui
|
$(MAKE) -C payloads/nvramcui
|
||||||
|
|
||||||
clean-payloads:
|
clean-payloads:
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
build
|
|
||||||
libpayload
|
libpayload
|
||||||
|
.lp.config*
|
||||||
|
|
|
@ -1,36 +1,13 @@
|
||||||
unexport $(COREBOOT_EXPORTS)
|
unexport $(COREBOOT_EXPORTS)
|
||||||
|
|
||||||
LIBPAYLOAD_DIR=$(CURDIR)/libpayload
|
ARCH = x86_32
|
||||||
XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile
|
OBJS = $(obj)/nvramcui.o
|
||||||
# build libpayload and put .config file in $(CURDIR) instead of ../libpayload
|
TARGET = $(obj)/nvramcui.elf
|
||||||
# to avoid pollute the libpayload source directory and possible conflicts
|
|
||||||
LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config"
|
|
||||||
CFLAGS += -Wall -Wvla -Werror -Os -ffreestanding -nostdinc -nostdlib
|
|
||||||
|
|
||||||
all: nvramcui.elf
|
all: real-all
|
||||||
|
|
||||||
$(LIBPAYLOAD_DIR):
|
include ../libpayload/Makefile.payload
|
||||||
$(MAKE) -C ../libpayload $(LPOPTS) defconfig
|
|
||||||
$(MAKE) -C ../libpayload $(LPOPTS)
|
|
||||||
$(MAKE) -C ../libpayload $(LPOPTS) install
|
|
||||||
|
|
||||||
ifneq ($(strip $(wildcard libpayload)),)
|
real-all: $(TARGET)
|
||||||
include $(XCOMPILE)
|
|
||||||
LPGCC = CC="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc"
|
|
||||||
%.elf: %.c Makefile
|
|
||||||
$(LPGCC) $(CFLAGS) -o $*.elf $*.c
|
|
||||||
else
|
|
||||||
# If libpayload is not found, first build libpayload,
|
|
||||||
# then do the make, this time it'll find libpayload
|
|
||||||
# and generate the nvramcui.elf target
|
|
||||||
%.elf: $(LIBPAYLOAD_DIR)
|
|
||||||
$(MAKE) all
|
|
||||||
endif
|
|
||||||
|
|
||||||
clean:
|
.PHONY: all real-all
|
||||||
rm -rf build libpayload nvramcui.elf
|
|
||||||
|
|
||||||
distclean: clean
|
|
||||||
rm -rf .config .config.old
|
|
||||||
|
|
||||||
.PHONY: all clean distclean
|
|
||||||
|
|
Loading…
Reference in New Issue