diff mbox series

[2/5] roms: build the EfiRom utility from the roms/edk2 submodule

Message ID 20190118223400.24311-3-lersek@redhat.com
State New
Headers show
Series add the BiosTablesTest UEFI app, build it with the new roms/edk2 submodule | expand

Commit Message

Laszlo Ersek Jan. 18, 2019, 10:33 p.m. UTC
Building the EfiRom utility from "roms/edk2/BaseTools" should make
"roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
EfiRom for building the combined iPXE option ROMs, but call the sibling
utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
---
 roms/Makefile | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Gerd Hoffmann Jan. 21, 2019, 7:35 a.m. UTC | #1
On Fri, Jan 18, 2019 at 11:33:57PM +0100, Laszlo Ersek wrote:
> Building the EfiRom utility from "roms/edk2/BaseTools" should make
> "roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
> EfiRom for building the combined iPXE option ROMs, but call the sibling
> utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>

> ---
>  roms/Makefile | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/roms/Makefile b/roms/Makefile
> index a6043eff37e9..78d5dd18c301 100644
> --- a/roms/Makefile
> +++ b/roms/Makefile
> @@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>  # We need that to combine multiple images (legacy bios,
>  # efi ia32, efi x64) into a single rom binary.
>  #
> -# We try to find it in the path.  You can also pass the location on
> -# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
> -#
> -EFIROM ?= $(shell which EfiRom 2>/dev/null)
> +EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>  
>  default:
>  	@echo "nothing is build by default"
> @@ -59,8 +56,7 @@ default:
>  	@echo "  vgabios        -- update vgabios binaries (seabios)"
>  	@echo "  sgabios        -- update sgabios binaries"
>  	@echo "  pxerom         -- update nic roms (bios only)"
> -	@echo "  efirom         -- update nic roms (bios+efi, this needs"
> -	@echo "                    the EfiRom utility from edk2 / tianocore)"
> +	@echo "  efirom         -- update nic roms (bios+efi)"
>  	@echo "  slof           -- update slof.bin"
>  	@echo "  skiboot        -- update skiboot.lid"
>  	@echo "  u-boot.e500    -- update u-boot.e500"
> @@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
>  
>  efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
>  
> -efi-rom-%: build-pxe-roms build-efi-roms
> +efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
>  	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
>  		-b ipxe/src/bin/$(VID)$(DID).rom \
>  		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
> @@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
>  		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
>  		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
>  
> +$(EFIROM):
> +	$(MAKE) -C edk2/BaseTools
>  
>  slof:
>  	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
> @@ -150,6 +148,7 @@ clean:
>  	$(MAKE) -C sgabios clean
>  	rm -f sgabios/.depend
>  	$(MAKE) -C ipxe/src veryclean
> +	$(MAKE) -C edk2/BaseTools clean
>  	$(MAKE) -C SLOF clean
>  	rm -rf u-boot/build.e500
>  	$(MAKE) -C u-boot-sam460ex distclean
> -- 
> 2.19.1.3.g30247aa5d201
> 
>
Philippe Mathieu-Daudé Jan. 21, 2019, 11:27 a.m. UTC | #2
Hi Laszlo,

On 1/18/19 11:33 PM, Laszlo Ersek wrote:
> Building the EfiRom utility from "roms/edk2/BaseTools" should make
> "roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
> EfiRom for building the combined iPXE option ROMs, but call the sibling
> utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.
> 
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  roms/Makefile | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/roms/Makefile b/roms/Makefile
> index a6043eff37e9..78d5dd18c301 100644
> --- a/roms/Makefile
> +++ b/roms/Makefile
> @@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>  # We need that to combine multiple images (legacy bios,
>  # efi ia32, efi x64) into a single rom binary.
>  #
> -# We try to find it in the path.  You can also pass the location on
> -# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
> -#
> -EFIROM ?= $(shell which EfiRom 2>/dev/null)
> +EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>  
>  default:
>  	@echo "nothing is build by default"
> @@ -59,8 +56,7 @@ default:
>  	@echo "  vgabios        -- update vgabios binaries (seabios)"
>  	@echo "  sgabios        -- update sgabios binaries"
>  	@echo "  pxerom         -- update nic roms (bios only)"
> -	@echo "  efirom         -- update nic roms (bios+efi, this needs"
> -	@echo "                    the EfiRom utility from edk2 / tianocore)"
> +	@echo "  efirom         -- update nic roms (bios+efi)"
>  	@echo "  slof           -- update slof.bin"
>  	@echo "  skiboot        -- update skiboot.lid"
>  	@echo "  u-boot.e500    -- update u-boot.e500"
> @@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
>  
>  efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
>  
> -efi-rom-%: build-pxe-roms build-efi-roms
> +efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
>  	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
>  		-b ipxe/src/bin/$(VID)$(DID).rom \
>  		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
> @@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
>  		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
>  		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
>  
> +$(EFIROM):
> +	$(MAKE) -C edk2/BaseTools

