2016-04-15 07:42:11 +02:00
|
|
|
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"
|
2016-01-25 09:20:24 +01:00
|
|
|
|
|
|
|
all: nvramcui.elf
|
|
|
|
|
2016-04-15 07:42:11 +02:00
|
|
|
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
|
2016-01-25 09:20:24 +01:00
|
|
|
$(LPGCC) -o $*.elf $*.c
|
2016-04-15 07:42:11 +02:00
|
|
|
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
|
2016-01-25 09:20:24 +01:00
|
|
|
|
|
|
|
.PHONY:
|
|
|
|
clean:
|
|
|
|
rm -f nvramcui.elf
|
2016-03-08 00:40:14 +01:00
|
|
|
|
|
|
|
distclean: clean
|
2016-04-15 07:42:11 +02:00
|
|
|
rm -rf build libpayload .config
|