summaryrefslogtreecommitdiff
path: root/payloads/nvramcui/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/nvramcui/Makefile')
-rw-r--r--payloads/nvramcui/Makefile37
1 files changed, 7 insertions, 30 deletions
diff --git a/payloads/nvramcui/Makefile b/payloads/nvramcui/Makefile
index ebc48de8b3..cfe279bb54 100644
--- a/payloads/nvramcui/Makefile
+++ b/payloads/nvramcui/Makefile
@@ -1,36 +1,13 @@
unexport $(COREBOOT_EXPORTS)
-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"
-CFLAGS += -Wall -Wvla -Werror -Os -ffreestanding -nostdinc -nostdlib
+ARCH = x86_32
+OBJS = $(obj)/nvramcui.o
+TARGET = $(obj)/nvramcui.elf
-all: nvramcui.elf
+all: real-all
-$(LIBPAYLOAD_DIR):
- $(MAKE) -C ../libpayload $(LPOPTS) defconfig
- $(MAKE) -C ../libpayload $(LPOPTS)
- $(MAKE) -C ../libpayload $(LPOPTS) install
+include ../libpayload/Makefile.payload
-ifneq ($(strip $(wildcard libpayload)),)
-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
+real-all: $(TARGET)
-clean:
- rm -rf build libpayload nvramcui.elf
-
-distclean: clean
- rm -rf .config .config.old
-
-.PHONY: all clean distclean
+.PHONY: all real-all