Since this is a single tool/file, can we simply use:

        $(MAKE) -C edk2/BaseTools/Source/C/EfiRom

>  
>  slof:
>  	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
> @@ -150,6 +148,7 @@ clean:
>  	$(MAKE) -C sgabios clean
>  	rm -f sgabios/.depend
>  	$(MAKE) -C ipxe/src veryclean
> +	$(MAKE) -C edk2/BaseTools clean

Ditto.

>  	$(MAKE) -C SLOF clean
>  	rm -rf u-boot/build.e500
>  	$(MAKE) -C u-boot-sam460ex distclean
> 

Whichever path used:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Philippe Mathieu-Daudé Jan. 21, 2019, 11:37 a.m. UTC | #3
On 1/21/19 12:27 PM, Philippe Mathieu-Daudé wrote:
> Hi Laszlo,
> 
> On 1/18/19 11:33 PM, Laszlo Ersek wrote:
>> Building the EfiRom utility from "roms/edk2/BaseTools" should make
>> "roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
>> EfiRom for building the combined iPXE option ROMs, but call the sibling
>> utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.
>>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Igor Mammedov <imammedo@redhat.com>
>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  roms/Makefile | 13 ++++++-------
>>  1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/roms/Makefile b/roms/Makefile
>> index a6043eff37e9..78d5dd18c301 100644
>> --- a/roms/Makefile
>> +++ b/roms/Makefile
>> @@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>>  # We need that to combine multiple images (legacy bios,
>>  # efi ia32, efi x64) into a single rom binary.
>>  #
>> -# We try to find it in the path.  You can also pass the location on
>> -# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
>> -#
>> -EFIROM ?= $(shell which EfiRom 2>/dev/null)
>> +EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>>  
>>  default:
>>  	@echo "nothing is build by default"
>> @@ -59,8 +56,7 @@ default:
>>  	@echo "  vgabios        -- update vgabios binaries (seabios)"
>>  	@echo "  sgabios        -- update sgabios binaries"
>>  	@echo "  pxerom         -- update nic roms (bios only)"
>> -	@echo "  efirom         -- update nic roms (bios+efi, this needs"
>> -	@echo "                    the EfiRom utility from edk2 / tianocore)"
>> +	@echo "  efirom         -- update nic roms (bios+efi)"
>>  	@echo "  slof           -- update slof.bin"
>>  	@echo "  skiboot        -- update skiboot.lid"
>>  	@echo "  u-boot.e500    -- update u-boot.e500"
>> @@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
>>  
>>  efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
>>  
>> -efi-rom-%: build-pxe-roms build-efi-roms
>> +efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
>>  	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
>>  		-b ipxe/src/bin/$(VID)$(DID).rom \
>>  		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
>> @@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
>>  		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
>>  		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
>>  
>> +$(EFIROM):
>> +	$(MAKE) -C edk2/BaseTools
> 
> Since this is a single tool/file, can we simply use:
> 
>         $(MAKE) -C edk2/BaseTools/Source/C/EfiRom

Also, note that this doesn't work for out-of-tree builds, but this
problem is pre-existent to your series.

