nvramcui: Update Makefile

* use crossgcc to build nvramcui
* build libpayload dependency

Change-Id: Ife3054aeb03b4da0568ad47f96c633460d6c07ae
Signed-off-by: Iru Cai <mytbk920423@gmail.com>
Reviewed-on: https://review.coreboot.org/14377
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Iru Cai 2016-04-15 13:42:11 +08:00 committed by Martin Roth
parent ae29635876
commit e44b407b00
1 changed files with 22 additions and 2 deletions

View File

@ -1,12 +1,32 @@
LPGCC = ../libpayload/install/libpayload/bin/lpgcc LIBPAYLOAD_DIR=$(CURDIR)/libpayload
XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile
# build libpayload and put .config file in $(CURDIR) instead of ../libpayload
# to avoid pollute the libpayload source directory and possible conflicts
LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config"
all: nvramcui.elf all: nvramcui.elf
%.elf: libpayload:
$(MAKE) -C ../libpayload $(LPOPTS) defconfig
$(MAKE) -C ../libpayload $(LPOPTS)
$(MAKE) -C ../libpayload $(LPOPTS) install
ifneq ($(strip $(wildcard libpayload)),)
include $(XCOMPILE)
LPGCC = CC="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc"
%.elf: %.c
$(LPGCC) -o $*.elf $*.c $(LPGCC) -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
$(MAKE) all
endif
.PHONY: .PHONY:
clean: clean:
rm -f nvramcui.elf rm -f nvramcui.elf
distclean: clean distclean: clean
rm -rf build libpayload .config