payloads: Replace GPL boilerplate with SPDX headers
Used commands:
perl -i -p0e 's|\/\*[\s*]*.*is free software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and\/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-2.0-only */|' $(cat filelist)
perl -i -p0e 's|\/\*[\s*]*.*is[\s*]*free[\s*]*software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*either[\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License,[\s*]*or[\s*]*.at[\s*]*your[\s*]*option.*[\s*]*any[\s*]*later[\s*]*version.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-2.0-or-later */|' $(cat filelist)
perl -i -p0e 's|\/\*[\s*]*.*is[\s*#]*free[\s*#]*software[;:,][\s*#]*you[\s*#]*can[\s*#]*redistribute[\s*#]*it[\s*#]*and/or[\s*#]*modify[\s*#]*it[\s*#]*under[\s*#]*the[\s*#]*terms[\s*#]*of[\s*#]*the[\s*#]*GNU[\s*#]*General[\s*#]*Public[\s*#]*License[\s*#]*as[\s*#]*published[\s*#]*by[\s*#]*the[\s*#]*Free[\s*#]*Software[\s*#]*Foundation[;:,][\s*#]*either[\s*#]*version[\s*#]*3[\s*#]*of[\s*#]*the[\s*#]*License[;:,][\s*#]*or[\s*#]*.at[\s*#]*your[\s*#]*option.*[\s*#]*any[\s*#]*later[\s*#]*version.[\s*#]*This[\s*#]*program[\s*#]*is[\s*#]*distributed[\s*#]*in[\s*#]*the[\s*#]*hope[\s*#]*that[\s*#]*it[\s*#]*will[\s*#]*be[\s*#]*useful[;:,][\s*#]*but[\s*#]*WITHOUT[\s*#]*ANY[\s*#]*WARRANTY[;:,][\s*#]*without[\s*#]*even[\s*#]*the[\s*#]*implied[\s*#]*warranty[\s*#]*of[\s*#]*MERCHANTABILITY[\s*#]*or[\s*#]*FITNESS[\s*#]*FOR[\s*#]*A[\s*#]*PARTICULAR[\s*#]*PURPOSE.[\s*#]*See[\s*#]*the[\s*#]*GNU[\s*#]*General[\s*#]*Public[\s*#]*License[\s*#]*for[\s*#]*more[\s*#]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-3.0-or-later */|' $(cat filelist)
perl -i -p0e 's|(\#\#*)[\w]*.*is free software[:;][\#\s]*you[\#\s]*can[\#\s]*redistribute[\#\s]*it[\#\s]*and\/or[\#\s]*modify[\#\s]*it[\s\#]*under[\s \#]*the[\s\#]*terms[\s\#]*of[\s\#]*the[\s\#]*GNU[\s\#]*General[\s\#]*Public[\s\#]*License[\s\#]*as[\s\#]*published[\s\#]*by[\s\#]*the[\s\#]*Free[\s\#]*Software[\s\#]*Foundation[;,][\s\#]*version[\s\#]*2[\s\#]*of[\s\#]*the[\s\#]*License.*[\s\#]*This[\s\#]*program[\s\#]*is[\s\#]*distributed[\s\#]*in[\s\#]*the[\s\#]*hope[\s\#]*that[\s\#]*it[\s\#]*will[\#\s]*be[\#\s]*useful,[\#\s]*but[\#\s]*WITHOUT[\#\s]*ANY[\#\s]*WARRANTY;[\#\s]*without[\#\s]*even[\#\s]*the[\#\s]*implied[\#\s]*warranty[\#\s]*of[\#\s]*MERCHANTABILITY[\#\s]*or[\#\s]*FITNESS[\#\s]*FOR[\#\s]*A[\#\s]*PARTICULAR[\#\s]*PURPOSE.[\#\s]*See[\#\s]*the[\#\s]*GNU[\#\s]*General[\#\s]*Public[\#\s]*License[\#\s]*for[\#\s]*more[\#\s]*details.\s(#* *\n)*|\1 SPDX-License-Identifier: GPL-2.0-only\n\n|' $(cat filelist)
perl -i -p0e 's|(\#\#*)[\w*]*.*is free software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and\/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.\s(#* *\n)*|\1 SPDX-License-Identifier: GPL-2.0-only\n\n|' $(cat filelist)
Change-Id: I9f74ed19257bc4234465b8f912deff1b485173f9
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41179
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-05-08 22:50:46 +02:00
|
|
|
## SPDX-License-Identifier: GPL-2.0-only
|
2016-06-03 00:42:29 +02:00
|
|
|
|
|
|
|
# force the shell to bash - the edksetup.sh script doesn't work with dash
|
|
|
|
export SHELL := env bash
|
|
|
|
|
|
|
|
project_name=Tianocore
|
|
|
|
project_dir=$(CURDIR)/tianocore
|
2019-02-21 06:46:15 +01:00
|
|
|
project_git_repo=https://github.com/mrchromebox/edk2
|
|
|
|
project_git_branch=coreboot_fb
|
|
|
|
upstream_git_repo=https://github.com/tianocore/edk2
|
|
|
|
|
2019-07-20 07:06:03 +02:00
|
|
|
ifeq ($(CONFIG_TIANOCORE_UEFIPAYLOAD),y)
|
|
|
|
bootloader=UefiPayloadPkg
|
2020-04-22 09:03:30 +02:00
|
|
|
logo_pkg=MdeModulePkg
|
2020-02-25 04:43:02 +01:00
|
|
|
build_flavor=-D BOOTLOADER=COREBOOT -D PCIE_BASE=$(CONFIG_MMCONF_BASE_ADDRESS) -DPS2_KEYBOARD_ENABLE
|
2019-07-20 07:06:03 +02:00
|
|
|
TAG=upstream/master
|
|
|
|
else
|
|
|
|
bootloader=CorebootPayloadPkg
|
2020-04-22 09:03:30 +02:00
|
|
|
logo_pkg=CorebootPayloadPkg
|
2019-02-21 06:46:15 +01:00
|
|
|
# STABLE revision is MrChromebox's coreboot framebuffer (coreboot_fb) branch
|
2019-07-20 07:06:03 +02:00
|
|
|
TAG=origin/$(project_git_branch)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(CONFIG_TIANOCORE_REVISION_ID),)
|
|
|
|
TAG=$(CONFIG_TIANOCORE_REVISION_ID)
|
|
|
|
endif
|
2016-06-03 00:42:29 +02:00
|
|
|
|
|
|
|
export EDK_TOOLS_PATH=$(project_dir)/BaseTools
|
|
|
|
|
|
|
|
ifeq ($(CONFIG_TIANOCORE_DEBUG),y)
|
|
|
|
BUILD_TYPE=DEBUG
|
|
|
|
else
|
|
|
|
BUILD_TYPE=RELEASE
|
|
|
|
endif
|
|
|
|
|
2018-09-08 02:58:08 +02:00
|
|
|
ifneq ($(CONFIG_TIANOCORE_USE_8254_TIMER), y)
|
|
|
|
TIMER=-DUSE_HPET_TIMER
|
|
|
|
endif
|
|
|
|
|
2016-06-03 00:42:29 +02:00
|
|
|
ifeq ($(CONFIG_TIANOCORE_TARGET_IA32), y)
|
2020-02-25 21:35:45 +01:00
|
|
|
BUILD_STR=-q -a IA32 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
|
2016-06-03 00:42:29 +02:00
|
|
|
else
|
2020-02-25 21:35:45 +01:00
|
|
|
BUILD_STR=-q -a IA32 -a X64 -t COREBOOT -p $(bootloader)/$(bootloader)Ia32X64.dsc -b $(BUILD_TYPE) $(TIMER) $(build_flavor)
|
2016-06-03 00:42:29 +02:00
|
|
|
endif
|
|
|
|
|
2019-02-21 06:46:15 +01:00
|
|
|
all: clean build
|
2016-06-03 00:42:29 +02:00
|
|
|
|
|
|
|
$(project_dir):
|
|
|
|
echo " Cloning $(project_name) from Git"
|
2019-03-01 20:10:26 +01:00
|
|
|
git clone --branch $(project_git_branch) $(project_git_repo) $(project_dir); \
|
2019-02-21 06:46:15 +01:00
|
|
|
cd $(project_dir); \
|
|
|
|
git remote add upstream $(upstream_git_repo)
|
|
|
|
|
|
|
|
update: $(project_dir)
|
|
|
|
cd $(project_dir); \
|
|
|
|
echo " Fetching new commits from the $(project_name) repo"; \
|
|
|
|
git fetch --multiple origin upstream 2>/dev/null; \
|
2019-07-20 07:06:03 +02:00
|
|
|
if ! git rev-parse --verify -q $(TAG) >/dev/null; then \
|
|
|
|
echo " $(TAG) is not a valid git reference"; \
|
2019-02-21 06:46:15 +01:00
|
|
|
exit 1; \
|
2016-06-03 00:42:29 +02:00
|
|
|
fi; \
|
2020-04-22 06:54:42 +02:00
|
|
|
if git status --ignore-submodules=dirty | grep -qv clean; then \
|
2019-07-20 07:06:03 +02:00
|
|
|
echo " Checking out $(project_name) revision $(TAG)"; \
|
|
|
|
git checkout --detach $(TAG); \
|
2019-02-21 06:46:15 +01:00
|
|
|
else \
|
|
|
|
echo " Working directory not clean; will not overwrite"; \
|
2020-04-22 06:54:42 +02:00
|
|
|
fi; \
|
2020-07-03 06:39:23 +02:00
|
|
|
git submodule update --init
|
2016-06-03 00:42:29 +02:00
|
|
|
|
|
|
|
checktools:
|
|
|
|
echo "Checking uuid-dev..."
|
|
|
|
echo "#include <uuid/uuid.h>" > libtest.c
|
|
|
|
echo "int main(int argc, char **argv) { (void) argc; (void) argv; return 0; }" >> libtest.c
|
|
|
|
$(HOSTCC) $(HOSTCCFLAGS) libtest.c -o libtest >/dev/null 2>&1 && echo " found uuid-dev." || \
|
2018-06-16 11:14:16 +02:00
|
|
|
( echo " Not found."; echo "ERROR: please_install uuid-dev (libuuid-devel)"; exit 1 )
|
2016-06-03 00:42:29 +02:00
|
|
|
rm -rf libtest.c libtest
|
|
|
|
echo "Checking nasm..."
|
|
|
|
type nasm > /dev/null 2>&1 && echo " found nasm." || \
|
|
|
|
( echo " Not found."; echo "Error: Please install nasm."; exit 1 )
|
|
|
|
|
2019-02-21 06:46:15 +01:00
|
|
|
build: update checktools
|
2016-06-03 00:42:29 +02:00
|
|
|
unset CC; $(MAKE) -C $(project_dir)/BaseTools
|
2019-07-20 07:06:03 +02:00
|
|
|
echo " build $(project_name) $(TAG)"
|
2020-04-29 22:29:27 +02:00
|
|
|
if [ -n "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" ]; then \
|
2019-02-22 05:41:59 +01:00
|
|
|
echo " Copying custom bootsplash image"; \
|
|
|
|
case "$(CONFIG_TIANOCORE_BOOTSPLASH_FILE)" in \
|
|
|
|
/*) cp $(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
|
2020-04-22 09:03:30 +02:00
|
|
|
$(project_dir)/$(logo_pkg)/Logo/Logo.bmp;; \
|
2019-02-22 05:41:59 +01:00
|
|
|
*) cp $(top)/$(CONFIG_TIANOCORE_BOOTSPLASH_FILE) \
|
2020-04-22 09:03:30 +02:00
|
|
|
$(project_dir)/$(logo_pkg)/Logo/Logo.bmp;; \
|
2019-02-22 05:41:59 +01:00
|
|
|
esac \
|
|
|
|
fi; \
|
2016-06-03 00:42:29 +02:00
|
|
|
cd $(project_dir); \
|
|
|
|
export EDK_TOOLS_PATH=$(project_dir)/BaseTools; \
|
|
|
|
export WORKSPACE=$(project_dir); \
|
|
|
|
. ./edksetup.sh BaseTools; \
|
|
|
|
grep -q "COREBOOT" $(project_dir)/Conf/tools_def.txt; \
|
|
|
|
if [ $$? -ne 0 ]; then \
|
|
|
|
cat ../tools_def.txt >> $(project_dir)/Conf/tools_def.txt; \
|
|
|
|
fi; \
|
|
|
|
build $(BUILD_STR); \
|
2019-07-20 07:06:03 +02:00
|
|
|
mv $(project_dir)/Build/$(bootloader)*/*/FV/UEFIPAYLOAD.fd $(project_dir)/Build/UEFIPAYLOAD.fd; \
|
2020-04-22 09:03:30 +02:00
|
|
|
git checkout $(logo_pkg)/Logo/Logo.bmp > /dev/null 2>&1 || true
|
2016-06-03 00:42:29 +02:00
|
|
|
|
|
|
|
clean:
|
|
|
|
test -d $(project_dir) && (cd $(project_dir); rm -rf Build; rm -f Conf/tools_def.txt) || exit 0
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
rm -rf $(project_dir)
|
|
|
|
|
2019-02-21 06:46:15 +01:00
|
|
|
.PHONY: all update checktools config build clean distclean
|