From 354389365bac2c972749b9fc4fd21c6cd953cb59 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Thu, 18 Jan 2024 16:33:55 -0700 Subject: payloads: Rename Makefiles from .inc to .mk The .inc suffix is confusing to various tools as it's not specific to Makefiles. This means that editors don't recognize the files, and don't open them with highlighting and any other specific editor functionality. This issue is also seen in the release notes generation script where Makefiles get renamed before running cloc. Signed-off-by: Martin Roth Change-Id: Ie7038712de8cc646632d5e7d29550e3260bf2c62 Reviewed-on: https://review.coreboot.org/c/coreboot/+/80103 Reviewed-by: Felix Singer Reviewed-by: Maximilian Brune Tested-by: build bot (Jenkins) --- payloads/libpayload/Makefile | 12 +- payloads/libpayload/Makefile.inc | 191 --------------- payloads/libpayload/Makefile.mk | 191 +++++++++++++++ payloads/libpayload/arch/arm/Makefile.inc | 50 ---- payloads/libpayload/arch/arm/Makefile.mk | 50 ++++ payloads/libpayload/arch/arm64/Makefile.inc | 47 ---- payloads/libpayload/arch/arm64/Makefile.mk | 47 ++++ payloads/libpayload/arch/mock/Makefile.inc | 9 - payloads/libpayload/arch/mock/Makefile.mk | 9 + payloads/libpayload/arch/x86/Makefile.inc | 52 ---- payloads/libpayload/arch/x86/Makefile.mk | 52 ++++ payloads/libpayload/crypto/Makefile.inc | 29 --- payloads/libpayload/crypto/Makefile.mk | 29 +++ payloads/libpayload/curses/Makefile.inc | 167 ------------- payloads/libpayload/curses/Makefile.mk | 167 +++++++++++++ payloads/libpayload/drivers/Makefile.inc | 129 ---------- payloads/libpayload/drivers/Makefile.mk | 129 ++++++++++ payloads/libpayload/gdb/Makefile.inc | 16 -- payloads/libpayload/gdb/Makefile.mk | 16 ++ payloads/libpayload/libc/Makefile.inc | 50 ---- payloads/libpayload/libc/Makefile.mk | 50 ++++ payloads/libpayload/libcbfs/Makefile.inc | 36 --- payloads/libpayload/libcbfs/Makefile.mk | 36 +++ payloads/libpayload/liblz4/Makefile.inc | 28 --- payloads/libpayload/liblz4/Makefile.mk | 28 +++ payloads/libpayload/liblzma/Makefile.inc | 29 --- payloads/libpayload/liblzma/Makefile.mk | 29 +++ payloads/libpayload/libpci/Makefile.inc | 29 --- payloads/libpayload/libpci/Makefile.mk | 29 +++ payloads/libpayload/tests/Makefile.inc | 321 ------------------------- payloads/libpayload/tests/Makefile.mk | 321 +++++++++++++++++++++++++ payloads/libpayload/tests/drivers/Makefile.inc | 8 - payloads/libpayload/tests/drivers/Makefile.mk | 8 + payloads/libpayload/tests/libc/Makefile.inc | 3 - payloads/libpayload/tests/libc/Makefile.mk | 3 + payloads/libpayload/tests/libcbfs/Makefile.inc | 33 --- payloads/libpayload/tests/libcbfs/Makefile.mk | 33 +++ payloads/libpayload/vboot/Makefile.inc | 56 ----- payloads/libpayload/vboot/Makefile.mk | 56 +++++ 39 files changed, 1289 insertions(+), 1289 deletions(-) delete mode 100644 payloads/libpayload/Makefile.inc create mode 100644 payloads/libpayload/Makefile.mk delete mode 100644 payloads/libpayload/arch/arm/Makefile.inc create mode 100644 payloads/libpayload/arch/arm/Makefile.mk delete mode 100644 payloads/libpayload/arch/arm64/Makefile.inc create mode 100644 payloads/libpayload/arch/arm64/Makefile.mk delete mode 100644 payloads/libpayload/arch/mock/Makefile.inc create mode 100644 payloads/libpayload/arch/mock/Makefile.mk delete mode 100644 payloads/libpayload/arch/x86/Makefile.inc create mode 100644 payloads/libpayload/arch/x86/Makefile.mk delete mode 100644 payloads/libpayload/crypto/Makefile.inc create mode 100644 payloads/libpayload/crypto/Makefile.mk delete mode 100644 payloads/libpayload/curses/Makefile.inc create mode 100644 payloads/libpayload/curses/Makefile.mk delete mode 100644 payloads/libpayload/drivers/Makefile.inc create mode 100644 payloads/libpayload/drivers/Makefile.mk delete mode 100644 payloads/libpayload/gdb/Makefile.inc create mode 100644 payloads/libpayload/gdb/Makefile.mk delete mode 100644 payloads/libpayload/libc/Makefile.inc create mode 100644 payloads/libpayload/libc/Makefile.mk delete mode 100644 payloads/libpayload/libcbfs/Makefile.inc create mode 100644 payloads/libpayload/libcbfs/Makefile.mk delete mode 100644 payloads/libpayload/liblz4/Makefile.inc create mode 100644 payloads/libpayload/liblz4/Makefile.mk delete mode 100644 payloads/libpayload/liblzma/Makefile.inc create mode 100644 payloads/libpayload/liblzma/Makefile.mk delete mode 100644 payloads/libpayload/libpci/Makefile.inc create mode 100644 payloads/libpayload/libpci/Makefile.mk delete mode 100644 payloads/libpayload/tests/Makefile.inc create mode 100644 payloads/libpayload/tests/Makefile.mk delete mode 100644 payloads/libpayload/tests/drivers/Makefile.inc create mode 100644 payloads/libpayload/tests/drivers/Makefile.mk delete mode 100644 payloads/libpayload/tests/libc/Makefile.inc create mode 100644 payloads/libpayload/tests/libc/Makefile.mk delete mode 100644 payloads/libpayload/tests/libcbfs/Makefile.inc create mode 100644 payloads/libpayload/tests/libcbfs/Makefile.mk delete mode 100644 payloads/libpayload/vboot/Makefile.inc create mode 100644 payloads/libpayload/vboot/Makefile.mk (limited to 'payloads/libpayload') diff --git a/payloads/libpayload/Makefile b/payloads/libpayload/Makefile index 212e67ea79..71d60bce9b 100644 --- a/payloads/libpayload/Makefile +++ b/payloads/libpayload/Makefile @@ -56,7 +56,7 @@ export KCONFIG_NEGATIVES := 1 export KBUILD_KCONFIG := Kconfig export CONFIG_ := CONFIG_LP_ -# directory containing the toplevel Makefile.inc +# directory containing the toplevel Makefile.mk TOPLEVEL := . CONFIG_LP_SHELL := sh @@ -159,8 +159,8 @@ $(xcompile): $(top)/../../util/xcompile/xcompile \mv -f $@.tmp $@ 2> /dev/null ifeq ($(NOCOMPILE),1) -include $(TOPLEVEL)/Makefile.inc -include $(TOPLEVEL)/tests/Makefile.inc +include $(TOPLEVEL)/Makefile.mk +include $(TOPLEVEL)/tests/Makefile.mk real-all: config else @@ -285,7 +285,7 @@ add-special-class= \ $(eval $(1):=) \ $(eval special-classes+=$(1)) -# Clean -y variables, include Makefile.inc +# Clean -y variables, include Makefile.mk # Add paths to files in X-y to X-srcs # Add subdirs-y to subdirs includemakefiles= \ @@ -308,7 +308,7 @@ evaluate_subdirs= \ $(eval cursubdirs:=$(subdirs)) \ $(eval subdirs:=) \ $(foreach dir,$(cursubdirs), \ - $(eval $(call includemakefiles,$(dir)/Makefile.inc))) \ + $(eval $(call includemakefiles,$(dir)/Makefile.mk))) \ $(if $(subdirs),$(eval $(call evaluate_subdirs))) # collect all object files eligible for building or run unit-tests @@ -316,7 +316,7 @@ ifneq ($(UNIT_TEST),1) subdirs:=$(TOPLEVEL) $(eval $(call evaluate_subdirs)) else -include $(TOPLEVEL)/tests/Makefile.inc +include $(TOPLEVEL)/tests/Makefile.mk endif # Converts one or more source file paths to the corresponding build/ paths. diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc deleted file mode 100644 index 61f932f1d6..0000000000 --- a/payloads/libpayload/Makefile.inc +++ /dev/null @@ -1,191 +0,0 @@ -## -## -## Copyright (C) 2008 Advanced Micro Devices, Inc. -## Copyright (C) 2008 Uwe Hermann -## Copyright (C) 2011 secunet Security Networks AG -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -ifneq ($(NOCOMPILE),1) -GIT:=$(shell git -C "$(top)" rev-parse --git-dir 1>/dev/null 2>&1 \ - && command -v git) -else -GIT:= -endif - -export KERNELVERSION := 0.2.0 - -ARCHDIR-$(CONFIG_LP_ARCH_ARM) := arm -ARCHDIR-$(CONFIG_LP_ARCH_ARM64) := arm64 -ARCHDIR-$(CONFIG_LP_ARCH_X86) := x86 -ARCHDIR-$(CONFIG_LP_ARCH_MOCK) := mock -DESTDIR ?= install - -real-target: lib - -classes-$(CONFIG_LP_PCI) += libpci -classes-$(CONFIG_LP_LIBC) += libc -classes-$(CONFIG_LP_CURSES) += libcurses -classes-$(CONFIG_LP_PDCURSES) += libmenu libform libpanel -classes-$(CONFIG_LP_CBFS) += libcbfs -classes-$(CONFIG_LP_LZMA) += liblzma -classes-$(CONFIG_LP_LZ4) += liblz4 -classes-$(CONFIG_LP_REMOTEGDB) += libgdb -classes-$(CONFIG_LP_VBOOT_LIB) += vboot_fw -classes-$(CONFIG_LP_VBOOT_LIB) += tlcl -libraries := $(classes-y) -classes-y += head.o - -subdirs-y := arch/$(ARCHDIR-y) -subdirs-y += crypto libc drivers libpci gdb -subdirs-$(CONFIG_LP_CURSES) += curses -subdirs-$(CONFIG_LP_CBFS) += libcbfs -subdirs-$(CONFIG_LP_LZMA) += liblzma -subdirs-$(CONFIG_LP_LZ4) += liblz4 -subdirs-$(CONFIG_LP_VBOOT_LIB) += vboot - -INCLUDES := -Iinclude -Iinclude/$(ARCHDIR-y) -I$(obj) -INCLUDES += -include include/kconfig.h -INCLUDES += -include $(coreboottop)/src/commonlib/bsd/include/commonlib/bsd/compiler.h -INCLUDES += -I$(coreboottop)/src/commonlib/bsd/include -INCLUDES += -I$(VBOOT_SOURCE)/firmware/include - -CFLAGS += $(INCLUDES) -Os -pipe -nostdinc -ggdb3 -CFLAGS += -nostdlib -fno-builtin -ffreestanding -fomit-frame-pointer -CFLAGS += -ffunction-sections -fdata-sections -CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wvla -CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wimplicit-fallthrough -CFLAGS += -Wstrict-aliasing -Wshadow -Werror - -ifeq ($(CONFIG_LP_LTO),y) -CFLAGS += -flto -endif - -# Some of the commonlib cbfs headers include vboot headers, so initialize the -# submodule in case we are building a payload outside the main coreboot build -forgetthis:=$(if $(GIT),$(shell git submodule update --init ../../3rdparty/vboot $(quiet_errors))) - -$(obj)/libpayload.config: $(DOTCONFIG) - cp $< $@ - -$(obj)/libpayload-config.h: $(KCONFIG_AUTOHEADER) $(obj)/libpayload.config - cmp $@ $< 2>/dev/null || cp $< $@ - -library-targets = $(addsuffix .a,$(addprefix $(obj)/,$(libraries))) $(obj)/libpayload.a -lib: $$(library-targets) $(obj)/head.o - -extract_nth=$(word $(1), $(subst |, ,$(2))) - -####################################################################### -# Add handler for special include files -$(call add-special-class,includes) -includes-handler= \ - $(if $(wildcard $(1)$(call extract_nth,1,$(2))), \ - $(eval includes += $(1)$(2))) - -$(obj)/libpayload.a: $(foreach class,$(libraries),$$($(class)-objs)) - printf " AR $(subst $(CURDIR)/,,$(@))\n" - printf "create $@\n$(foreach objc,$(filter-out %.a,$^),addmod $(objc)\n)$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M - -$(obj)/%.a: $$(%-objs) - printf " AR $(subst $(CURDIR)/,,$(@))\n" - printf "create $@\n$(foreach objc,$(filter-out %.a,$^),addmod $(objc)\n)$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M - -$(obj)/head.o: $(obj)/arch/$(ARCHDIR-y)/head.head.o.o - printf " CP $(subst $(CURDIR)/,,$(@))\n" - cp $^ $@ - -install: real-target - printf " INSTALL $(DESTDIR)/libpayload/lib\n" - install -m 755 -d $(DESTDIR)/libpayload/lib - install -m 644 $(library-targets) $(DESTDIR)/libpayload/lib/ - install -m 644 arch/$(ARCHDIR-y)/libpayload.ldscript $(DESTDIR)/libpayload/lib/ - install -m 755 -d $(DESTDIR)/libpayload/lib/$(ARCHDIR-y) - install -m 644 $(obj)/head.o $(DESTDIR)/libpayload/lib/$(ARCHDIR-y) - printf " INSTALL $(DESTDIR)/libpayload/include\n" - install -m 755 -d $(DESTDIR)/libpayload/include - find include -type d -exec install -m755 -d $(DESTDIR)/libpayload/{} \; - find include -type f -exec install -m644 {} $(DESTDIR)/libpayload/{} \; - cd $(coreboottop)/src/commonlib/bsd && find include -type d -exec install -m755 -d $(abspath $(DESTDIR))/libpayload/{} \; - cd $(coreboottop)/src/commonlib/bsd && find include -type f -exec install -m644 {} $(abspath $(DESTDIR))/libpayload/{} \; - install -m 644 $(obj)/libpayload-config.h $(DESTDIR)/libpayload/include - $(foreach item,$(includes), \ - install -m 755 -d $(DESTDIR)/libpayload/include/$(call extract_nth,2,$(item)); \ - install -m 644 $(call extract_nth,1,$(item)) $(DESTDIR)/libpayload/include/$(call extract_nth,2,$(item)); ) - printf " INSTALL $(DESTDIR)/libpayload/vboot\n" - install -m 755 -d $(DESTDIR)/libpayload/vboot - for file in `find $(VBOOT_SOURCE)/firmware/include \ - $(VBOOT_SOURCE)/firmware/2lib/include \ - -iname '*.h' -type f \ - | sed 's,$(VBOOT_SOURCE)/firmware/,,'`; do \ - install -m 755 -d $(DESTDIR)/libpayload/vboot/$$(dirname $$file); \ - install -m 644 $(VBOOT_SOURCE)/firmware/$$file $(DESTDIR)/libpayload/vboot/$$file ; \ - done - printf " INSTALL $(DESTDIR)/libpayload/bin\n" - install -m 755 -d $(DESTDIR)/libpayload/bin - install -m 755 bin/lpgcc $(DESTDIR)/libpayload/bin - install -m 755 bin/lpas $(DESTDIR)/libpayload/bin - install -m 644 bin/lp.functions $(DESTDIR)/libpayload/bin - install -m 644 $(DOTCONFIG) $(DESTDIR)/libpayload/libpayload.config - install -m 755 $(xcompile) $(DESTDIR)/libpayload/libpayload.xcompile - -clean-for-update-target: - rm -f $(addsuffix .a,$(addprefix $(obj)/,$(libraries))) $(obj)/libpayload.a - -clean-target: -prepare: - -junit.xml: - echo '' > $@.tmp - for i in $(filter-out %.old %.unit-tests,$(wildcard configs/*)); do \ - $(MAKE) clean; \ - echo "Building libpayload for $$i"; \ - cp "$$i" junit_config; \ - $(MAKE) olddefconfig DOTCONFIG=junit_config V=$(V) Q=$(Q) 2>/dev/null >/dev/null; \ - echo "" >> $@.tmp; \ - $(MAKE) V=$(V) Q=$(Q) CONFIG_LP_CCACHE=$(CONFIG_LP_CCACHE) DOTCONFIG=junit_config >> $@.tmp.2 2>&1 && type="system-out" || type="failure"; \ - if [ $$type = "failure" ]; then \ - echo "" >> $@.tmp; \ - else \ - echo "<$$type>" >> $@.tmp; \ - fi; \ - echo '> $@.tmp; \ - cat $@.tmp.2 >> $@.tmp; \ - echo "]]>" >>$@.tmp; \ - rm -f $@.tmp.2; \ - echo "" >> $@.tmp; \ - done - echo "" >> $@.tmp - echo "libpayload build complete, test results in $@" - mv $@.tmp $@ - -test-configs: - for config in $(filter-out %.old %.unit-tests,$(wildcard configs/*)); do \ - $(MAKE) clean; \ - cp "$$config" test_config; \ - echo "*** Making libpayload config $$config ***"; \ - $(MAKE) olddefconfig DOTCONFIG=test_config V=$(V) Q=$(Q) ; \ - $(MAKE) V=$(V) Q=$(Q) CONFIG_LP_CCACHE=$(CONFIG_LP_CCACHE) DOTCONFIG=test_config; \ - done diff --git a/payloads/libpayload/Makefile.mk b/payloads/libpayload/Makefile.mk new file mode 100644 index 0000000000..61f932f1d6 --- /dev/null +++ b/payloads/libpayload/Makefile.mk @@ -0,0 +1,191 @@ +## +## +## Copyright (C) 2008 Advanced Micro Devices, Inc. +## Copyright (C) 2008 Uwe Hermann +## Copyright (C) 2011 secunet Security Networks AG +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +ifneq ($(NOCOMPILE),1) +GIT:=$(shell git -C "$(top)" rev-parse --git-dir 1>/dev/null 2>&1 \ + && command -v git) +else +GIT:= +endif + +export KERNELVERSION := 0.2.0 + +ARCHDIR-$(CONFIG_LP_ARCH_ARM) := arm +ARCHDIR-$(CONFIG_LP_ARCH_ARM64) := arm64 +ARCHDIR-$(CONFIG_LP_ARCH_X86) := x86 +ARCHDIR-$(CONFIG_LP_ARCH_MOCK) := mock +DESTDIR ?= install + +real-target: lib + +classes-$(CONFIG_LP_PCI) += libpci +classes-$(CONFIG_LP_LIBC) += libc +classes-$(CONFIG_LP_CURSES) += libcurses +classes-$(CONFIG_LP_PDCURSES) += libmenu libform libpanel +classes-$(CONFIG_LP_CBFS) += libcbfs +classes-$(CONFIG_LP_LZMA) += liblzma +classes-$(CONFIG_LP_LZ4) += liblz4 +classes-$(CONFIG_LP_REMOTEGDB) += libgdb +classes-$(CONFIG_LP_VBOOT_LIB) += vboot_fw +classes-$(CONFIG_LP_VBOOT_LIB) += tlcl +libraries := $(classes-y) +classes-y += head.o + +subdirs-y := arch/$(ARCHDIR-y) +subdirs-y += crypto libc drivers libpci gdb +subdirs-$(CONFIG_LP_CURSES) += curses +subdirs-$(CONFIG_LP_CBFS) += libcbfs +subdirs-$(CONFIG_LP_LZMA) += liblzma +subdirs-$(CONFIG_LP_LZ4) += liblz4 +subdirs-$(CONFIG_LP_VBOOT_LIB) += vboot + +INCLUDES := -Iinclude -Iinclude/$(ARCHDIR-y) -I$(obj) +INCLUDES += -include include/kconfig.h +INCLUDES += -include $(coreboottop)/src/commonlib/bsd/include/commonlib/bsd/compiler.h +INCLUDES += -I$(coreboottop)/src/commonlib/bsd/include +INCLUDES += -I$(VBOOT_SOURCE)/firmware/include + +CFLAGS += $(INCLUDES) -Os -pipe -nostdinc -ggdb3 +CFLAGS += -nostdlib -fno-builtin -ffreestanding -fomit-frame-pointer +CFLAGS += -ffunction-sections -fdata-sections +CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wvla +CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs -Wimplicit-fallthrough +CFLAGS += -Wstrict-aliasing -Wshadow -Werror + +ifeq ($(CONFIG_LP_LTO),y) +CFLAGS += -flto +endif + +# Some of the commonlib cbfs headers include vboot headers, so initialize the +# submodule in case we are building a payload outside the main coreboot build +forgetthis:=$(if $(GIT),$(shell git submodule update --init ../../3rdparty/vboot $(quiet_errors))) + +$(obj)/libpayload.config: $(DOTCONFIG) + cp $< $@ + +$(obj)/libpayload-config.h: $(KCONFIG_AUTOHEADER) $(obj)/libpayload.config + cmp $@ $< 2>/dev/null || cp $< $@ + +library-targets = $(addsuffix .a,$(addprefix $(obj)/,$(libraries))) $(obj)/libpayload.a +lib: $$(library-targets) $(obj)/head.o + +extract_nth=$(word $(1), $(subst |, ,$(2))) + +####################################################################### +# Add handler for special include files +$(call add-special-class,includes) +includes-handler= \ + $(if $(wildcard $(1)$(call extract_nth,1,$(2))), \ + $(eval includes += $(1)$(2))) + +$(obj)/libpayload.a: $(foreach class,$(libraries),$$($(class)-objs)) + printf " AR $(subst $(CURDIR)/,,$(@))\n" + printf "create $@\n$(foreach objc,$(filter-out %.a,$^),addmod $(objc)\n)$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M + +$(obj)/%.a: $$(%-objs) + printf " AR $(subst $(CURDIR)/,,$(@))\n" + printf "create $@\n$(foreach objc,$(filter-out %.a,$^),addmod $(objc)\n)$(foreach lib,$(filter %.a,$^),addlib $(lib)\n)save\nend\n" | $(AR) -M + +$(obj)/head.o: $(obj)/arch/$(ARCHDIR-y)/head.head.o.o + printf " CP $(subst $(CURDIR)/,,$(@))\n" + cp $^ $@ + +install: real-target + printf " INSTALL $(DESTDIR)/libpayload/lib\n" + install -m 755 -d $(DESTDIR)/libpayload/lib + install -m 644 $(library-targets) $(DESTDIR)/libpayload/lib/ + install -m 644 arch/$(ARCHDIR-y)/libpayload.ldscript $(DESTDIR)/libpayload/lib/ + install -m 755 -d $(DESTDIR)/libpayload/lib/$(ARCHDIR-y) + install -m 644 $(obj)/head.o $(DESTDIR)/libpayload/lib/$(ARCHDIR-y) + printf " INSTALL $(DESTDIR)/libpayload/include\n" + install -m 755 -d $(DESTDIR)/libpayload/include + find include -type d -exec install -m755 -d $(DESTDIR)/libpayload/{} \; + find include -type f -exec install -m644 {} $(DESTDIR)/libpayload/{} \; + cd $(coreboottop)/src/commonlib/bsd && find include -type d -exec install -m755 -d $(abspath $(DESTDIR))/libpayload/{} \; + cd $(coreboottop)/src/commonlib/bsd && find include -type f -exec install -m644 {} $(abspath $(DESTDIR))/libpayload/{} \; + install -m 644 $(obj)/libpayload-config.h $(DESTDIR)/libpayload/include + $(foreach item,$(includes), \ + install -m 755 -d $(DESTDIR)/libpayload/include/$(call extract_nth,2,$(item)); \ + install -m 644 $(call extract_nth,1,$(item)) $(DESTDIR)/libpayload/include/$(call extract_nth,2,$(item)); ) + printf " INSTALL $(DESTDIR)/libpayload/vboot\n" + install -m 755 -d $(DESTDIR)/libpayload/vboot + for file in `find $(VBOOT_SOURCE)/firmware/include \ + $(VBOOT_SOURCE)/firmware/2lib/include \ + -iname '*.h' -type f \ + | sed 's,$(VBOOT_SOURCE)/firmware/,,'`; do \ + install -m 755 -d $(DESTDIR)/libpayload/vboot/$$(dirname $$file); \ + install -m 644 $(VBOOT_SOURCE)/firmware/$$file $(DESTDIR)/libpayload/vboot/$$file ; \ + done + printf " INSTALL $(DESTDIR)/libpayload/bin\n" + install -m 755 -d $(DESTDIR)/libpayload/bin + install -m 755 bin/lpgcc $(DESTDIR)/libpayload/bin + install -m 755 bin/lpas $(DESTDIR)/libpayload/bin + install -m 644 bin/lp.functions $(DESTDIR)/libpayload/bin + install -m 644 $(DOTCONFIG) $(DESTDIR)/libpayload/libpayload.config + install -m 755 $(xcompile) $(DESTDIR)/libpayload/libpayload.xcompile + +clean-for-update-target: + rm -f $(addsuffix .a,$(addprefix $(obj)/,$(libraries))) $(obj)/libpayload.a + +clean-target: +prepare: + +junit.xml: + echo '' > $@.tmp + for i in $(filter-out %.old %.unit-tests,$(wildcard configs/*)); do \ + $(MAKE) clean; \ + echo "Building libpayload for $$i"; \ + cp "$$i" junit_config; \ + $(MAKE) olddefconfig DOTCONFIG=junit_config V=$(V) Q=$(Q) 2>/dev/null >/dev/null; \ + echo "" >> $@.tmp; \ + $(MAKE) V=$(V) Q=$(Q) CONFIG_LP_CCACHE=$(CONFIG_LP_CCACHE) DOTCONFIG=junit_config >> $@.tmp.2 2>&1 && type="system-out" || type="failure"; \ + if [ $$type = "failure" ]; then \ + echo "" >> $@.tmp; \ + else \ + echo "<$$type>" >> $@.tmp; \ + fi; \ + echo '> $@.tmp; \ + cat $@.tmp.2 >> $@.tmp; \ + echo "]]>" >>$@.tmp; \ + rm -f $@.tmp.2; \ + echo "" >> $@.tmp; \ + done + echo "" >> $@.tmp + echo "libpayload build complete, test results in $@" + mv $@.tmp $@ + +test-configs: + for config in $(filter-out %.old %.unit-tests,$(wildcard configs/*)); do \ + $(MAKE) clean; \ + cp "$$config" test_config; \ + echo "*** Making libpayload config $$config ***"; \ + $(MAKE) olddefconfig DOTCONFIG=test_config V=$(V) Q=$(Q) ; \ + $(MAKE) V=$(V) Q=$(Q) CONFIG_LP_CCACHE=$(CONFIG_LP_CCACHE) DOTCONFIG=test_config; \ + done diff --git a/payloads/libpayload/arch/arm/Makefile.inc b/payloads/libpayload/arch/arm/Makefile.inc deleted file mode 100644 index c9736010c8..0000000000 --- a/payloads/libpayload/arch/arm/Makefile.inc +++ /dev/null @@ -1,50 +0,0 @@ -## -## -## Copyright (C) 2008 Advanced Micro Devices, Inc. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -CFLAGS += -mthumb -march=armv7-a -arm_asm_flags = -Wa,-mthumb -Wa,-mimplicit-it=always -Wa,-mno-warn-deprecated - -head.o-y += head.S -libc-y += eabi_compat.c -libc-y += main.c sysinfo.c -libc-y += timer.c coreboot.c util.S -libc-y += virtual.c -libc-y += exception_asm.S exception.c -libc-y += cache.c cpu.S -libc-y += selfboot.c - -# Will fall back to default_memXXX() in libc/memory.c if GPL not allowed. -libc-$(CONFIG_LP_GPL) += memcpy.S memset.S memmove.S - -libgdb-y += gdb.c - -libcbfs-$(CONFIG_LP_CBFS) += dummy_media.c - -# Add other classes here when you put assembly files into them! -head.o-S-ccopts += $(arm_asm_flags) -libc-S-ccopts += $(arm_asm_flags) diff --git a/payloads/libpayload/arch/arm/Makefile.mk b/payloads/libpayload/arch/arm/Makefile.mk new file mode 100644 index 0000000000..c9736010c8 --- /dev/null +++ b/payloads/libpayload/arch/arm/Makefile.mk @@ -0,0 +1,50 @@ +## +## +## Copyright (C) 2008 Advanced Micro Devices, Inc. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +CFLAGS += -mthumb -march=armv7-a +arm_asm_flags = -Wa,-mthumb -Wa,-mimplicit-it=always -Wa,-mno-warn-deprecated + +head.o-y += head.S +libc-y += eabi_compat.c +libc-y += main.c sysinfo.c +libc-y += timer.c coreboot.c util.S +libc-y += virtual.c +libc-y += exception_asm.S exception.c +libc-y += cache.c cpu.S +libc-y += selfboot.c + +# Will fall back to default_memXXX() in libc/memory.c if GPL not allowed. +libc-$(CONFIG_LP_GPL) += memcpy.S memset.S memmove.S + +libgdb-y += gdb.c + +libcbfs-$(CONFIG_LP_CBFS) += dummy_media.c + +# Add other classes here when you put assembly files into them! +head.o-S-ccopts += $(arm_asm_flags) +libc-S-ccopts += $(arm_asm_flags) diff --git a/payloads/libpayload/arch/arm64/Makefile.inc b/payloads/libpayload/arch/arm64/Makefile.inc deleted file mode 100644 index 6eb9fe8325..0000000000 --- a/payloads/libpayload/arch/arm64/Makefile.inc +++ /dev/null @@ -1,47 +0,0 @@ -## -## -## Copyright (C) 2008 Advanced Micro Devices, Inc. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -CFLAGS += -march=armv8-a -arm64_asm_flags = - -head.o-y += head.S -libc-y += main.c sysinfo.c -libc-y += timer.c coreboot.c util.S -libc-y += virtual.c -libc-y += memcpy.S memset.S memmove.S -libc-y += exception_asm.S exception.c -libc-y += cache.c cpu.S -libc-y += selfboot.c -libc-y += mmu.c -libcbfs-$(CONFIG_LP_CBFS) += dummy_media.c - -libgdb-y += gdb.c - -# Add other classes here when you put assembly files into them! - head.o-S-ccopts += $(arm64_asm_flags) - libc-S-ccopts += $(arm64_asm_flags) diff --git a/payloads/libpayload/arch/arm64/Makefile.mk b/payloads/libpayload/arch/arm64/Makefile.mk new file mode 100644 index 0000000000..6eb9fe8325 --- /dev/null +++ b/payloads/libpayload/arch/arm64/Makefile.mk @@ -0,0 +1,47 @@ +## +## +## Copyright (C) 2008 Advanced Micro Devices, Inc. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +CFLAGS += -march=armv8-a +arm64_asm_flags = + +head.o-y += head.S +libc-y += main.c sysinfo.c +libc-y += timer.c coreboot.c util.S +libc-y += virtual.c +libc-y += memcpy.S memset.S memmove.S +libc-y += exception_asm.S exception.c +libc-y += cache.c cpu.S +libc-y += selfboot.c +libc-y += mmu.c +libcbfs-$(CONFIG_LP_CBFS) += dummy_media.c + +libgdb-y += gdb.c + +# Add other classes here when you put assembly files into them! + head.o-S-ccopts += $(arm64_asm_flags) + libc-S-ccopts += $(arm64_asm_flags) diff --git a/payloads/libpayload/arch/mock/Makefile.inc b/payloads/libpayload/arch/mock/Makefile.inc deleted file mode 100644 index 415886af60..0000000000 --- a/payloads/libpayload/arch/mock/Makefile.inc +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -head.o-y += head.c - -libc-y += virtual.c - -libcbfs-$(CONFIG_LP_CBFS) += mock_media.c - -CFLAGS += -Wno-address-of-packed-member diff --git a/payloads/libpayload/arch/mock/Makefile.mk b/payloads/libpayload/arch/mock/Makefile.mk new file mode 100644 index 0000000000..415886af60 --- /dev/null +++ b/payloads/libpayload/arch/mock/Makefile.mk @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only + +head.o-y += head.c + +libc-y += virtual.c + +libcbfs-$(CONFIG_LP_CBFS) += mock_media.c + +CFLAGS += -Wno-address-of-packed-member diff --git a/payloads/libpayload/arch/x86/Makefile.inc b/payloads/libpayload/arch/x86/Makefile.inc deleted file mode 100644 index 653412ef5a..0000000000 --- a/payloads/libpayload/arch/x86/Makefile.inc +++ /dev/null @@ -1,52 +0,0 @@ -## -## -## Copyright (C) 2008 Advanced Micro Devices, Inc. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -ifneq ($(CONFIG_LP_COMPILER_LLVM_CLANG),y) -CFLAGS += -mpreferred-stack-boundary=2 -endif - -head.o-y += head.S -libc-y += main.c sysinfo.c -libc-y += timer.c coreboot.c util.S -libc-y += exec.S virtual.c -libc-y += selfboot.c cache.c -libc-y += exception_asm.S exception.c -libc-y += delay.c - -# Will fall back to default_memXXX() in libc/memory.c if GPL not allowed. -libc-$(CONFIG_LP_GPL) += string.c - -libgdb-y += gdb.c - -libcbfs-$(CONFIG_LP_CBFS) += rom_media.c -libcbfs-$(CONFIG_LP_CBFS) += boot_media.c - -# Multiboot support is configurable -libc-$(CONFIG_LP_MULTIBOOT) += multiboot.c - -libc-$(CONFIG_LP_ENABLE_APIC) += apic.c diff --git a/payloads/libpayload/arch/x86/Makefile.mk b/payloads/libpayload/arch/x86/Makefile.mk new file mode 100644 index 0000000000..653412ef5a --- /dev/null +++ b/payloads/libpayload/arch/x86/Makefile.mk @@ -0,0 +1,52 @@ +## +## +## Copyright (C) 2008 Advanced Micro Devices, Inc. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +ifneq ($(CONFIG_LP_COMPILER_LLVM_CLANG),y) +CFLAGS += -mpreferred-stack-boundary=2 +endif + +head.o-y += head.S +libc-y += main.c sysinfo.c +libc-y += timer.c coreboot.c util.S +libc-y += exec.S virtual.c +libc-y += selfboot.c cache.c +libc-y += exception_asm.S exception.c +libc-y += delay.c + +# Will fall back to default_memXXX() in libc/memory.c if GPL not allowed. +libc-$(CONFIG_LP_GPL) += string.c + +libgdb-y += gdb.c + +libcbfs-$(CONFIG_LP_CBFS) += rom_media.c +libcbfs-$(CONFIG_LP_CBFS) += boot_media.c + +# Multiboot support is configurable +libc-$(CONFIG_LP_MULTIBOOT) += multiboot.c + +libc-$(CONFIG_LP_ENABLE_APIC) += apic.c diff --git a/payloads/libpayload/crypto/Makefile.inc b/payloads/libpayload/crypto/Makefile.inc deleted file mode 100644 index 7e8e210e45..0000000000 --- a/payloads/libpayload/crypto/Makefile.inc +++ /dev/null @@ -1,29 +0,0 @@ -## -## -## Copyright (C) 2008 Uwe Hermann -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -libc-y += sha1.c diff --git a/payloads/libpayload/crypto/Makefile.mk b/payloads/libpayload/crypto/Makefile.mk new file mode 100644 index 0000000000..7e8e210e45 --- /dev/null +++ b/payloads/libpayload/crypto/Makefile.mk @@ -0,0 +1,29 @@ +## +## +## Copyright (C) 2008 Uwe Hermann +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +libc-y += sha1.c diff --git a/payloads/libpayload/curses/Makefile.inc b/payloads/libpayload/curses/Makefile.inc deleted file mode 100644 index 99f8d70e05..0000000000 --- a/payloads/libpayload/curses/Makefile.inc +++ /dev/null @@ -1,167 +0,0 @@ -## -## -## Copyright (C) 2008 Advanced Micro Devices, Inc. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -ifeq ($(CONFIG_LP_TINYCURSES),y) -INCLUDES += -Icurses -endif - -libcurses-$(CONFIG_LP_TINYCURSES) += keyboard.c -libcurses-$(CONFIG_LP_TINYCURSES) += tinycurses.c -libcurses-$(CONFIG_LP_TINYCURSES) += colors.c - -includes-$(CONFIG_LP_TINYCURSES) += curses.h - -ifeq ($(CONFIG_LP_PDCURSES),y) -PDCURSES := PDCurses -INCLUDES += -D_LP64=0 -Icurses/$(PDCURSES) -Icurses/pdcurses-backend -Icurses/menu -Icurses/form -endif - -libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdcdisp.c -libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdcgetsc.c -libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdckbd.c -libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdcscrn.c -libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdcsetsc.c -libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdcutil.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/addch.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/move.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/overlay.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/refresh.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/terminfo.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/window.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/util.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/inopts.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/addstr.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/keyname.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/instr.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/clear.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/addchstr.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/kernel.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/pad.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/insstr.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/border.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/getyx.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/getstr.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/getch.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/termattr.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/outopts.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/color.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/deleteln.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/initscr.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/slk.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/delch.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/touch.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/mouse.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/scanw.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/scroll.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/printw.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/bkgd.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/inch.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/attr.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/insch.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/inchstr.c -libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/beep.c - -includes-$(CONFIG_LP_PDCURSES) += pdcurses-backend/nc_alloc.h -includes-$(CONFIG_LP_PDCURSES) += pdcurses-backend/ncurses_cfg.h -includes-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/curses.h -includes-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/term.h -includes-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/panel.h -includes-$(CONFIG_LP_PDCURSES) += menu/eti.h -includes-$(CONFIG_LP_PDCURSES) += menu/menu.h -includes-$(CONFIG_LP_PDCURSES) += menu/mf_common.h -includes-$(CONFIG_LP_PDCURSES) += form/form.h - -libpanel-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/panel.c - -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_req_name.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_nam.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_pad.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_cursor.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_new.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_attribs.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_opt.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_format.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_post.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_userptr.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_cur.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_driver.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_sub.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_win.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_global.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_vis.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_new.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_scale.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_spacing.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_opts.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_pattern.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_val.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_hook.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_use.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_items.c -libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_top.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_page.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_opts.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_def.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_req_name.c -libform-$(CONFIG_LP_PDCURSES) += form/fty_alpha.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_driver.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_user.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_win.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_newftyp.c -#libform-$(CONFIG_LP_PDCURSES) += form/fty_regex.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_stat.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_pad.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_current.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_post.c -#libform-$(CONFIG_LP_PDCURSES) += form/f_trace.c -libform-$(CONFIG_LP_PDCURSES) += form/fty_generic.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_page.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_hook.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_scale.c -libform-$(CONFIG_LP_PDCURSES) += form/fty_int.c -libform-$(CONFIG_LP_PDCURSES) += form/fty_alnum.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_cursor.c -#libform-$(CONFIG_LP_PDCURSES) += form/fty_ipv4.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_link.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_arg.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_move.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_def.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_type.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_max.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_ftlink.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_ftchoice.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_info.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_user.c -#libform-$(CONFIG_LP_PDCURSES) += form/fty_num.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_sub.c -libform-$(CONFIG_LP_PDCURSES) += form/fty_enum.c -libform-$(CONFIG_LP_PDCURSES) += form/frm_data.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_opts.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_attr.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_dup.c -libform-$(CONFIG_LP_PDCURSES) += form/fld_just.c diff --git a/payloads/libpayload/curses/Makefile.mk b/payloads/libpayload/curses/Makefile.mk new file mode 100644 index 0000000000..99f8d70e05 --- /dev/null +++ b/payloads/libpayload/curses/Makefile.mk @@ -0,0 +1,167 @@ +## +## +## Copyright (C) 2008 Advanced Micro Devices, Inc. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +ifeq ($(CONFIG_LP_TINYCURSES),y) +INCLUDES += -Icurses +endif + +libcurses-$(CONFIG_LP_TINYCURSES) += keyboard.c +libcurses-$(CONFIG_LP_TINYCURSES) += tinycurses.c +libcurses-$(CONFIG_LP_TINYCURSES) += colors.c + +includes-$(CONFIG_LP_TINYCURSES) += curses.h + +ifeq ($(CONFIG_LP_PDCURSES),y) +PDCURSES := PDCurses +INCLUDES += -D_LP64=0 -Icurses/$(PDCURSES) -Icurses/pdcurses-backend -Icurses/menu -Icurses/form +endif + +libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdcdisp.c +libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdcgetsc.c +libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdckbd.c +libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdcscrn.c +libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdcsetsc.c +libcurses-$(CONFIG_LP_PDCURSES) += pdcurses-backend/pdcutil.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/addch.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/move.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/overlay.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/refresh.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/terminfo.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/window.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/util.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/inopts.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/addstr.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/keyname.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/instr.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/clear.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/addchstr.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/kernel.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/pad.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/insstr.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/border.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/getyx.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/getstr.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/getch.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/termattr.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/outopts.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/color.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/deleteln.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/initscr.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/slk.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/delch.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/touch.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/mouse.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/scanw.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/scroll.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/printw.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/bkgd.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/inch.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/attr.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/insch.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/inchstr.c +libcurses-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/beep.c + +includes-$(CONFIG_LP_PDCURSES) += pdcurses-backend/nc_alloc.h +includes-$(CONFIG_LP_PDCURSES) += pdcurses-backend/ncurses_cfg.h +includes-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/curses.h +includes-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/term.h +includes-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/panel.h +includes-$(CONFIG_LP_PDCURSES) += menu/eti.h +includes-$(CONFIG_LP_PDCURSES) += menu/menu.h +includes-$(CONFIG_LP_PDCURSES) += menu/mf_common.h +includes-$(CONFIG_LP_PDCURSES) += form/form.h + +libpanel-$(CONFIG_LP_PDCURSES) += $(PDCURSES)/pdcurses/panel.c + +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_req_name.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_nam.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_pad.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_cursor.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_new.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_attribs.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_opt.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_format.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_post.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_userptr.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_cur.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_driver.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_sub.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_win.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_global.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_vis.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_new.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_scale.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_spacing.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_opts.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_pattern.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_val.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_hook.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_use.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_items.c +libmenu-$(CONFIG_LP_PDCURSES) += menu/m_item_top.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_page.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_opts.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_def.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_req_name.c +libform-$(CONFIG_LP_PDCURSES) += form/fty_alpha.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_driver.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_user.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_win.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_newftyp.c +#libform-$(CONFIG_LP_PDCURSES) += form/fty_regex.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_stat.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_pad.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_current.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_post.c +#libform-$(CONFIG_LP_PDCURSES) += form/f_trace.c +libform-$(CONFIG_LP_PDCURSES) += form/fty_generic.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_page.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_hook.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_scale.c +libform-$(CONFIG_LP_PDCURSES) += form/fty_int.c +libform-$(CONFIG_LP_PDCURSES) += form/fty_alnum.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_cursor.c +#libform-$(CONFIG_LP_PDCURSES) += form/fty_ipv4.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_link.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_arg.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_move.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_def.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_type.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_max.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_ftlink.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_ftchoice.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_info.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_user.c +#libform-$(CONFIG_LP_PDCURSES) += form/fty_num.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_sub.c +libform-$(CONFIG_LP_PDCURSES) += form/fty_enum.c +libform-$(CONFIG_LP_PDCURSES) += form/frm_data.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_opts.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_attr.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_dup.c +libform-$(CONFIG_LP_PDCURSES) += form/fld_just.c diff --git a/payloads/libpayload/drivers/Makefile.inc b/payloads/libpayload/drivers/Makefile.inc deleted file mode 100644 index 23471b83c4..0000000000 --- a/payloads/libpayload/drivers/Makefile.inc +++ /dev/null @@ -1,129 +0,0 @@ -## -## -## Copyright (C) 2007 Uwe Hermann -## Copyright (C) 2008 Advanced Micro Devices, Inc. -## Copyright (C) 2008 coresystems GmbH -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -libc-$(CONFIG_LP_PCI) += pci_ops.c - -ifeq ($(CONFIG_LP_PCI_IO_OPS),y) -libc-$(CONFIG_LP_PCI) += pci_io_ops.c -else -libc-$(CONFIG_LP_PCI) += pci_map_bus_ops.c -endif - -libc-$(CONFIG_LP_PCIE_MEDIATEK) += pcie_mediatek.c -libc-$(CONFIG_LP_PCIE_QCOM) += pci_qcom.c - -libc-$(CONFIG_LP_SPEAKER) += speaker.c - -libc-$(CONFIG_LP_8250_SERIAL_CONSOLE) += serial/8250.c serial/serial.c -libc-$(CONFIG_LP_S5P_SERIAL_CONSOLE) += serial/s5p.c serial/serial.c -libc-$(CONFIG_LP_IPQ806X_SERIAL_CONSOLE) += serial/ipq806x.c serial/serial.c -libc-$(CONFIG_LP_IPQ40XX_SERIAL_CONSOLE) += serial/ipq40xx.c serial/serial.c -libc-$(CONFIG_LP_QCS405_SERIAL_CONSOLE) += serial/qcs405.c serial/serial.c -libc-$(CONFIG_LP_QUALCOMM_QUPV3_SERIAL_CONSOLE) += serial/qcom_qupv3_serial.c serial/serial.c -libc-$(CONFIG_LP_PC_KEYBOARD) += i8042/keyboard.c -libc-$(CONFIG_LP_PC_MOUSE) += i8042/mouse.c -libc-$(CONFIG_LP_PC_I8042) += i8042/i8042.c - -libc-$(CONFIG_LP_CBMEM_CONSOLE) += cbmem_console.c - -libc-$(CONFIG_LP_MOUSE_CURSOR) += mouse_cursor.c - -libc-$(CONFIG_LP_NVRAM) += nvram.c -libc-$(CONFIG_LP_NVRAM) += options.c - -# Timer drivers -ifneq ($(CONFIG_LP_TIMER_GENERIC_HZ),0) -libc-y += timer/generic.c -endif -libc-$(CONFIG_LP_TIMER_RDTSC) += timer/rdtsc.c -libc-$(CONFIG_LP_TIMER_ARM64_ARCH) += timer/arm64_arch_timer.c - -# Video console drivers -libc-$(CONFIG_LP_VIDEO_CONSOLE) += video/video.c -libc-$(CONFIG_LP_VGA_VIDEO_CONSOLE) += video/vga.c - -# Geode LX console drivers -libc-$(CONFIG_LP_GEODELX_VIDEO_CONSOLE) += video/geodelx.c -libc-$(CONFIG_LP_GEODELX_VIDEO_CONSOLE) += video/font8x16.c -libc-$(CONFIG_LP_GEODELX_VIDEO_CONSOLE) += video/font.c - -# coreboot generic framebuffer driver -libc-$(CONFIG_LP_COREBOOT_VIDEO_CONSOLE) += video/corebootfb.c -libc-$(CONFIG_LP_COREBOOT_VIDEO_CONSOLE) += video/font8x16.c -libc-$(CONFIG_LP_COREBOOT_VIDEO_CONSOLE) += video/font.c - -# cbgfx: coreboot graphics library -libc-y += video/graphics.c - -# AHCI/ATAPI driver -libc-$(CONFIG_LP_STORAGE) += storage/storage.c -libc-$(CONFIG_LP_STORAGE_AHCI) += storage/ahci.c -libc-$(CONFIG_LP_STORAGE_AHCI) += storage/ahci_common.c -libc-$(CONFIG_LP_STORAGE_NVME) += storage/nvme.c -ifeq ($(CONFIG_LP_STORAGE_ATA),y) -libc-$(CONFIG_LP_STORAGE_ATA) += storage/ata.c -libc-$(CONFIG_LP_STORAGE_ATA) += storage/ahci_ata.c -endif -ifeq ($(CONFIG_LP_STORAGE_ATAPI),y) -libc-$(CONFIG_LP_STORAGE_ATAPI) += storage/atapi.c -libc-$(CONFIG_LP_STORAGE_ATAPI) += storage/ahci_atapi.c -endif - -# USB stack -libc-$(CONFIG_LP_USB) += usb/usbinit.c -libc-$(CONFIG_LP_USB) += usb/usb.c -libc-$(CONFIG_LP_USB) += usb/usb_dev.c -libc-$(CONFIG_LP_USB) += usb/quirks.c -libc-$(CONFIG_LP_USB_GEN_HUB) += usb/generic_hub.c -libc-$(CONFIG_LP_USB_HUB) += usb/usbhub.c -libc-$(CONFIG_LP_USB_UHCI) += usb/uhci.c -libc-$(CONFIG_LP_USB_UHCI) += usb/uhci_rh.c -libc-$(CONFIG_LP_USB_OHCI) += usb/ohci.c -libc-$(CONFIG_LP_USB_OHCI) += usb/ohci_rh.c -libc-$(CONFIG_LP_USB_EHCI) += usb/ehci.c -libc-$(CONFIG_LP_USB_EHCI) += usb/ehci_rh.c -libc-$(CONFIG_LP_USB_XHCI) += usb/xhci.c -libc-$(CONFIG_LP_USB_XHCI) += usb/xhci_debug.c -libc-$(CONFIG_LP_USB_XHCI) += usb/xhci_devconf.c -libc-$(CONFIG_LP_USB_XHCI) += usb/xhci_events.c -libc-$(CONFIG_LP_USB_XHCI) += usb/xhci_commands.c -libc-$(CONFIG_LP_USB_XHCI) += usb/xhci_rh.c -libc-$(CONFIG_LP_USB_HID) += usb/usbhid.c -libc-$(CONFIG_LP_USB_MSC) += usb/usbmsc.c -libc-$(CONFIG_LP_USB_DWC2) += usb/dwc2.c -libc-$(CONFIG_LP_USB_DWC2) += usb/dwc2_rh.c - -# USB device stack -libc-$(CONFIG_LP_UDC) += udc/udc.c -libc-$(CONFIG_LP_UDC_CI) += udc/chipidea.c -libc-$(CONFIG_LP_UDC_DWC2) += udc/dwc2.c - -# used by both USB HID and keyboard -libc-y += hid.c diff --git a/payloads/libpayload/drivers/Makefile.mk b/payloads/libpayload/drivers/Makefile.mk new file mode 100644 index 0000000000..23471b83c4 --- /dev/null +++ b/payloads/libpayload/drivers/Makefile.mk @@ -0,0 +1,129 @@ +## +## +## Copyright (C) 2007 Uwe Hermann +## Copyright (C) 2008 Advanced Micro Devices, Inc. +## Copyright (C) 2008 coresystems GmbH +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +libc-$(CONFIG_LP_PCI) += pci_ops.c + +ifeq ($(CONFIG_LP_PCI_IO_OPS),y) +libc-$(CONFIG_LP_PCI) += pci_io_ops.c +else +libc-$(CONFIG_LP_PCI) += pci_map_bus_ops.c +endif + +libc-$(CONFIG_LP_PCIE_MEDIATEK) += pcie_mediatek.c +libc-$(CONFIG_LP_PCIE_QCOM) += pci_qcom.c + +libc-$(CONFIG_LP_SPEAKER) += speaker.c + +libc-$(CONFIG_LP_8250_SERIAL_CONSOLE) += serial/8250.c serial/serial.c +libc-$(CONFIG_LP_S5P_SERIAL_CONSOLE) += serial/s5p.c serial/serial.c +libc-$(CONFIG_LP_IPQ806X_SERIAL_CONSOLE) += serial/ipq806x.c serial/serial.c +libc-$(CONFIG_LP_IPQ40XX_SERIAL_CONSOLE) += serial/ipq40xx.c serial/serial.c +libc-$(CONFIG_LP_QCS405_SERIAL_CONSOLE) += serial/qcs405.c serial/serial.c +libc-$(CONFIG_LP_QUALCOMM_QUPV3_SERIAL_CONSOLE) += serial/qcom_qupv3_serial.c serial/serial.c +libc-$(CONFIG_LP_PC_KEYBOARD) += i8042/keyboard.c +libc-$(CONFIG_LP_PC_MOUSE) += i8042/mouse.c +libc-$(CONFIG_LP_PC_I8042) += i8042/i8042.c + +libc-$(CONFIG_LP_CBMEM_CONSOLE) += cbmem_console.c + +libc-$(CONFIG_LP_MOUSE_CURSOR) += mouse_cursor.c + +libc-$(CONFIG_LP_NVRAM) += nvram.c +libc-$(CONFIG_LP_NVRAM) += options.c + +# Timer drivers +ifneq ($(CONFIG_LP_TIMER_GENERIC_HZ),0) +libc-y += timer/generic.c +endif +libc-$(CONFIG_LP_TIMER_RDTSC) += timer/rdtsc.c +libc-$(CONFIG_LP_TIMER_ARM64_ARCH) += timer/arm64_arch_timer.c + +# Video console drivers +libc-$(CONFIG_LP_VIDEO_CONSOLE) += video/video.c +libc-$(CONFIG_LP_VGA_VIDEO_CONSOLE) += video/vga.c + +# Geode LX console drivers +libc-$(CONFIG_LP_GEODELX_VIDEO_CONSOLE) += video/geodelx.c +libc-$(CONFIG_LP_GEODELX_VIDEO_CONSOLE) += video/font8x16.c +libc-$(CONFIG_LP_GEODELX_VIDEO_CONSOLE) += video/font.c + +# coreboot generic framebuffer driver +libc-$(CONFIG_LP_COREBOOT_VIDEO_CONSOLE) += video/corebootfb.c +libc-$(CONFIG_LP_COREBOOT_VIDEO_CONSOLE) += video/font8x16.c +libc-$(CONFIG_LP_COREBOOT_VIDEO_CONSOLE) += video/font.c + +# cbgfx: coreboot graphics library +libc-y += video/graphics.c + +# AHCI/ATAPI driver +libc-$(CONFIG_LP_STORAGE) += storage/storage.c +libc-$(CONFIG_LP_STORAGE_AHCI) += storage/ahci.c +libc-$(CONFIG_LP_STORAGE_AHCI) += storage/ahci_common.c +libc-$(CONFIG_LP_STORAGE_NVME) += storage/nvme.c +ifeq ($(CONFIG_LP_STORAGE_ATA),y) +libc-$(CONFIG_LP_STORAGE_ATA) += storage/ata.c +libc-$(CONFIG_LP_STORAGE_ATA) += storage/ahci_ata.c +endif +ifeq ($(CONFIG_LP_STORAGE_ATAPI),y) +libc-$(CONFIG_LP_STORAGE_ATAPI) += storage/atapi.c +libc-$(CONFIG_LP_STORAGE_ATAPI) += storage/ahci_atapi.c +endif + +# USB stack +libc-$(CONFIG_LP_USB) += usb/usbinit.c +libc-$(CONFIG_LP_USB) += usb/usb.c +libc-$(CONFIG_LP_USB) += usb/usb_dev.c +libc-$(CONFIG_LP_USB) += usb/quirks.c +libc-$(CONFIG_LP_USB_GEN_HUB) += usb/generic_hub.c +libc-$(CONFIG_LP_USB_HUB) += usb/usbhub.c +libc-$(CONFIG_LP_USB_UHCI) += usb/uhci.c +libc-$(CONFIG_LP_USB_UHCI) += usb/uhci_rh.c +libc-$(CONFIG_LP_USB_OHCI) += usb/ohci.c +libc-$(CONFIG_LP_USB_OHCI) += usb/ohci_rh.c +libc-$(CONFIG_LP_USB_EHCI) += usb/ehci.c +libc-$(CONFIG_LP_USB_EHCI) += usb/ehci_rh.c +libc-$(CONFIG_LP_USB_XHCI) += usb/xhci.c +libc-$(CONFIG_LP_USB_XHCI) += usb/xhci_debug.c +libc-$(CONFIG_LP_USB_XHCI) += usb/xhci_devconf.c +libc-$(CONFIG_LP_USB_XHCI) += usb/xhci_events.c +libc-$(CONFIG_LP_USB_XHCI) += usb/xhci_commands.c +libc-$(CONFIG_LP_USB_XHCI) += usb/xhci_rh.c +libc-$(CONFIG_LP_USB_HID) += usb/usbhid.c +libc-$(CONFIG_LP_USB_MSC) += usb/usbmsc.c +libc-$(CONFIG_LP_USB_DWC2) += usb/dwc2.c +libc-$(CONFIG_LP_USB_DWC2) += usb/dwc2_rh.c + +# USB device stack +libc-$(CONFIG_LP_UDC) += udc/udc.c +libc-$(CONFIG_LP_UDC_CI) += udc/chipidea.c +libc-$(CONFIG_LP_UDC_DWC2) += udc/dwc2.c + +# used by both USB HID and keyboard +libc-y += hid.c diff --git a/payloads/libpayload/gdb/Makefile.inc b/payloads/libpayload/gdb/Makefile.inc deleted file mode 100644 index 60e18bcb01..0000000000 --- a/payloads/libpayload/gdb/Makefile.inc +++ /dev/null @@ -1,16 +0,0 @@ -## -## Copyright 2014 Google Inc. -## -## This program is free software; you can redistribute it and/or -## modify it under the terms of the GNU General Public License as -## published by the Free Software Foundation; either version 2 of -## the License, or (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but without any warranty; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -libgdb-y += commands.c -libgdb-y += stub.c -libgdb-y += transport.c diff --git a/payloads/libpayload/gdb/Makefile.mk b/payloads/libpayload/gdb/Makefile.mk new file mode 100644 index 0000000000..60e18bcb01 --- /dev/null +++ b/payloads/libpayload/gdb/Makefile.mk @@ -0,0 +1,16 @@ +## +## Copyright 2014 Google Inc. +## +## This program is free software; you can redistribute it and/or +## modify it under the terms of the GNU General Public License as +## published by the Free Software Foundation; either version 2 of +## the License, or (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but without any warranty; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +libgdb-y += commands.c +libgdb-y += stub.c +libgdb-y += transport.c diff --git a/payloads/libpayload/libc/Makefile.inc b/payloads/libpayload/libc/Makefile.inc deleted file mode 100644 index 2d277da3b5..0000000000 --- a/payloads/libpayload/libc/Makefile.inc +++ /dev/null @@ -1,50 +0,0 @@ -## -## -## Copyright (C) 2008 Advanced Micro Devices, Inc. -## Copyright (C) 2008 coresystems GmbH -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -libc-$(CONFIG_LP_LIBC) += malloc.c printf.c console.c string.c -libc-$(CONFIG_LP_LIBC) += memory.c ctype.c ipchecksum.c lib.c libgcc.c -libc-$(CONFIG_LP_LIBC) += rand.c time.c exec.c -libc-$(CONFIG_LP_LIBC) += readline.c getopt_long.c sysinfo.c -libc-$(CONFIG_LP_LIBC) += args.c -libc-$(CONFIG_LP_LIBC) += strlcpy.c -libc-$(CONFIG_LP_LIBC) += qsort.c -libc-$(CONFIG_LP_LIBC) += hexdump.c -libc-$(CONFIG_LP_LIBC) += die.c -libc-$(CONFIG_LP_LIBC) += coreboot.c -libc-$(CONFIG_LP_LIBC) += fmap.c -libc-$(CONFIG_LP_LIBC) += fpmath.c - -ifeq ($(CONFIG_LP_VBOOT_LIB),y) -libc-$(CONFIG_LP_LIBC) += lp_vboot.c -endif - -ifeq ($(CONFIG_LP_LIBC),y) -libc-srcs += $(coreboottop)/src/commonlib/bsd/elog.c -libc-srcs += $(coreboottop)/src/commonlib/bsd/gcd.c -endif diff --git a/payloads/libpayload/libc/Makefile.mk b/payloads/libpayload/libc/Makefile.mk new file mode 100644 index 0000000000..2d277da3b5 --- /dev/null +++ b/payloads/libpayload/libc/Makefile.mk @@ -0,0 +1,50 @@ +## +## +## Copyright (C) 2008 Advanced Micro Devices, Inc. +## Copyright (C) 2008 coresystems GmbH +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +libc-$(CONFIG_LP_LIBC) += malloc.c printf.c console.c string.c +libc-$(CONFIG_LP_LIBC) += memory.c ctype.c ipchecksum.c lib.c libgcc.c +libc-$(CONFIG_LP_LIBC) += rand.c time.c exec.c +libc-$(CONFIG_LP_LIBC) += readline.c getopt_long.c sysinfo.c +libc-$(CONFIG_LP_LIBC) += args.c +libc-$(CONFIG_LP_LIBC) += strlcpy.c +libc-$(CONFIG_LP_LIBC) += qsort.c +libc-$(CONFIG_LP_LIBC) += hexdump.c +libc-$(CONFIG_LP_LIBC) += die.c +libc-$(CONFIG_LP_LIBC) += coreboot.c +libc-$(CONFIG_LP_LIBC) += fmap.c +libc-$(CONFIG_LP_LIBC) += fpmath.c + +ifeq ($(CONFIG_LP_VBOOT_LIB),y) +libc-$(CONFIG_LP_LIBC) += lp_vboot.c +endif + +ifeq ($(CONFIG_LP_LIBC),y) +libc-srcs += $(coreboottop)/src/commonlib/bsd/elog.c +libc-srcs += $(coreboottop)/src/commonlib/bsd/gcd.c +endif diff --git a/payloads/libpayload/libcbfs/Makefile.inc b/payloads/libpayload/libcbfs/Makefile.inc deleted file mode 100644 index 53e6f7fa43..0000000000 --- a/payloads/libpayload/libcbfs/Makefile.inc +++ /dev/null @@ -1,36 +0,0 @@ -## -## -## Copyright (C) 2011 secunet Security Networks AG -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -libcbfs-$(CONFIG_LP_CBFS) += cbfs.c -libcbfs-$(CONFIG_LP_CBFS) += ram_media.c -libcbfs-$(CONFIG_LP_CBFS) += cbfs_legacy.c - -ifeq ($(CONFIG_LP_CBFS),y) -libcbfs-srcs += $(coreboottop)/src/commonlib/bsd/cbfs_private.c -libcbfs-srcs += $(coreboottop)/src/commonlib/bsd/cbfs_mcache.c -endif diff --git a/payloads/libpayload/libcbfs/Makefile.mk b/payloads/libpayload/libcbfs/Makefile.mk new file mode 100644 index 0000000000..53e6f7fa43 --- /dev/null +++ b/payloads/libpayload/libcbfs/Makefile.mk @@ -0,0 +1,36 @@ +## +## +## Copyright (C) 2011 secunet Security Networks AG +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +libcbfs-$(CONFIG_LP_CBFS) += cbfs.c +libcbfs-$(CONFIG_LP_CBFS) += ram_media.c +libcbfs-$(CONFIG_LP_CBFS) += cbfs_legacy.c + +ifeq ($(CONFIG_LP_CBFS),y) +libcbfs-srcs += $(coreboottop)/src/commonlib/bsd/cbfs_private.c +libcbfs-srcs += $(coreboottop)/src/commonlib/bsd/cbfs_mcache.c +endif diff --git a/payloads/libpayload/liblz4/Makefile.inc b/payloads/libpayload/liblz4/Makefile.inc deleted file mode 100644 index 272a5a5c46..0000000000 --- a/payloads/libpayload/liblz4/Makefile.inc +++ /dev/null @@ -1,28 +0,0 @@ -## -## Copyright 2015 Google Inc. -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -liblz4-$(CONFIG_LP_LZ4) += lz4_wrapper.c diff --git a/payloads/libpayload/liblz4/Makefile.mk b/payloads/libpayload/liblz4/Makefile.mk new file mode 100644 index 0000000000..272a5a5c46 --- /dev/null +++ b/payloads/libpayload/liblz4/Makefile.mk @@ -0,0 +1,28 @@ +## +## Copyright 2015 Google Inc. +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +liblz4-$(CONFIG_LP_LZ4) += lz4_wrapper.c diff --git a/payloads/libpayload/liblzma/Makefile.inc b/payloads/libpayload/liblzma/Makefile.inc deleted file mode 100644 index 5aef5c33ab..0000000000 --- a/payloads/libpayload/liblzma/Makefile.inc +++ /dev/null @@ -1,29 +0,0 @@ -## -## -## Copyright (C) 2011 secunet Security Networks AG -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -liblzma-$(CONFIG_LP_LZMA) += lzma.c diff --git a/payloads/libpayload/liblzma/Makefile.mk b/payloads/libpayload/liblzma/Makefile.mk new file mode 100644 index 0000000000..5aef5c33ab --- /dev/null +++ b/payloads/libpayload/liblzma/Makefile.mk @@ -0,0 +1,29 @@ +## +## +## Copyright (C) 2011 secunet Security Networks AG +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +liblzma-$(CONFIG_LP_LZMA) += lzma.c diff --git a/payloads/libpayload/libpci/Makefile.inc b/payloads/libpayload/libpci/Makefile.inc deleted file mode 100644 index 43574e8c97..0000000000 --- a/payloads/libpayload/libpci/Makefile.inc +++ /dev/null @@ -1,29 +0,0 @@ -## -## -## Copyright (C) 2010 coresystems GmbH -## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. -## 3. The name of the author may not be used to endorse or promote products -## derived from this software without specific prior written permission. -## -## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -## SUCH DAMAGE. -## - -libpci-y += libpci.c diff --git a/payloads/libpayload/libpci/Makefile.mk b/payloads/libpayload/libpci/Makefile.mk new file mode 100644 index 0000000000..43574e8c97 --- /dev/null +++ b/payloads/libpayload/libpci/Makefile.mk @@ -0,0 +1,29 @@ +## +## +## Copyright (C) 2010 coresystems GmbH +## +## Redistribution and use in source and binary forms, with or without +## modification, are permitted provided that the following conditions +## are met: +## 1. Redistributions of source code must retain the above copyright +## notice, this list of conditions and the following disclaimer. +## 2. Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimer in the +## documentation and/or other materials provided with the distribution. +## 3. The name of the author may not be used to endorse or promote products +## derived from this software without specific prior written permission. +## +## THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +## ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +## ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +## FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +## DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +## OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +## HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +## LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +## OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +## SUCH DAMAGE. +## + +libpci-y += libpci.c diff --git a/payloads/libpayload/tests/Makefile.inc b/payloads/libpayload/tests/Makefile.inc deleted file mode 100644 index dede3404c5..0000000000 --- a/payloads/libpayload/tests/Makefile.inc +++ /dev/null @@ -1,321 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -testsrc := $(top)/tests - -# Place the build output in one of two places depending on COV, so that code -# built with code coverage never mixes with code built without code coverage. -ifeq ($(COV),1) -testobj := $(obj)/coverage -else -testobj := $(obj)/tests -endif -coverage-dir := $(testobj)/coverage_reports - -cmockasrc := $(coreboottop)/3rdparty/cmocka -cmockaobj := $(objutil)/cmocka -CMOCKA_LIB := $(cmockaobj)/src/libcmocka.so - -CMAKE := cmake - -TEST_DEFAULT_CONFIG := $(top)/configs/config.unit-tests -TEST_DOTCONFIG := $(testobj)/.config -TEST_KCONFIG_AUTOHEADER := $(testobj)/libpayload-config.src.h -TEST_KCONFIG_AUTOCONFIG := $(testobj)/auto.conf -TEST_KCONFIG_DEPENDENCIES := $(testobj)/auto.conf.cmd -TEST_KCONFIG_SPLITCONFIG := $(testobj)/config/ -TEST_KCONFIG_TRISTATE := $(testobj)/tristate.conf -TEST_KCONFIG_NEGATIVES := 1 -TEST_KBUILD_KCONFIG := $(top)/Kconfig -TEST_CONFIG_ := CONFIG_LP_ - - -# Default includes -TEST_CFLAGS := -include include/kconfig.h -TEST_CFLAGS += -include $(coreboottop)/src/commonlib/bsd/include/commonlib/bsd/compiler.h -TEST_CFLAGS += -Iinclude -Iinclude/mock -TEST_CFLAGS += -I$(coreboottop)/src/commonlib/bsd/include -TEST_CFLAGS += -I$(dir $(TEST_KCONFIG_AUTOHEADER)) -TEST_CFLAGS += -I$(VBOOT_SOURCE)/firmware/include - -# Test specific includes -TEST_CFLAGS += -I$(testsrc)/include -TEST_CFLAGS += -I$(cmockasrc)/include - -# Minimal subset of warnings and errors. Tests can be less strict than actual build. -TEST_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wvla -TEST_CFLAGS += -Wwrite-strings -Wno-trigraphs -Wimplicit-fallthrough -TEST_CFLAGS += -Wstrict-aliasing -Wshadow -Werror -TEST_CFLAGS += -Wno-unknown-warning-option -Wno-source-mgr -Wno-main-return-type - -TEST_CFLAGS += -std=gnu11 -Os -ffunction-sections -fdata-sections -fno-builtin - -# Make unit-tests detectable by the code -TEST_CFLAGS += -D__TEST__ - -# Link against CMocka -TEST_LDFLAGS := -L$(dir $(CMOCKA_LIB)) -lcmocka -Wl,-rpath=$(dir $(CMOCKA_LIB)) - -TEST_LDFLAGS += -Wl,--gc-sections - -# Disable userspace relocations -TEST_CFLAGS += -fno-pie -fno-pic -TEST_LDFLAGS += -no-pie - -ifeq ($(COV),1) -TEST_CFLAGS += --coverage -TEST_LDFLAGS += --coverage -endif - - -# Extra attributes for unit tests. Declated per each test. Only `srcs` is required. -attributes := cflags config mocks srcs - -alltests := -subdirs := tests/crypto tests/curses tests/drivers tests/gdb tests/libc tests/libcbfs -subdirs += tests/liblz4 tests/liblzma tests/libpci - -define tests-handler -alltests += $(1)$(2) -$(foreach attribute,$(attributes), \ - $(eval $(1)$(2)-$(attribute) += $($(2)-$(attribute)))) -$(foreach attribute,$(attributes), \ - $(eval $(2)-$(attribute) := )) -endef - -# Copy attributes of one test to another -# $1 - input test name -# $2 - output test name -copy-test = $(foreach attribute,$(attributes), \ - $(eval $(strip $(2))-$(attribute) := $($(strip $(1))-$(attribute)))) - -$(call add-special-class,tests) -$(call evaluate_subdirs) - -# Create actual targets for unit test binaries -# $1 - test name -define TEST_CC_template - -# Generate custom config.h redefining given config symbols, and declaring mocked -# functions weak. It is important that the compiler already sees that they are -# weak (and they aren't just turned weak at a later stage) to prevent certain -# optimizations that would break if the function gets replaced. (For clang this -# file needs to be marked `system_header` to prevent it from warning about -# `#pragma weak` entries without a matching function declaration, since there is -# no -Wno-xxx commandline for that.) -$(1)-config-file := $(testobj)/$(1)/libpayload-config.h -$$($(1)-config-file): $(TEST_KCONFIG_AUTOHEADER) - mkdir -p $$(dir $$@); - printf '// File generated by tests/Makefile.inc\n// Do not change\n' > $$@; - printf '#ifndef TEST_LIBPAYLOAD_CONFIG_H_\n' >> $$@; - printf '#define TEST_LIBPAYLOAD_CONFIG_H_\n' >> $$@; - printf '#include <%s>\n\n' "$(notdir $(TEST_KCONFIG_AUTOHEADER))" >> $$@; - for kv in $$($(1)-config); do \ - key="`echo $$$$kv | cut -d '=' -f -1`"; \ - value="`echo $$$$kv | cut -d '=' -f 2-`"; \ - printf '#undef %s\n' "$$$$key" >> $$@; \ - printf '#define %s %s\n\n' "$$$$key" "$$$$value" >> $$@; \ - done - printf '#ifdef __clang__\n' >> $$@; - printf '#pragma clang system_header\n' >> $$@; - printf '#endif\n\n' >> $$@; - printf '#ifdef __TEST_SRCOBJ__\n' >> $$@; - for m in $$($(1)-mocks); do \ - printf '#pragma weak %s\n' "$$$$m" >> $$@; \ - done - printf '#endif\n\n' >> $$@; - printf '#endif\n' >> $$@; - -$($(1)-objs): TEST_CFLAGS += -I$$(dir $$($(1)-config-file)) \ - -D__TEST_NAME__=\"$(subst /,_,$(1))\" - -# Give us a way to distinguish between libpayload source files and test files in the code. -$($(1)-srcobjs): TEST_CFLAGS += -D__TEST_SRCOBJ__ - -# Compile sources and apply mocking/wrapping for selected symbols. -# For each listed mock add new symbol with prefix `__real_`, -# pointing to the same section:address. This will keep original -# function accessible if required. -$($(1)-objs): $(testobj)/$(1)/%.o: $$$$*.c $$($(1)-config-file) - mkdir -p $$(dir $$@) - $(HOSTCC) $$(TEST_CFLAGS) $($(1)-cflags) -MMD \ - -MF $$(basename $$@).d -MT $$@ -c $$< -o $$@.orig - objcopy_wrap_flags=''; \ - for sym in $$($(1)-mocks); do \ - sym_line="$$$$($(HOSTOBJDUMP) -t $$@.orig \ - | grep -E "[0-9a-fA-F]+\\s+w\\s+F\\s+.*\\s+$$$$sym$$$$")"; \ - if [ ! -z "$$$$sym_line" ] ; then \ - addr="$$$$(echo "$$$$sym_line" | awk '{ print $$$$1 }')"; \ - section="$$$$(echo "$$$$sym_line" | awk '{ print $$$$(NF - 2) }')"; \ - objcopy_wrap_flags="$$$$objcopy_wrap_flags --add-symbol __real_$$$${sym}=$$$${section}:0x$$$${addr},function,global"; \ - fi \ - done ; \ - $(HOSTOBJCOPY) $$@.orig $$$$objcopy_wrap_flags $$@ - -$($(1)-bin): $($(1)-objs) $(CMOCKA_LIB) - $(HOSTCC) $$^ $($(1)-cflags) $$(TEST_LDFLAGS) -o $$@ - -endef - -$(foreach test,$(alltests), \ - $(eval $(test)-srcobjs := $(addprefix $(testobj)/$(test)/, \ - $(patsubst %.c,%.o,$(filter-out tests/%,$($(test)-srcs))))) \ - $(eval $(test)-objs := $(addprefix $(testobj)/$(test)/, \ - $(patsubst %.c,%.o,$($(test)-srcs)))) \ - $(eval $(test)-bin := $(testobj)/$(test)/run)) -$(foreach test,$(alltests), \ - $(eval $(call TEST_CC_template,$(test)))) -$(foreach test,$(alltests), \ - $(eval all-test-objs += $($(test)-objs)) \ - $(eval test-bins += $($(test)-bin))) - -DEPENDENCIES += $(addsuffix .d,$(basename $(all-test-objs))) --include $(DEPENDENCIES) - -# Build CMocka -$(CMOCKA_LIB): - echo "*** Building CMOCKA ***" - mkdir -p $(cmockaobj) - cd $(cmockaobj) && $(CMAKE) $(abspath $(cmockasrc)) - $(MAKE) -C $(cmockaobj) - -# Kconfig targets -$(TEST_DOTCONFIG): - mkdir -p $(dir $@) - cp $(TEST_DEFAULT_CONFIG) $(TEST_DOTCONFIG) - -$(TEST_KCONFIG_AUTOHEADER): TEST_KCONFIG_FLAGS := DOTCONFIG=$(TEST_DOTCONFIG) \ - KCONFIG_AUTOHEADER=$(TEST_KCONFIG_AUTOHEADER) \ - KCONFIG_AUTOCONFIG=$(TEST_KCONFIG_AUTOCONFIG) \ - KCONFIG_DEPENDENCIES=$(TEST_KCONFIG_DEPENDENCIES) \ - KCONFIG_SPLITCONFIG=$(TEST_KCONFIG_SPLITCONFIG) \ - KCONFIG_TRISTATE=$(TEST_KCONFIG_TRISTATE) \ - KCONFIG_NEGATIVES=$(TEST_KCONFIG_NEGATIVES) \ - KBUILD_KCONFIG=$(TEST_KBUILD_KCONFIG) \ - KBUILD_DEFCONFIG=$(TEST_DEFAULT_CONFIG) \ - CONFIG_=$(TEST_CONFIG_) - -$(TEST_KCONFIG_AUTOHEADER): $(TEST_DOTCONFIG) $(objk)/conf - mkdir -p $(dir $@) - $(MAKE) $(TEST_KCONFIG_FLAGS) olddefconfig V=$(V) - $(MAKE) $(TEST_KCONFIG_FLAGS) syncconfig V=$(V) - -$(TEST_KCONFIG_AUTOCONFIG): $(TEST_KCONFIG_AUTOHEADER) - true - -.PHONY: $(alltests) $(addprefix clean-,$(alltests)) $(addprefix try-,$(alltests)) -.PHONY: $(addprefix build-,$(alltests)) $(addprefix run-,$(alltests)) -.PHONY: unit-tests build-unit-tests run-unit-tests clean-unit-tests -.PHONY: junit.xml-unit-tests clean-junit.xml-unit-tests - -ifeq ($(JUNIT_OUTPUT),y) -$(addprefix run-,$(alltests)): export CMOCKA_MESSAGE_OUTPUT=xml -$(addprefix run-,$(alltests)): export CMOCKA_XML_FILE=$(testobj)/junit-libpayload-%g.xml -endif - -$(addprefix run-,$(alltests)): run-%: $$(%-bin) - rm -f $(testobj)/junit-libpayload-$(subst /,_,$(patsubst $(testobj)/%/,%,$(dir $^)))\(*\).xml - rm -f $(testobj)/$(subst /,_,$^).failed - -$^ || echo failed > $(testobj)/$(subst /,_,$^).failed - -$(addprefix build-,$(alltests)): build-%: $$(%-bin) - -$(alltests): run-$$(@) - -$(addprefix try-,$(alltests)): try-%: clean-% $(CMOCKA_LIB) $(TEST_KCONFIG_AUTOCONFIG) - mkdir -p $(testobj)/$* - echo "" >> $(testobj)/$*.tmp; \ - $(MAKE) V=$(V) Q=$(Q) COV=$(COV) JUNIT_OUTPUT=y "build-$*" >> $(testobj)/$*.tmp.2 2>&1 \ - && type="system-out" || type="failure"; \ - if [ $$type = "failure" ]; then \ - echo "" >> $(testobj)/$*.tmp; \ - else \ - echo "<$$type>" >> $(testobj)/$*.tmp; \ - fi; \ - echo '> $(testobj)/$*.tmp; \ - cat $(testobj)/$*.tmp.2 >> $(testobj)/$*.tmp; \ - echo "]]>" >> $(testobj)/$*.tmp; \ - rm -f $(testobj)/$*.tmp.2; \ - echo "" >> $(testobj)/$*.tmp; \ - if [ $$type != 'failure' ]; then \ - $(MAKE) V=$(V) Q=$(Q) COV=$(COV) JUNIT_OUTPUT=y "run-$*"; \ - fi - - -TESTS_BUILD_XML_FILE := $(testobj)/junit-libpayload-tests-build.xml - -$(TESTS_BUILD_XML_FILE): clean-junit.xml-unit-tests $(addprefix try-,$(alltests)) - mkdir -p $(dir $@) - echo '' > $@ - for tst in $(alltests); do \ - cat $(testobj)/$$tst.tmp >> $@; \ - done - echo "" >> $@ - -junit.xml-unit-tests: $(TESTS_BUILD_XML_FILE) - -clean-junit.xml-unit-tests: - rm -f $(TESTS_BUILD_XML_FILE) - - -# Build a code coverage report by collecting all the gcov files into a single -# report. If COV is not set, this might be a user error, and they're trying -# to generate a coverage report without first having built and run the code -# with code coverage. absence of COV=1 will be corrected. - -.PHONY: coverage-report clean-coverage-report - -ifeq ($(COV),1) -coverage-report: - lcov -o $(testobj)/tests.info -c -d $(testobj) --exclude '$(testsrc)/*' - genhtml -q -o $(coverage-dir) -t "coreboot unit tests" -s $(testobj)/tests.info - -clean-coverage-report: - rm -Rf $(coverage-dir) -else -coverage-report: - COV=1 V=$(V) $(MAKE) coverage-report - -clean-coverage-report: - COV=1 V=$(V) $(MAKE) clean-coverage-report -endif - -unit-tests: build-unit-tests run-unit-tests - -build-unit-tests: $(test-bins) - -run-unit-tests: $(alltests) - if [ `find $(testobj) -name '*.failed' | wc -l` -gt 0 ]; then \ - echo "**********************"; \ - echo " TESTS FAILED"; \ - echo "**********************"; \ - exit 1; \ - else \ - echo "**********************"; \ - echo " ALL TESTS PASSED"; \ - echo "**********************"; \ - exit 0; \ - fi - -$(addprefix clean-,$(alltests)): clean-%: - rm -rf $(testobj)/$* - -clean-unit-tests: - rm -rf $(testobj) - -list-unit-tests: - @echo "unit-tests:" - for t in $(sort $(alltests)); do \ - echo " $$t"; \ - done - -help-unit-tests help:: - @echo '*** libpayload unit-tests targets ***' - @echo ' Use "COV=1 make [target]" to enable code coverage for unit tests' - @echo ' unit-tests - Run all unit-tests from tests/' - @echo ' clean-unit-tests - Remove unit-tests build artifacts' - @echo ' list-unit-tests - List all unit-tests' - @echo ' - Build and run single unit-test' - @echo ' clean- - Remove single unit-test build artifacts' - @echo ' coverage-report - Generate a code coverage report' - @echo ' clean-coverage-report - Remove the code coverage report' - @echo diff --git a/payloads/libpayload/tests/Makefile.mk b/payloads/libpayload/tests/Makefile.mk new file mode 100644 index 0000000000..e271a7cea8 --- /dev/null +++ b/payloads/libpayload/tests/Makefile.mk @@ -0,0 +1,321 @@ +# SPDX-License-Identifier: GPL-2.0-only + +testsrc := $(top)/tests + +# Place the build output in one of two places depending on COV, so that code +# built with code coverage never mixes with code built without code coverage. +ifeq ($(COV),1) +testobj := $(obj)/coverage +else +testobj := $(obj)/tests +endif +coverage-dir := $(testobj)/coverage_reports + +cmockasrc := $(coreboottop)/3rdparty/cmocka +cmockaobj := $(objutil)/cmocka +CMOCKA_LIB := $(cmockaobj)/src/libcmocka.so + +CMAKE := cmake + +TEST_DEFAULT_CONFIG := $(top)/configs/config.unit-tests +TEST_DOTCONFIG := $(testobj)/.config +TEST_KCONFIG_AUTOHEADER := $(testobj)/libpayload-config.src.h +TEST_KCONFIG_AUTOCONFIG := $(testobj)/auto.conf +TEST_KCONFIG_DEPENDENCIES := $(testobj)/auto.conf.cmd +TEST_KCONFIG_SPLITCONFIG := $(testobj)/config/ +TEST_KCONFIG_TRISTATE := $(testobj)/tristate.conf +TEST_KCONFIG_NEGATIVES := 1 +TEST_KBUILD_KCONFIG := $(top)/Kconfig +TEST_CONFIG_ := CONFIG_LP_ + + +# Default includes +TEST_CFLAGS := -include include/kconfig.h +TEST_CFLAGS += -include $(coreboottop)/src/commonlib/bsd/include/commonlib/bsd/compiler.h +TEST_CFLAGS += -Iinclude -Iinclude/mock +TEST_CFLAGS += -I$(coreboottop)/src/commonlib/bsd/include +TEST_CFLAGS += -I$(dir $(TEST_KCONFIG_AUTOHEADER)) +TEST_CFLAGS += -I$(VBOOT_SOURCE)/firmware/include + +# Test specific includes +TEST_CFLAGS += -I$(testsrc)/include +TEST_CFLAGS += -I$(cmockasrc)/include + +# Minimal subset of warnings and errors. Tests can be less strict than actual build. +TEST_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wvla +TEST_CFLAGS += -Wwrite-strings -Wno-trigraphs -Wimplicit-fallthrough +TEST_CFLAGS += -Wstrict-aliasing -Wshadow -Werror +TEST_CFLAGS += -Wno-unknown-warning-option -Wno-source-mgr -Wno-main-return-type + +TEST_CFLAGS += -std=gnu11 -Os -ffunction-sections -fdata-sections -fno-builtin + +# Make unit-tests detectable by the code +TEST_CFLAGS += -D__TEST__ + +# Link against CMocka +TEST_LDFLAGS := -L$(dir $(CMOCKA_LIB)) -lcmocka -Wl,-rpath=$(dir $(CMOCKA_LIB)) + +TEST_LDFLAGS += -Wl,--gc-sections + +# Disable userspace relocations +TEST_CFLAGS += -fno-pie -fno-pic +TEST_LDFLAGS += -no-pie + +ifeq ($(COV),1) +TEST_CFLAGS += --coverage +TEST_LDFLAGS += --coverage +endif + + +# Extra attributes for unit tests. Declated per each test. Only `srcs` is required. +attributes := cflags config mocks srcs + +alltests := +subdirs := tests/crypto tests/curses tests/drivers tests/gdb tests/libc tests/libcbfs +subdirs += tests/liblz4 tests/liblzma tests/libpci + +define tests-handler +alltests += $(1)$(2) +$(foreach attribute,$(attributes), \ + $(eval $(1)$(2)-$(attribute) += $($(2)-$(attribute)))) +$(foreach attribute,$(attributes), \ + $(eval $(2)-$(attribute) := )) +endef + +# Copy attributes of one test to another +# $1 - input test name +# $2 - output test name +copy-test = $(foreach attribute,$(attributes), \ + $(eval $(strip $(2))-$(attribute) := $($(strip $(1))-$(attribute)))) + +$(call add-special-class,tests) +$(call evaluate_subdirs) + +# Create actual targets for unit test binaries +# $1 - test name +define TEST_CC_template + +# Generate custom config.h redefining given config symbols, and declaring mocked +# functions weak. It is important that the compiler already sees that they are +# weak (and they aren't just turned weak at a later stage) to prevent certain +# optimizations that would break if the function gets replaced. (For clang this +# file needs to be marked `system_header` to prevent it from warning about +# `#pragma weak` entries without a matching function declaration, since there is +# no -Wno-xxx commandline for that.) +$(1)-config-file := $(testobj)/$(1)/libpayload-config.h +$$($(1)-config-file): $(TEST_KCONFIG_AUTOHEADER) + mkdir -p $$(dir $$@); + printf '// File generated by tests/Makefile.mk\n// Do not change\n' > $$@; + printf '#ifndef TEST_LIBPAYLOAD_CONFIG_H_\n' >> $$@; + printf '#define TEST_LIBPAYLOAD_CONFIG_H_\n' >> $$@; + printf '#include <%s>\n\n' "$(notdir $(TEST_KCONFIG_AUTOHEADER))" >> $$@; + for kv in $$($(1)-config); do \ + key="`echo $$$$kv | cut -d '=' -f -1`"; \ + value="`echo $$$$kv | cut -d '=' -f 2-`"; \ + printf '#undef %s\n' "$$$$key" >> $$@; \ + printf '#define %s %s\n\n' "$$$$key" "$$$$value" >> $$@; \ + done + printf '#ifdef __clang__\n' >> $$@; + printf '#pragma clang system_header\n' >> $$@; + printf '#endif\n\n' >> $$@; + printf '#ifdef __TEST_SRCOBJ__\n' >> $$@; + for m in $$($(1)-mocks); do \ + printf '#pragma weak %s\n' "$$$$m" >> $$@; \ + done + printf '#endif\n\n' >> $$@; + printf '#endif\n' >> $$@; + +$($(1)-objs): TEST_CFLAGS += -I$$(dir $$($(1)-config-file)) \ + -D__TEST_NAME__=\"$(subst /,_,$(1))\" + +# Give us a way to distinguish between libpayload source files and test files in the code. +$($(1)-srcobjs): TEST_CFLAGS += -D__TEST_SRCOBJ__ + +# Compile sources and apply mocking/wrapping for selected symbols. +# For each listed mock add new symbol with prefix `__real_`, +# pointing to the same section:address. This will keep original +# function accessible if required. +$($(1)-objs): $(testobj)/$(1)/%.o: $$$$*.c $$($(1)-config-file) + mkdir -p $$(dir $$@) + $(HOSTCC) $$(TEST_CFLAGS) $($(1)-cflags) -MMD \ + -MF $$(basename $$@).d -MT $$@ -c $$< -o $$@.orig + objcopy_wrap_flags=''; \ + for sym in $$($(1)-mocks); do \ + sym_line="$$$$($(HOSTOBJDUMP) -t $$@.orig \ + | grep -E "[0-9a-fA-F]+\\s+w\\s+F\\s+.*\\s+$$$$sym$$$$")"; \ + if [ ! -z "$$$$sym_line" ] ; then \ + addr="$$$$(echo "$$$$sym_line" | awk '{ print $$$$1 }')"; \ + section="$$$$(echo "$$$$sym_line" | awk '{ print $$$$(NF - 2) }')"; \ + objcopy_wrap_flags="$$$$objcopy_wrap_flags --add-symbol __real_$$$${sym}=$$$${section}:0x$$$${addr},function,global"; \ + fi \ + done ; \ + $(HOSTOBJCOPY) $$@.orig $$$$objcopy_wrap_flags $$@ + +$($(1)-bin): $($(1)-objs) $(CMOCKA_LIB) + $(HOSTCC) $$^ $($(1)-cflags) $$(TEST_LDFLAGS) -o $$@ + +endef + +$(foreach test,$(alltests), \ + $(eval $(test)-srcobjs := $(addprefix $(testobj)/$(test)/, \ + $(patsubst %.c,%.o,$(filter-out tests/%,$($(test)-srcs))))) \ + $(eval $(test)-objs := $(addprefix $(testobj)/$(test)/, \ + $(patsubst %.c,%.o,$($(test)-srcs)))) \ + $(eval $(test)-bin := $(testobj)/$(test)/run)) +$(foreach test,$(alltests), \ + $(eval $(call TEST_CC_template,$(test)))) +$(foreach test,$(alltests), \ + $(eval all-test-objs += $($(test)-objs)) \ + $(eval test-bins += $($(test)-bin))) + +DEPENDENCIES += $(addsuffix .d,$(basename $(all-test-objs))) +-include $(DEPENDENCIES) + +# Build CMocka +$(CMOCKA_LIB): + echo "*** Building CMOCKA ***" + mkdir -p $(cmockaobj) + cd $(cmockaobj) && $(CMAKE) $(abspath $(cmockasrc)) + $(MAKE) -C $(cmockaobj) + +# Kconfig targets +$(TEST_DOTCONFIG): + mkdir -p $(dir $@) + cp $(TEST_DEFAULT_CONFIG) $(TEST_DOTCONFIG) + +$(TEST_KCONFIG_AUTOHEADER): TEST_KCONFIG_FLAGS := DOTCONFIG=$(TEST_DOTCONFIG) \ + KCONFIG_AUTOHEADER=$(TEST_KCONFIG_AUTOHEADER) \ + KCONFIG_AUTOCONFIG=$(TEST_KCONFIG_AUTOCONFIG) \ + KCONFIG_DEPENDENCIES=$(TEST_KCONFIG_DEPENDENCIES) \ + KCONFIG_SPLITCONFIG=$(TEST_KCONFIG_SPLITCONFIG) \ + KCONFIG_TRISTATE=$(TEST_KCONFIG_TRISTATE) \ + KCONFIG_NEGATIVES=$(TEST_KCONFIG_NEGATIVES) \ + KBUILD_KCONFIG=$(TEST_KBUILD_KCONFIG) \ + KBUILD_DEFCONFIG=$(TEST_DEFAULT_CONFIG) \ + CONFIG_=$(TEST_CONFIG_) + +$(TEST_KCONFIG_AUTOHEADER): $(TEST_DOTCONFIG) $(objk)/conf + mkdir -p $(dir $@) + $(MAKE) $(TEST_KCONFIG_FLAGS) olddefconfig V=$(V) + $(MAKE) $(TEST_KCONFIG_FLAGS) syncconfig V=$(V) + +$(TEST_KCONFIG_AUTOCONFIG): $(TEST_KCONFIG_AUTOHEADER) + true + +.PHONY: $(alltests) $(addprefix clean-,$(alltests)) $(addprefix try-,$(alltests)) +.PHONY: $(addprefix build-,$(alltests)) $(addprefix run-,$(alltests)) +.PHONY: unit-tests build-unit-tests run-unit-tests clean-unit-tests +.PHONY: junit.xml-unit-tests clean-junit.xml-unit-tests + +ifeq ($(JUNIT_OUTPUT),y) +$(addprefix run-,$(alltests)): export CMOCKA_MESSAGE_OUTPUT=xml +$(addprefix run-,$(alltests)): export CMOCKA_XML_FILE=$(testobj)/junit-libpayload-%g.xml +endif + +$(addprefix run-,$(alltests)): run-%: $$(%-bin) + rm -f $(testobj)/junit-libpayload-$(subst /,_,$(patsubst $(testobj)/%/,%,$(dir $^)))\(*\).xml + rm -f $(testobj)/$(subst /,_,$^).failed + -$^ || echo failed > $(testobj)/$(subst /,_,$^).failed + +$(addprefix build-,$(alltests)): build-%: $$(%-bin) + +$(alltests): run-$$(@) + +$(addprefix try-,$(alltests)): try-%: clean-% $(CMOCKA_LIB) $(TEST_KCONFIG_AUTOCONFIG) + mkdir -p $(testobj)/$* + echo "" >> $(testobj)/$*.tmp; \ + $(MAKE) V=$(V) Q=$(Q) COV=$(COV) JUNIT_OUTPUT=y "build-$*" >> $(testobj)/$*.tmp.2 2>&1 \ + && type="system-out" || type="failure"; \ + if [ $$type = "failure" ]; then \ + echo "" >> $(testobj)/$*.tmp; \ + else \ + echo "<$$type>" >> $(testobj)/$*.tmp; \ + fi; \ + echo '> $(testobj)/$*.tmp; \ + cat $(testobj)/$*.tmp.2 >> $(testobj)/$*.tmp; \ + echo "]]>" >> $(testobj)/$*.tmp; \ + rm -f $(testobj)/$*.tmp.2; \ + echo "" >> $(testobj)/$*.tmp; \ + if [ $$type != 'failure' ]; then \ + $(MAKE) V=$(V) Q=$(Q) COV=$(COV) JUNIT_OUTPUT=y "run-$*"; \ + fi + + +TESTS_BUILD_XML_FILE := $(testobj)/junit-libpayload-tests-build.xml + +$(TESTS_BUILD_XML_FILE): clean-junit.xml-unit-tests $(addprefix try-,$(alltests)) + mkdir -p $(dir $@) + echo '' > $@ + for tst in $(alltests); do \ + cat $(testobj)/$$tst.tmp >> $@; \ + done + echo "" >> $@ + +junit.xml-unit-tests: $(TESTS_BUILD_XML_FILE) + +clean-junit.xml-unit-tests: + rm -f $(TESTS_BUILD_XML_FILE) + + +# Build a code coverage report by collecting all the gcov files into a single +# report. If COV is not set, this might be a user error, and they're trying +# to generate a coverage report without first having built and run the code +# with code coverage. absence of COV=1 will be corrected. + +.PHONY: coverage-report clean-coverage-report + +ifeq ($(COV),1) +coverage-report: + lcov -o $(testobj)/tests.info -c -d $(testobj) --exclude '$(testsrc)/*' + genhtml -q -o $(coverage-dir) -t "coreboot unit tests" -s $(testobj)/tests.info + +clean-coverage-report: + rm -Rf $(coverage-dir) +else +coverage-report: + COV=1 V=$(V) $(MAKE) coverage-report + +clean-coverage-report: + COV=1 V=$(V) $(MAKE) clean-coverage-report +endif + +unit-tests: build-unit-tests run-unit-tests + +build-unit-tests: $(test-bins) + +run-unit-tests: $(alltests) + if [ `find $(testobj) -name '*.failed' | wc -l` -gt 0 ]; then \ + echo "**********************"; \ + echo " TESTS FAILED"; \ + echo "**********************"; \ + exit 1; \ + else \ + echo "**********************"; \ + echo " ALL TESTS PASSED"; \ + echo "**********************"; \ + exit 0; \ + fi + +$(addprefix clean-,$(alltests)): clean-%: + rm -rf $(testobj)/$* + +clean-unit-tests: + rm -rf $(testobj) + +list-unit-tests: + @echo "unit-tests:" + for t in $(sort $(alltests)); do \ + echo " $$t"; \ + done + +help-unit-tests help:: + @echo '*** libpayload unit-tests targets ***' + @echo ' Use "COV=1 make [target]" to enable code coverage for unit tests' + @echo ' unit-tests - Run all unit-tests from tests/' + @echo ' clean-unit-tests - Remove unit-tests build artifacts' + @echo ' list-unit-tests - List all unit-tests' + @echo ' - Build and run single unit-test' + @echo ' clean- - Remove single unit-test build artifacts' + @echo ' coverage-report - Generate a code coverage report' + @echo ' clean-coverage-report - Remove the code coverage report' + @echo diff --git a/payloads/libpayload/tests/drivers/Makefile.inc b/payloads/libpayload/tests/drivers/Makefile.inc deleted file mode 100644 index 7705473ef7..0000000000 --- a/payloads/libpayload/tests/drivers/Makefile.inc +++ /dev/null @@ -1,8 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -tests-y += speaker-test - -speaker-test-srcs += tests/drivers/speaker-test.c -speaker-test-mocks += inb -speaker-test-mocks += outb -speaker-test-mocks += arch_ndelay diff --git a/payloads/libpayload/tests/drivers/Makefile.mk b/payloads/libpayload/tests/drivers/Makefile.mk new file mode 100644 index 0000000000..7705473ef7 --- /dev/null +++ b/payloads/libpayload/tests/drivers/Makefile.mk @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0-only + +tests-y += speaker-test + +speaker-test-srcs += tests/drivers/speaker-test.c +speaker-test-mocks += inb +speaker-test-mocks += outb +speaker-test-mocks += arch_ndelay diff --git a/payloads/libpayload/tests/libc/Makefile.inc b/payloads/libpayload/tests/libc/Makefile.inc deleted file mode 100644 index 5f92bdf0a8..0000000000 --- a/payloads/libpayload/tests/libc/Makefile.inc +++ /dev/null @@ -1,3 +0,0 @@ -tests-y += fmap_locate_area-test - -fmap_locate_area-test-srcs += tests/libc/fmap_locate_area-test.c diff --git a/payloads/libpayload/tests/libc/Makefile.mk b/payloads/libpayload/tests/libc/Makefile.mk new file mode 100644 index 0000000000..5f92bdf0a8 --- /dev/null +++ b/payloads/libpayload/tests/libc/Makefile.mk @@ -0,0 +1,3 @@ +tests-y += fmap_locate_area-test + +fmap_locate_area-test-srcs += tests/libc/fmap_locate_area-test.c diff --git a/payloads/libpayload/tests/libcbfs/Makefile.inc b/payloads/libpayload/tests/libcbfs/Makefile.inc deleted file mode 100644 index ad4efedcba..0000000000 --- a/payloads/libpayload/tests/libcbfs/Makefile.inc +++ /dev/null @@ -1,33 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -tests-y += cbfs-lookup-no-fallback-test -tests-y += cbfs-lookup-has-fallback-test -tests-y += cbfs-verification-no-sha512-test -tests-y += cbfs-verification-has-sha512-test -tests-y += cbfs-no-verification-no-sha512-test -tests-y += cbfs-no-verification-has-sha512-test - - -cbfs-lookup-no-fallback-test-srcs += tests/libcbfs/cbfs-lookup-test.c -cbfs-lookup-no-fallback-test-srcs += tests/mocks/cbfs_file_mock.c -cbfs-lookup-no-fallback-test-config += CONFIG_LP_ENABLE_CBFS_FALLBACK=0 -cbfs-lookup-no-fallback-test-config += CONFIG_LP_LZ4=1 -cbfs-lookup-no-fallback-test-config += CONFIG_LP_LZMA=1 - -$(call copy-test,cbfs-lookup-no-fallback-test,cbfs-lookup-has-fallback-test) -cbfs-lookup-has-fallback-test-config += CONFIG_LP_ENABLE_CBFS_FALLBACK=1 - -cbfs-verification-no-sha512-test-srcs += tests/libcbfs/cbfs-verification-test.c -cbfs-verification-no-sha512-test-srcs += tests/mocks/cbfs_file_mock.c -cbfs-verification-no-sha512-test-config += CONFIG_LP_CBFS_VERIFICATION=1 -cbfs-verification-no-sha512-test-config += VB2_SUPPORT_SHA512=0 - -$(call copy-test,cbfs-verification-no-sha512-test,cbfs-verification-has-sha512-test) -cbfs-verification-has-sha512-test-config += VB2_SUPPORT_SHA512=1 - -$(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-no-sha512-test) -cbfs-verification-has-sha512-test-config += CONFIG_LP_CBFS_VERIFICATION=0 - -$(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-has-sha512-test) -cbfs-verification-has-sha512-test-config += CONFIG_LP_CBFS_VERIFICATION=0 -cbfs-verification-has-sha512-test-config += VB2_SUPPORT_SHA512=1 diff --git a/payloads/libpayload/tests/libcbfs/Makefile.mk b/payloads/libpayload/tests/libcbfs/Makefile.mk new file mode 100644 index 0000000000..ad4efedcba --- /dev/null +++ b/payloads/libpayload/tests/libcbfs/Makefile.mk @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: GPL-2.0-only + +tests-y += cbfs-lookup-no-fallback-test +tests-y += cbfs-lookup-has-fallback-test +tests-y += cbfs-verification-no-sha512-test +tests-y += cbfs-verification-has-sha512-test +tests-y += cbfs-no-verification-no-sha512-test +tests-y += cbfs-no-verification-has-sha512-test + + +cbfs-lookup-no-fallback-test-srcs += tests/libcbfs/cbfs-lookup-test.c +cbfs-lookup-no-fallback-test-srcs += tests/mocks/cbfs_file_mock.c +cbfs-lookup-no-fallback-test-config += CONFIG_LP_ENABLE_CBFS_FALLBACK=0 +cbfs-lookup-no-fallback-test-config += CONFIG_LP_LZ4=1 +cbfs-lookup-no-fallback-test-config += CONFIG_LP_LZMA=1 + +$(call copy-test,cbfs-lookup-no-fallback-test,cbfs-lookup-has-fallback-test) +cbfs-lookup-has-fallback-test-config += CONFIG_LP_ENABLE_CBFS_FALLBACK=1 + +cbfs-verification-no-sha512-test-srcs += tests/libcbfs/cbfs-verification-test.c +cbfs-verification-no-sha512-test-srcs += tests/mocks/cbfs_file_mock.c +cbfs-verification-no-sha512-test-config += CONFIG_LP_CBFS_VERIFICATION=1 +cbfs-verification-no-sha512-test-config += VB2_SUPPORT_SHA512=0 + +$(call copy-test,cbfs-verification-no-sha512-test,cbfs-verification-has-sha512-test) +cbfs-verification-has-sha512-test-config += VB2_SUPPORT_SHA512=1 + +$(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-no-sha512-test) +cbfs-verification-has-sha512-test-config += CONFIG_LP_CBFS_VERIFICATION=0 + +$(call copy-test,cbfs-verification-no-sha512-test,cbfs-no-verification-has-sha512-test) +cbfs-verification-has-sha512-test-config += CONFIG_LP_CBFS_VERIFICATION=0 +cbfs-verification-has-sha512-test-config += VB2_SUPPORT_SHA512=1 diff --git a/payloads/libpayload/vboot/Makefile.inc b/payloads/libpayload/vboot/Makefile.inc deleted file mode 100644 index bdc9ad2ad6..0000000000 --- a/payloads/libpayload/vboot/Makefile.inc +++ /dev/null @@ -1,56 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -VBOOT_BUILD_DIR ?= $(abspath $(obj)/external/vboot) -VBOOT_FW_LIB = $(VBOOT_BUILD_DIR)/vboot_fw.a -TLCL_LIB = $(VBOOT_BUILD_DIR)/tlcl.a - -vboot_fw-objs += $(VBOOT_FW_LIB) -tlcl-objs += $(TLCL_LIB) - -kconfig-to-binary=$(if $(strip $(1)),1,0) -vboot-fixup-includes = $(filter -I$(coreboottop)/%, $(1)) \ - $(patsubst -I%,-I$(top)/%,\ - $(patsubst include/%.h,$(top)/include/%.h,\ - $(filter-out -I$(obj),\ - $(filter-out -I$(coreboottop)/%,$(1))))) - -VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_ARM) := arm -VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_X86) := x86 -VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_ARM64) := arm64 - -ifneq ($(CONFIG_LP_ARCH_MOCK),) -VBOOT_FIRMWARE_ARCH-y := mock -else -VBOOT_CFLAGS += $(call vboot-fixup-includes,$(CFLAGS)) -VBOOT_CFLAGS += -I$(abspath $(obj)) -endif - -ifeq ($(VBOOT_FIRMWARE_ARCH-y),) -$(error vboot requires architecture to be set in the configuration) -endif - -# Enable vboot debug by default -VBOOT_CFLAGS += -DVBOOT_DEBUG - -ifeq ($(CONFIG_LP_VBOOT_X86_RSA_ACCELERATION),y) -CPPFLAGS_common += -DVB2_X86_RSA_ACCELERATION -endif - -$(VBOOT_FW_LIB): $(obj)/libpayload-config.h - @printf " MAKE $(subst $(obj)/,,$(@))\n" - +$(Q) FIRMWARE_ARCH="$(VBOOT_FIRMWARE_ARCH-y)" \ - CC="$(CC)" \ - CFLAGS="$(VBOOT_CFLAGS)" \ - $(MAKE) -C "$(VBOOT_SOURCE)" \ - TPM2_MODE=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_TPM2_MODE)) \ - X86_SHA_EXT=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_X86_SHA_EXT)) \ - VB2_X86_RSA_ACCELERATION=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_X86_RSA_ACCELERATION)) \ - ARMV8_CRYPTO_EXT=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_SHA_ARMV8_CE)) \ - UNROLL_LOOPS=1 \ - BUILD="$(VBOOT_BUILD_DIR)" \ - V=$(V) \ - $(VBOOT_BUILD_DIR)/vboot_fw.a tlcl - -$(TLCL_LIB): $(VBOOT_FW_LIB) - -.PHONY: $(VBOOT_FW_LIB) $(TLCL_LIB) diff --git a/payloads/libpayload/vboot/Makefile.mk b/payloads/libpayload/vboot/Makefile.mk new file mode 100644 index 0000000000..bdc9ad2ad6 --- /dev/null +++ b/payloads/libpayload/vboot/Makefile.mk @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: BSD-3-Clause + +VBOOT_BUILD_DIR ?= $(abspath $(obj)/external/vboot) +VBOOT_FW_LIB = $(VBOOT_BUILD_DIR)/vboot_fw.a +TLCL_LIB = $(VBOOT_BUILD_DIR)/tlcl.a + +vboot_fw-objs += $(VBOOT_FW_LIB) +tlcl-objs += $(TLCL_LIB) + +kconfig-to-binary=$(if $(strip $(1)),1,0) +vboot-fixup-includes = $(filter -I$(coreboottop)/%, $(1)) \ + $(patsubst -I%,-I$(top)/%,\ + $(patsubst include/%.h,$(top)/include/%.h,\ + $(filter-out -I$(obj),\ + $(filter-out -I$(coreboottop)/%,$(1))))) + +VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_ARM) := arm +VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_X86) := x86 +VBOOT_FIRMWARE_ARCH-$(CONFIG_LP_ARCH_ARM64) := arm64 + +ifneq ($(CONFIG_LP_ARCH_MOCK),) +VBOOT_FIRMWARE_ARCH-y := mock +else +VBOOT_CFLAGS += $(call vboot-fixup-includes,$(CFLAGS)) +VBOOT_CFLAGS += -I$(abspath $(obj)) +endif + +ifeq ($(VBOOT_FIRMWARE_ARCH-y),) +$(error vboot requires architecture to be set in the configuration) +endif + +# Enable vboot debug by default +VBOOT_CFLAGS += -DVBOOT_DEBUG + +ifeq ($(CONFIG_LP_VBOOT_X86_RSA_ACCELERATION),y) +CPPFLAGS_common += -DVB2_X86_RSA_ACCELERATION +endif + +$(VBOOT_FW_LIB): $(obj)/libpayload-config.h + @printf " MAKE $(subst $(obj)/,,$(@))\n" + +$(Q) FIRMWARE_ARCH="$(VBOOT_FIRMWARE_ARCH-y)" \ + CC="$(CC)" \ + CFLAGS="$(VBOOT_CFLAGS)" \ + $(MAKE) -C "$(VBOOT_SOURCE)" \ + TPM2_MODE=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_TPM2_MODE)) \ + X86_SHA_EXT=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_X86_SHA_EXT)) \ + VB2_X86_RSA_ACCELERATION=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_X86_RSA_ACCELERATION)) \ + ARMV8_CRYPTO_EXT=$(call kconfig-to-binary, $(CONFIG_LP_VBOOT_SHA_ARMV8_CE)) \ + UNROLL_LOOPS=1 \ + BUILD="$(VBOOT_BUILD_DIR)" \ + V=$(V) \ + $(VBOOT_BUILD_DIR)/vboot_fw.a tlcl + +$(TLCL_LIB): $(VBOOT_FW_LIB) + +.PHONY: $(VBOOT_FW_LIB) $(TLCL_LIB) -- cgit v1.2.3