qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 6/9] roms: add rules to build slof
Date: Mon, 30 Sep 2013 11:12:55 +0200	[thread overview]
Message-ID: <1380532378-22138-7-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1380532378-22138-1-git-send-email-kraxel@redhat.com>

Add some logic to detect cross compilers.  Add support for "make slof",
which should JustWork[tm] if you are on a ppx64 machine or have a ppc64
cross compiler installed somewhere in your path.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 roms/Makefile | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/roms/Makefile b/roms/Makefile
index 9672625..5fcc77d 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -18,6 +18,21 @@ pxe-rom-virtio   efi-rom-virtio   : VID := 1af4
 pxe-rom-virtio   efi-rom-virtio   : DID := 1000
 
 #
+# cross compiler auto detection
+#
+path := $(subst :, ,$(PATH))
+system := $(shell uname -s | tr "A-Z" "a-z")
+
+# first find cross binutils in path
+find-cross-ld = $(firstword $(wildcard $(patsubst %,%/$(1)-*$(system)*-ld,$(path))))
+# then check we have cross gcc too
+find-cross-gcc = $(firstword $(wildcard $(patsubst %ld,%gcc,$(call find-cross-ld,$(1)))))
+# finally strip off path + toolname so we get the prefix
+find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
+
+powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
+
+#
 # EfiRom utility is shipped with edk2 / tianocore, in BaseTools/
 #
 # We need that to combine multiple images (legacy bios,
@@ -37,6 +52,7 @@ default:
 	@echo "  pxerom         -- update nic roms (bios only)"
 	@echo "  efirom         -- update nic roms (bios+efi, this needs"
 	@echo "                    the EfiRom utility from edk2 / tianocore)"
+	@echo "  slof           -- update slof.bin"
 
 bios: config.seabios
 	sh configure-seabios.sh $<
@@ -90,8 +106,14 @@ ipxe/src/config/local/%: config.ipxe.%
 	cp $< $@
 
 
+slof:
+	$(MAKE) $(MAKEFLAGS) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
+	cp SLOF/boot_rom.bin ../pc-bios/slof.bin
+
+
 clean:
 	rm -rf seabios/.config seabios/out
 	$(MAKE) $(MAKEFLAGS) -C vgabios clean
 	rm -f vgabios/VGABIOS-lgpl-latest*
 	$(MAKE) $(MAKEFLAGS) -C ipxe/src veryclean
+	$(MAKE) $(MAKEFLAGS) -C SLOF clean
-- 
1.8.3.1

  parent reply	other threads:[~2013-09-30  9:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30  9:12 [Qemu-devel] [PULL 0/9] roms: various build improvements Gerd Hoffmann
2013-09-30  9:12 ` [Qemu-devel] [PATCH 1/9] roms: add 'make clean' Gerd Hoffmann
2013-09-30  9:12 ` [Qemu-devel] [PATCH 2/9] roms: enable parallel builds for 'make lgplvgabios' Gerd Hoffmann
2013-09-30  9:12 ` [Qemu-devel] [PATCH 3/9] roms: build lgplvgabios isavga variant Gerd Hoffmann
2013-09-30  9:12 ` [Qemu-devel] [PATCH 4/9] roms: parallel ipxe builds Gerd Hoffmann
2013-09-30  9:12 ` [Qemu-devel] [PATCH 5/9] roms: rewrite scripts/refresh-pxe-roms.sh Gerd Hoffmann
2013-09-30  9:12 ` Gerd Hoffmann [this message]
2013-09-30  9:12 ` [Qemu-devel] [PATCH 7/9] roms: enable ipxe cross builds Gerd Hoffmann
2013-09-30  9:12 ` [Qemu-devel] [PATCH 8/9] roms: enable parallel seabios / seavgabios builds Gerd Hoffmann
2013-09-30  9:12 ` [Qemu-devel] [PATCH 9/9] roms: add support for building sgabios Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380532378-22138-7-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).