> 
>>  
>>  slof:
>>  	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
>> @@ -150,6 +148,7 @@ clean:
>>  	$(MAKE) -C sgabios clean
>>  	rm -f sgabios/.depend
>>  	$(MAKE) -C ipxe/src veryclean
>> +	$(MAKE) -C edk2/BaseTools clean
> 
> Ditto.
> 
>>  	$(MAKE) -C SLOF clean
>>  	rm -rf u-boot/build.e500
>>  	$(MAKE) -C u-boot-sam460ex distclean
>>
> 
> Whichever path used:
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
Laszlo Ersek Jan. 21, 2019, 6:33 p.m. UTC | #4
On 01/21/19 12:27, Philippe Mathieu-Daudé wrote:
> Hi Laszlo,
> 
> On 1/18/19 11:33 PM, Laszlo Ersek wrote:
>> Building the EfiRom utility from "roms/edk2/BaseTools" should make
>> "roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
>> EfiRom for building the combined iPXE option ROMs, but call the sibling
>> utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.
>>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>> Cc: Igor Mammedov <imammedo@redhat.com>
>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>> ---
>>  roms/Makefile | 13 ++++++-------
>>  1 file changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/roms/Makefile b/roms/Makefile
>> index a6043eff37e9..78d5dd18c301 100644
>> --- a/roms/Makefile
>> +++ b/roms/Makefile
>> @@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>>  # We need that to combine multiple images (legacy bios,
>>  # efi ia32, efi x64) into a single rom binary.
>>  #
>> -# We try to find it in the path.  You can also pass the location on
>> -# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
>> -#
>> -EFIROM ?= $(shell which EfiRom 2>/dev/null)
>> +EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>>  
>>  default:
>>  	@echo "nothing is build by default"
>> @@ -59,8 +56,7 @@ default:
>>  	@echo "  vgabios        -- update vgabios binaries (seabios)"
>>  	@echo "  sgabios        -- update sgabios binaries"
>>  	@echo "  pxerom         -- update nic roms (bios only)"
>> -	@echo "  efirom         -- update nic roms (bios+efi, this needs"
>> -	@echo "                    the EfiRom utility from edk2 / tianocore)"
>> +	@echo "  efirom         -- update nic roms (bios+efi)"
>>  	@echo "  slof           -- update slof.bin"
>>  	@echo "  skiboot        -- update skiboot.lid"
>>  	@echo "  u-boot.e500    -- update u-boot.e500"
>> @@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
>>  
>>  efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
>>  
>> -efi-rom-%: build-pxe-roms build-efi-roms
>> +efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
>>  	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
>>  		-b ipxe/src/bin/$(VID)$(DID).rom \
>>  		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
>> @@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
>>  		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
>>  		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
>>  
>> +$(EFIROM):
>> +	$(MAKE) -C edk2/BaseTools
> 
> Since this is a single tool/file, can we simply use:
> 
>         $(MAKE) -C edk2/BaseTools/Source/C/EfiRom

Unfortunately, the BaseTools makefile(s) aren't granular enough for this. They don't track dependencies well enough, at the individual tool level. The above command would fail:

