[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH v4 02/32] tools/firmware/hvmloader: rework Makefile


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 11 Aug 2022 17:48:15 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Luca Fancellu <luca.fancellu@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Thu, 11 Aug 2022 16:49:10 +0000
  • Ironport-data: A9a23:hJALB6BiirHEOxVW/y7jw5YqxClBgxIJ4kV8jS/XYbTApDMl0mBVy DcdCD/QM6zeN2byLt1/Ydy0/RsPu5/Xm9ZhQQY4rX1jcSlH+JHPbTi7wuYcHM8wwunrFh8PA xA2M4GYRCwMZiaA4E3ratANlFEkvYmQXL3wFeXYDS54QA5gWU8JhAlq3uU0meaEu/Dga++2k Y608pa31GONgWYuaDpEsvvb8nuDgdyp0N8mlg1mDRx0lAe2e0k9VPo3Oay3Jn3kdYhYdsbSq zHrlezREsvxpn/BO/v9+lrJWhRiro36ZGBivkF+Sam66iWukwRpukoN2FjwXm8M49mBt4gZJ NygLvVcQy9xVkHHsLx1vxW1j0iSlECJkVPKCSHXjCCd86HJW0ru0twtAkA6AYtb2tlYPThtz tcSCD9YO3hvh8ruqF66Yuxlh8BlJ8j3JoIP/HpnyFk1D95/H8qFGf+To4YFgnFg3aiiHt6HD yYdQTNpcBTHZQwJIloNAYgytOypmmP+Y3tTr1f9Sa8fvDeKl1AvjeaF3Nz9RcGnXpRWlWChh Xvg7lndLx04EPeg4G/Qmp6rrrCWxn6qMG4IL5W6/PN3hFyYxkQIFQYbE1C8pJGRlUqWS99Zb UsO9UIGvaU0sUCmUNT5dxm5u2Kf+A4RXcJKFO834x3LzbDbiy6dG2MNCDBIbtcrsMsrbTUw0 xmCmNaBONB0mOTLEzTHrO7S9G7sf3hORYMfWcMaZToH8vCgroA/shSMbulMLPeWtfb/OT6ll lhmsxMCa6UvYd8jjvvlpQiW3Gv1+PAlXSZuuFyJAzvNAhdRIdf8Otf2sQWzAeNodt7xc7WXg JQTdyFyBsgqBIrFqiGCSf5l8FqBt6fca220bbKC8vAcG9WRF52LJ9k4DMlWfhsBDyr9UWaBj LXvkQ1Q/oRPG3ChcLV6ZYm8Y+xzk/a4TYu9D6GEM4AUCnSUSONg1H8GWKJt9zq1zBhEfV8XY P93jvpA/V5FUP86nVJats8W0KMxxzBW+F4/savTlk3/uZLDNSH9dFvwGAHRBgzPxP/b/V69H hc2H5fi9iizp8WiO3WLrdNIfQxTRZX5bLivw/Fqmie4ClIOMAkc5zX5mNvNp6QNc3xpq9r1
  • Ironport-hdrordr: A9a23:FdFTg6ymoCcEMnghSRdJKrPwKr1zdoMgy1knxilNoRw8SKOlfq eV7ZMmPH7P+U8ssR4b+OxoVJPsfZqYz+8W3WBzB8bHYOCFgguVxehZhOOIqQEIWReOk9K1vZ 0QFZSWY+efMbEVt6rHCXGDYrUd/OU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Setup proper dependencies with libacpi so we don't need to run "make
hvmloader" in the "all" target. ("build.o" new prerequisite isn't
exactly proper but a side effect of building the $(DSDT_FILES) is to
generate the "ssdt_*.h" needed by "build.o".)

Make use if "-iquote" instead of a plain "-I".

For "roms.inc" target, use "$(SHELL)" instead of plain "sh". And use
full path to "mkhex" instead of a relative one. Lastly, add "-f" flag
to "mv" to avoid a prompt in case the target already exist and we
don't have write permission.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>
---

Notes:
    v4:
    - fix reason for 'mv -f' in patch description.
    - add a comment about build.o's new prerequisites.

 tools/firmware/hvmloader/Makefile | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/tools/firmware/hvmloader/Makefile 
b/tools/firmware/hvmloader/Makefile
index b754220839..2bb5deb0c6 100644
--- a/tools/firmware/hvmloader/Makefile
+++ b/tools/firmware/hvmloader/Makefile
@@ -60,8 +60,7 @@ ROMS += $(ROMBIOS_ROM) $(STDVGA_ROM) $(CIRRUSVGA_ROM)
 endif
 
 .PHONY: all
-all: acpi
-       $(MAKE) hvmloader
+all: hvmloader
 
 .PHONY: acpi
 acpi:
@@ -73,12 +72,18 @@ smbios.o: CFLAGS += 
-D__SMBIOS_DATE__="\"$(SMBIOS_REL_DATE)\""
 ACPI_PATH = ../../libacpi
 DSDT_FILES = dsdt_anycpu.c dsdt_15cpu.c dsdt_anycpu_qemu_xen.c
 ACPI_OBJS = $(patsubst %.c,%.o,$(DSDT_FILES)) build.o static_tables.o
-$(ACPI_OBJS): CFLAGS += -I. -DLIBACPI_STDUTILS=\"$(CURDIR)/util.h\"
+$(ACPI_OBJS): CFLAGS += -iquote . -DLIBACPI_STDUTILS=\"$(CURDIR)/util.h\"
 CFLAGS += -I$(ACPI_PATH)
 vpath build.c $(ACPI_PATH)
 vpath static_tables.c $(ACPI_PATH)
 OBJS += $(ACPI_OBJS)
 
+$(DSDT_FILES): acpi
+
+# Add DSDT_FILES as a prerequisite of "build.o" so that make will also
+# generates the "ssdt_*.h" headers needed by "build.o".
+build.o: $(DSDT_FILES)
+
 hvmloader: $(OBJS) hvmloader.lds
        $(LD) $(LDFLAGS_DIRECT) -N -T hvmloader.lds -o $@ $(OBJS)
 
@@ -87,21 +92,21 @@ roms.inc: $(ROMS)
 
 ifneq ($(ROMBIOS_ROM),)
        echo "#ifdef ROM_INCLUDE_ROMBIOS" >> $@.new
-       sh ../../misc/mkhex rombios $(ROMBIOS_ROM) >> $@.new
+       $(SHELL) $(XEN_ROOT)/tools/misc/mkhex rombios $(ROMBIOS_ROM) >> $@.new
        echo "#endif" >> $@.new
 endif
 
 ifneq ($(STDVGA_ROM),)
        echo "#ifdef ROM_INCLUDE_VGABIOS" >> $@.new
-       sh ../../misc/mkhex vgabios_stdvga $(STDVGA_ROM) >> $@.new
+       $(SHELL) $(XEN_ROOT)/tools/misc/mkhex vgabios_stdvga $(STDVGA_ROM) >> 
$@.new
        echo "#endif" >> $@.new
 endif
 ifneq ($(CIRRUSVGA_ROM),)
        echo "#ifdef ROM_INCLUDE_VGABIOS" >> $@.new
-       sh ../../misc/mkhex vgabios_cirrusvga $(CIRRUSVGA_ROM) >> $@.new
+       $(SHELL) $(XEN_ROOT)/tools/misc/mkhex vgabios_cirrusvga 
$(CIRRUSVGA_ROM) >> $@.new
        echo "#endif" >> $@.new
 endif
-       mv $@.new $@
+       mv -f $@.new $@
 
 .PHONY: clean
 clean:
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.