From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO2nY-00067E-Ph for qemu-devel@nongnu.org; Mon, 23 Sep 2013 05:51:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VO2nR-00084q-8C for qemu-devel@nongnu.org; Mon, 23 Sep 2013 05:51:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO2nQ-00084e-Vh for qemu-devel@nongnu.org; Mon, 23 Sep 2013 05:51:13 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8N9pC79009206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Sep 2013 05:51:12 -0400 From: Gerd Hoffmann Date: Mon, 23 Sep 2013 11:50:58 +0200 Message-Id: <1379929859-7854-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1379929859-7854-1-git-send-email-kraxel@redhat.com> References: <1379929859-7854-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 6/7] roms: add rules to build slof List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann 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 --- 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