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

Re: [XEN PATCH v3 04/25] tools/firmware/hvmloader: rework Makefile


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 11 Jul 2022 15:52:52 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=y6EKOgwVToWdE6HACoeHmgjyhRvxRppQiVPhunog6wE=; b=Nra79n2A//zkBX9/1mby7+KmO3Fkn1ftDLNmN6J7VII8EldyDvr4laJ5fgy6Wz9yImBrIuenKIDQXTigLuJG4qp1F2OoIpppe2uAL1DakZrOv77gwDxTkpPyRu75JFePtbjsXQ0z+KrphmFKN8tks3bNVKAXz//gjDhji+RLvXRU08NZnKrVaZvOPuS8odiKLjIu+2vBM7J74O+byXv40Pns/Zr7+gASVW6mZfodN3MD4WKn+ZpZTGe1CxOMafXmbyB0Sg13+pdddJc/4SzXMzL0qS8oxJixJH2rJAnp/8aoXfyRkAtX0sQoeqhqPZJIf4bM7J5kbiXCZ7x/shXV+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b2vbf51GgSwR1vFbFNYUNRL4CDUxclBmV6Bdd9Czt6CNTV3XXqj/A3kQ5KjTZW4mYpGIiag3UZD3dIW682On/712CkqhT9z/rWinNtO/Ee0gop4u9Lb9Q9SVXnVsWCghkwpyQGwNdc5WYEqyGnHZIgKNa/O7rEmzh4rWubn8p3L6SXA1W7ehcqE5Z6haWbL+T5BXGYEbvK5yuf+iaQVYuMkDRsB6eTL0gKseeC3YmhQEHiEP9UGb0ck1MiUVft3oRR2B1DqMX+E9oTBDOriuBV7AC9F4knuthPvfzuzM+UOj6vCPUXjvNsUs1Jlxt8br38cgs7QuGymZwdrQuMJRaw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 11 Jul 2022 13:53:01 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.06.2022 18:04, Anthony PERARD wrote:
> 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".)

Maybe leave a brief comment there?

> 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", in case the target already exist.

Hmm - according to my understanding -f isn't needed just because the
file may already exist. It would be needed if a pre-existing file
isn't writable. (I don't mind the addition of the flag, but I think
what you say can end up misleading.)

Jan

> Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
> ---
>  tools/firmware/hvmloader/Makefile | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/firmware/hvmloader/Makefile 
> b/tools/firmware/hvmloader/Makefile
> index b754220839..fc20932110 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,15 @@ 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
> +build.o: $(DSDT_FILES)
> +
>  hvmloader: $(OBJS) hvmloader.lds
>       $(LD) $(LDFLAGS_DIRECT) -N -T hvmloader.lds -o $@ $(OBJS)
>  
> @@ -87,21 +89,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:




 


Rackspace

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