mb/google/brya/var/orisa: Update Type C DisplayPort HPD Configuration
[coreboot2.git] / payloads / linuxcheck / Makefile
blob838c90df0c989e459284a607a16d3e736d6bce89
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)
8 TARGETARCH = i386
9 endif
11 all: linuxcheck.elf
13 $(LIBPAYLOAD_DIR):
14 $(MAKE) -C ../libpayload $(LPOPTS) defconfig
15 $(MAKE) -C ../libpayload $(LPOPTS)
16 $(MAKE) -C ../libpayload $(LPOPTS) install
18 ifneq ($(strip $(wildcard libpayload)),)
19 include $(XCOMPILE)
20 LPGCC = CC="$(GCC_CC_x86_32)" "$(LIBPAYLOAD_DIR)/bin/lpgcc"
21 %.elf: %.c Makefile
22 $(LPGCC) $(CFLAGS) -o $*.elf $*.c $(TARGETARCH).c
23 else
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)
28 $(MAKE) all
29 endif
31 clean:
32 rm -f linuxcheck.elf
34 distclean: clean
35 rm -rf build libpayload .config .config.old
37 .PHONY: all clean distclean