summaryrefslogtreecommitdiff
path: root/payloads/external/edk2/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/external/edk2/Makefile')
-rw-r--r--payloads/external/edk2/Makefile35
1 files changed, 34 insertions, 1 deletions
diff --git a/payloads/external/edk2/Makefile b/payloads/external/edk2/Makefile
index 27ce4a9507..b241cf9688 100644
--- a/payloads/external/edk2/Makefile
+++ b/payloads/external/edk2/Makefile
@@ -6,7 +6,22 @@ export SHELL := env bash
project_name = edk2
export WORKSPACE := $(CURDIR)/workspace
export EDK2_PATH := $(WORKSPACE)/$(word 3,$(subst /, ,$(CONFIG_EDK2_REPOSITORY)))
+
+ifeq ($(CONFIG_EDK2_USE_EDK2_PLATFORMS),y)
+export EDK2_PLATFORMS_PATH := $(WORKSPACE)/edk2-platforms
+export PACKAGES_PATH := $(EDK2_PATH):\
+ $(EDK2_PLATFORMS_PATH)/Platform/Intel:\
+ $(EDK2_PLATFORMS_PATH)/Silicon/Intel:\
+ $(EDK2_PLATFORMS_PATH)/Features/Intel:\
+ $(EDK2_PLATFORMS_PATH)/Features/Intel/Debugging:\
+ $(EDK2_PLATFORMS_PATH)/Features/Intel/Network:\
+ $(EDK2_PLATFORMS_PATH)/Features/Intel/OutOfBandManagement:\
+ $(EDK2_PLATFORMS_PATH)/Features/Intel/PowerManagement:\
+ $(EDK2_PLATFORMS_PATH)/Features/Intel/SystemInformation:\
+ $(EDK2_PLATFORMS_PATH)/Features/Intel/UserInterface
+else
export PACKAGES_PATH := $(EDK2_PATH)
+endif
OBJCOPY = $(GCC_PREFIX)objcopy
@@ -119,6 +134,23 @@ all: UefiPayloadPkg
$(WORKSPACE):
mkdir $(WORKSPACE)
+$(EDK2_PLATFORMS_PATH): $(WORKSPACE)
+ if [ ! -d "$(EDK2_PLATFORMS_PATH)" ]; then \
+ git clone --recurse-submodules $(CONFIG_EDK2_PLATFORMS_REPOSITORY) $(EDK2_PLATFORMS_PATH) -j5; \
+ fi
+ cd $(EDK2_PLATFORMS_PATH); \
+ if ! git rev-parse --verify -q $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV) >/dev/null; then \
+ echo " $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV) is not a valid git reference"; \
+ exit 1; \
+ fi; \
+ if git status --ignore-submodules=dirty | grep -q "nothing to commit, working tree clean"; then \
+ echo " Checking out edk2-platforms revision $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV)"; \
+ git checkout --detach $(CONFIG_EDK2_PLATFORMS_TAG_OR_REV) -f; \
+ else \
+ echo " Working directory not clean; will not overwrite"; \
+ fi; \
+ git submodule update --init --checkout
+
$(EDK2_PATH): $(WORKSPACE)
if [ ! -d "$(EDK2_PATH)" ]; then \
git clone --recurse-submodules $(CONFIG_EDK2_REPOSITORY) $(EDK2_PATH) -j5; \
@@ -176,6 +208,7 @@ print:
echo " ##### $(project_name) Build Summary #####"
echo " Repository: $(CONFIG_EDK2_REPOSITORY)"
echo " Branch: $(CONFIG_EDK2_TAG_OR_REV)"
+ echo " Packages path: $(PACKAGES_PATH)"
echo " $(BUILD_STR)" | \
sed -e 's/--/-/g' -e 's/-/\n /g' | sort | sed \
-e 's/a /Architecture: /g' \
@@ -187,7 +220,7 @@ print:
-e 's/s /Build: Silent/' \
-e 's/t /Toolchain: /'
-prep: $(EDK2_PATH) clean checktools logo
+prep: $(EDK2_PATH) $(EDK2_PLATFORMS_PATH) clean checktools logo
cd $(WORKSPACE); \
source $(EDK2_PATH)/edksetup.sh; \
unset CC; $(MAKE) -C $(EDK2_PATH)/BaseTools 2>&1; \