summaryrefslogtreecommitdiff
path: root/payloads/nvramcui
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/nvramcui')
-rw-r--r--payloads/nvramcui/Makefile14
1 files changed, 8 insertions, 6 deletions
diff --git a/payloads/nvramcui/Makefile b/payloads/nvramcui/Makefile
index 0f27ff88ed..c6a9cd0cf4 100644
--- a/payloads/nvramcui/Makefile
+++ b/payloads/nvramcui/Makefile
@@ -3,10 +3,11 @@ 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 -Werror -Os -ffreestanding -nostdinc -nostdlib
all: nvramcui.elf
-libpayload:
+$(LIBPAYLOAD_DIR):
$(MAKE) -C ../libpayload $(LPOPTS) defconfig
$(MAKE) -C ../libpayload $(LPOPTS)
$(MAKE) -C ../libpayload $(LPOPTS) install
@@ -14,19 +15,20 @@ libpayload:
ifneq ($(strip $(wildcard libpayload)),)
include $(XCOMPILE)
LPGCC = CC="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc"
-%.elf: %.c
- $(LPGCC) -o $*.elf $*.c
+%.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
+%.elf: $(LIBPAYLOAD_DIR)
$(MAKE) all
endif
-.PHONY:
clean:
rm -f nvramcui.elf
distclean: clean
- rm -rf build libpayload .config
+ rm -rf build libpayload .config .config.old
+
+.PHONY: all clean distclean