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
-Wvla
-Werror
-Os
-ffreestanding
-nostdinc
-nostdlib
7 ifeq ($(CONFIG_ARCH_X86
),y
)
14 $(MAKE
) -C ..
/libpayload
$(LPOPTS
) defconfig
15 $(MAKE
) -C ..
/libpayload
$(LPOPTS
)
16 $(MAKE
) -C ..
/libpayload
$(LPOPTS
) install
18 ifneq ($(strip $(wildcard libpayload
)),)
20 LPGCC
= CC
="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc"
22 $(LPGCC
) $(CFLAGS
) -o
$*.elf
$*.c
$(TARGETARCH
).c
24 # If libpayload is not found, first build libpayload,
25 # then do the make, this time it'll find libpayload
26 # and generate the linuxcheck.elf target
27 %.elf
: $(LIBPAYLOAD_DIR
)
35 rm -rf build libpayload .config .config.old
37 .PHONY
: all clean distclean