payloads/edk2: Separate the tasks required to build edk2

Separate the tasks that are required to be completed prior to building
edk2 into a prep recipe. This allows this to be used for building
different targets.

This also ensures that the COREBOOT toolchain is used.

Signed-off-by: Sean Rhodes <sean@starlabs.systems>
Change-Id: Ic4ae8ac4118a5747f38297d0fbf4cb53aa3b6d6d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66359
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
This commit is contained in:
Sean Rhodes 2022-08-02 09:07:15 +01:00 committed by Martin Roth
parent 147c9578a1
commit 724c0cd5b4
1 changed files with 7 additions and 3 deletions

View File

@ -170,14 +170,18 @@ print:
-e 's/s /Build: Silent/' \ -e 's/s /Build: Silent/' \
-e 's/t /Toolchain: /' -e 's/t /Toolchain: /'
build: update print logo checktools prep: clean checktools logo update
unset CC; $(MAKE) -C $(EDK2_PATH)/BaseTools 2>&1
cd $(WORKSPACE); \ cd $(WORKSPACE); \
source $(EDK2_PATH)/edksetup.sh BaseTools; \ source $(EDK2_PATH)/edksetup.sh; \
unset CC; $(MAKE) -C $(EDK2_PATH)/BaseTools 2>&1; \
grep -q "COREBOOT" $(EDK2_PATH)/Conf/tools_def.txt; \ grep -q "COREBOOT" $(EDK2_PATH)/Conf/tools_def.txt; \
if [ $$? -ne 0 ]; then \ if [ $$? -ne 0 ]; then \
cat ../tools_def.txt >> $(EDK2_PATH)/Conf/tools_def.txt; \ cat ../tools_def.txt >> $(EDK2_PATH)/Conf/tools_def.txt; \
fi; \ fi; \
build: prep print
cd $(WORKSPACE); \
source $(EDK2_PATH)/edksetup.sh; \
build -b $(RELEASE_STR) $(BUILD_STR); \ build -b $(RELEASE_STR) $(BUILD_STR); \
mkdir -p $(WORKSPACE)/output; \ mkdir -p $(WORKSPACE)/output; \
mv $(WORKSPACE)/Build/UefiPayloadPkgX64/$(RELEASE_STR)_COREBOOT/FV/UEFIPAYLOAD.fd $(WORKSPACE)/output mv $(WORKSPACE)/Build/UefiPayloadPkgX64/$(RELEASE_STR)_COREBOOT/FV/UEFIPAYLOAD.fd $(WORKSPACE)/output