nvramcui: Unexport COREBOOT_EXPORTS
[coreboot.git] / payloads / nvramcui / Makefile
blobebc48de8b390cc0fb10cd59bcdfd4fcef872136f
1 unexport $(COREBOOT_EXPORTS)
3 LIBPAYLOAD_DIR=$(CURDIR)/libpayload
4 XCOMPILE=$(LIBPAYLOAD_DIR)/libpayload.xcompile
5 # build libpayload and put .config file in $(CURDIR) instead of ../libpayload
6 # to avoid pollute the libpayload source directory and possible conflicts
7 LPOPTS=obj="$(CURDIR)/build" DESTDIR="$(CURDIR)" DOTCONFIG="$(CURDIR)/.config"
8 CFLAGS += -Wall -Wvla -Werror -Os -ffreestanding -nostdinc -nostdlib
10 all: nvramcui.elf
12 $(LIBPAYLOAD_DIR):
13 $(MAKE) -C ../libpayload $(LPOPTS) defconfig
14 $(MAKE) -C ../libpayload $(LPOPTS)
15 $(MAKE) -C ../libpayload $(LPOPTS) install
17 ifneq ($(strip $(wildcard libpayload)),)
18 include $(XCOMPILE)
19 LPGCC = CC="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc"
20 %.elf: %.c Makefile
21 $(LPGCC) $(CFLAGS) -o $*.elf $*.c
22 else
23 # If libpayload is not found, first build libpayload,
24 # then do the make, this time it'll find libpayload
25 # and generate the nvramcui.elf target
26 %.elf: $(LIBPAYLOAD_DIR)
27 $(MAKE) all
28 endif
30 clean:
31 rm -rf build libpayload nvramcui.elf
33 distclean: clean
34 rm -rf .config .config.old
36 .PHONY: all clean distclean