-------
make: Entering directory `/home/lacos/src/upstream/edk2/BaseTools/Source/C/EfiRom'
mkdir ../bin
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/  -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused-result -nostdlib -g -O2  EfiRom.c -o EfiRom.o
gcc -o ../bin/EfiRom   EfiRom.o -L../libs -lCommon
/usr/bin/ld: cannot find -lCommon
collect2: error: ld returned 1 exit status
-------

> 
>>  
>>  slof:
>>  	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
>> @@ -150,6 +148,7 @@ clean:
>>  	$(MAKE) -C sgabios clean
>>  	rm -f sgabios/.depend
>>  	$(MAKE) -C ipxe/src veryclean
>> +	$(MAKE) -C edk2/BaseTools clean
> 
> Ditto.
> 
>>  	$(MAKE) -C SLOF clean
>>  	rm -rf u-boot/build.e500
>>  	$(MAKE) -C u-boot-sam460ex distclean
>>
> 
> Whichever path used:
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> 

thanks!
Laszlo
Laszlo Ersek Jan. 21, 2019, 6:34 p.m. UTC | #5
On 01/21/19 12:37, Philippe Mathieu-Daudé wrote:
> On 1/21/19 12:27 PM, Philippe Mathieu-Daudé wrote:
>> Hi Laszlo,
>>
>> On 1/18/19 11:33 PM, Laszlo Ersek wrote:
>>> Building the EfiRom utility from "roms/edk2/BaseTools" should make
>>> "roms/Makefile" more self-contained. Otherwise, we'd call the system-wide
>>> EfiRom for building the combined iPXE option ROMs, but call the sibling
>>> utilities from "roms/edk2/BaseTools" for building "roms/edk2" content.
>>>
>>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>>> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>>> Cc: Gerd Hoffmann <kraxel@redhat.com>
>>> Cc: Igor Mammedov <imammedo@redhat.com>
>>> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
>>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>>> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
>>> ---
>>>  roms/Makefile | 13 ++++++-------
>>>  1 file changed, 6 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/roms/Makefile b/roms/Makefile
>>> index a6043eff37e9..78d5dd18c301 100644
>>> --- a/roms/Makefile
>>> +++ b/roms/Makefile
>>> @@ -47,10 +47,7 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
>>>  # We need that to combine multiple images (legacy bios,
>>>  # efi ia32, efi x64) into a single rom binary.
>>>  #
>>> -# We try to find it in the path.  You can also pass the location on
>>> -# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
>>> -#
>>> -EFIROM ?= $(shell which EfiRom 2>/dev/null)
>>> +EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
>>>  
>>>  default:
>>>  	@echo "nothing is build by default"
>>> @@ -59,8 +56,7 @@ default:
>>>  	@echo "  vgabios        -- update vgabios binaries (seabios)"
>>>  	@echo "  sgabios        -- update sgabios binaries"
>>>  	@echo "  pxerom         -- update nic roms (bios only)"
>>> -	@echo "  efirom         -- update nic roms (bios+efi, this needs"
>>> -	@echo "                    the EfiRom utility from edk2 / tianocore)"
>>> +	@echo "  efirom         -- update nic roms (bios+efi)"
>>>  	@echo "  slof           -- update slof.bin"
>>>  	@echo "  skiboot        -- update skiboot.lid"
>>>  	@echo "  u-boot.e500    -- update u-boot.e500"
>>> @@ -106,7 +102,7 @@ pxe-rom-%: build-pxe-roms
>>>  
>>>  efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
>>>  
>>> -efi-rom-%: build-pxe-roms build-efi-roms
>>> +efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
>>>  	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
>>>  		-b ipxe/src/bin/$(VID)$(DID).rom \
>>>  		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
>>> @@ -124,6 +120,8 @@ build-efi-roms: build-pxe-roms
>>>  		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
>>>  		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
>>>  
>>> +$(EFIROM):
>>> +	$(MAKE) -C edk2/BaseTools
>>
>> Since this is a single tool/file, can we simply use:
>>
>>         $(MAKE) -C edk2/BaseTools/Source/C/EfiRom
> 
> Also, note that this doesn't work for out-of-tree builds, but this
> problem is pre-existent to your series.

Right, "roms/Makefile" is unrelated to building QEMU itself (which is
supposed to work outside of the source tree); it is for maintainers when
they intend to refresh the bundled fw stuff.

Thanks
Laszlo

> 
>>
>>>  
>>>  slof:
>>>  	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
>>> @@ -150,6 +148,7 @@ clean:
>>>  	$(MAKE) -C sgabios clean
>>>  	rm -f sgabios/.depend
>>>  	$(MAKE) -C ipxe/src veryclean
>>> +	$(MAKE) -C edk2/BaseTools clean
>>
>> Ditto.
>>
>>>  	$(MAKE) -C SLOF clean
>>>  	rm -rf u-boot/build.e500
>>>  	$(MAKE) -C u-boot-sam460ex distclean
>>>
>>
>> Whichever path used:
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>>
diff mbox series

Patch

diff --git a/roms/Makefile b/roms/Makefile
index a6043eff37e9..78d5dd18c301 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -47,10 +47,7 @@  SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
 # We need that to combine multiple images (legacy bios,
 # efi ia32, efi x64) into a single rom binary.
 #
-# We try to find it in the path.  You can also pass the location on
-# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
-#
-EFIROM ?= $(shell which EfiRom 2>/dev/null)
+EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
 
 default:
 	@echo "nothing is build by default"
@@ -59,8 +56,7 @@  default:
 	@echo "  vgabios        -- update vgabios binaries (seabios)"
 	@echo "  sgabios        -- update sgabios binaries"
 	@echo "  pxerom         -- update nic roms (bios only)"
-	@echo "  efirom         -- update nic roms (bios+efi, this needs"
-	@echo "                    the EfiRom utility from edk2 / tianocore)"
+	@echo "  efirom         -- update nic roms (bios+efi)"
 	@echo "  slof           -- update slof.bin"
 	@echo "  skiboot        -- update skiboot.lid"
 	@echo "  u-boot.e500    -- update u-boot.e500"
@@ -106,7 +102,7 @@  pxe-rom-%: build-pxe-roms
 
 efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
 
-efi-rom-%: build-pxe-roms build-efi-roms
+efi-rom-%: build-pxe-roms build-efi-roms $(EFIROM)
 	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
 		-b ipxe/src/bin/$(VID)$(DID).rom \
 		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
@@ -124,6 +120,8 @@  build-efi-roms: build-pxe-roms
 		$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
 		$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
 
+$(EFIROM):
+	$(MAKE) -C edk2/BaseTools
 
 slof:
 	$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
@@ -150,6 +148,7 @@  clean:
 	$(MAKE) -C sgabios clean
 	rm -f sgabios/.depend
 	$(MAKE) -C ipxe/src veryclean
+	$(MAKE) -C edk2/BaseTools clean
 	$(MAKE) -C SLOF clean
 	rm -rf u-boot/build.e500
 	$(MAKE) -C u-boot-sam460ex distclean