summaryrefslogtreecommitdiff
path: root/payloads/external/skiboot/Makefile
diff options
context:
space:
mode:
authorSergii Dmytruk <sergii.dmytruk@3mdeb.com>2021-10-27 00:23:14 +0300
committerFelix Held <felix-coreboot@felixheld.de>2022-02-16 15:39:19 +0000
commita816c298821ea7d587d615b178754ced8b4660bf (patch)
tree8f6408f0773a86502d8741e2e6b84c70fa5ab7da /payloads/external/skiboot/Makefile
parent8d436cfc1acc7a15cd821e3fb61ad1b0f797a312 (diff)
payloads/external: add skiboot (for QEMU/Power9)
Add an option to build skiboot as a payload. This makes QEMU Power9 board simpler to use as skiboot is necessary anyway. Change-Id: I0b49ea7464c97cc2ff0d5030629deed549851372 Signed-off-by: Igor Bagnucki <igor.bagnucki@3mdeb.com> Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com> Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58656 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Diffstat (limited to 'payloads/external/skiboot/Makefile')
-rw-r--r--payloads/external/skiboot/Makefile36
1 files changed, 36 insertions, 0 deletions
diff --git a/payloads/external/skiboot/Makefile b/payloads/external/skiboot/Makefile
new file mode 100644
index 0000000000..5cf630ea25
--- /dev/null
+++ b/payloads/external/skiboot/Makefile
@@ -0,0 +1,36 @@
+## SPDX-License-Identifier: GPL-2.0-only
+
+build_dir=$(CURDIR)/build
+skiboot_dir=$(CURDIR)/skiboot
+skiboot_git_repo=$(CONFIG_SKIBOOT_GIT_REPO)
+skiboot_revision=$(CONFIG_SKIBOOT_REVISION)
+skiboot_elf=$(build_dir)/skiboot.elf
+skiboot_cross=$(or $(CROSS),powerpc64-linux-gnu-)
+
+unexport $(COREBOOT_EXPORTS)
+
+.PHONY: all clean distclean
+
+all: $(skiboot_elf)
+
+$(skiboot_elf): | $(skiboot_dir) $(build_dir)
+ +$(MAKE) -C $(skiboot_dir) CROSS="$(skiboot_cross)"
+ cp $(skiboot_dir)/skiboot.elf $@
+ # skiboot is always built with debug information due to unconditional -ggdb
+ $(skiboot_cross)strip $@
+
+$(skiboot_dir):
+ git clone $(skiboot_git_repo) $(skiboot_dir)
+ git -C $(skiboot_dir) checkout $(skiboot_revision)
+
+$(build_dir):
+ mkdir -p $(build_dir)
+
+distclean: clean
+ rm -rf $(skiboot_dir)
+
+clean:
+ # Redefine RM because it's used like `$(RM) non-existent-file`
+ # Also ignore useless messages about removing test files
+ [ ! -d $(skiboot_dir) ] || $(MAKE) -C $(skiboot_dir) RM="rm -rf" clean > /dev/null
+ rm -rf $(build_dir)