1 unexport $(COREBOOT_EXPORTS
)
3 LIBPAYLOAD_DIR
=$(CURDIR
)/libpayload
4 XCOMPILE
=$(LIBPAYLOAD_DIR
)/libpayload.xcompile
5 # build libpayload and put .config file in $(CURDIR) instead of ../libpayload
6 # to avoid pollute the libpayload source directory and possible conflicts
7 LPOPTS
=obj
="$(CURDIR)/build" DESTDIR
="$(CURDIR)" DOTCONFIG
="$(CURDIR)/.config"
8 CFLAGS
+= -Wall
-Wvla
-Werror
-Os
-ffreestanding
-nostdinc
-nostdlib
13 $(MAKE
) -C ..
/libpayload
$(LPOPTS
) defconfig
14 $(MAKE
) -C ..
/libpayload
$(LPOPTS
)
15 $(MAKE
) -C ..
/libpayload
$(LPOPTS
) install
17 ifneq ($(strip $(wildcard libpayload
)),)
19 LPGCC
= CC
="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc"
21 $(LPGCC
) $(CFLAGS
) -o
$*.elf
$*.c
23 # If libpayload is not found, first build libpayload,
24 # then do the make, this time it'll find libpayload
25 # and generate the nvramcui.elf target
26 %.elf
: $(LIBPAYLOAD_DIR
)
31 rm -rf build libpayload nvramcui.elf
34 rm -rf .config .config.old
36 .PHONY
: all clean distclean