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