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
11 $(MAKE
) -C ..
/libpayload
$(LPOPTS
) defconfig
12 $(MAKE
) -C ..
/libpayload
$(LPOPTS
)
13 $(MAKE
) -C ..
/libpayload
$(LPOPTS
) install
15 ifneq ($(strip $(wildcard libpayload
)),)
17 LPGCC
= CC
="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc"
19 $(LPGCC
) $(CFLAGS
) -o
$*.elf
$*.c
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
)
32 rm -rf build libpayload .config .config.old
34 .PHONY
: all clean distclean