diff mbox series

[v2,1/2] build: shorten macro references

Message ID aa76774a-0d73-989e-e054-1b30490160e1@suse.com (mailing list archive)
State New, archived
Headers show
Series build: improve macro references | expand

Commit Message

Jan Beulich May 8, 2023, 12:58 p.m. UTC
Presumably by copy-and-paste we've accumulated a number of instances of
$(@D)/$(@F), which really is nothing else than $@. The split form only
needs using when we want to e.g. insert a leading . at the beginning of
the file name portion of the full name.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
---
v2: Insert blanks after ">".

Comments

Jan Beulich May 22, 2023, 8:44 a.m. UTC | #1
On 08.05.2023 14:58, Jan Beulich wrote:
> Presumably by copy-and-paste we've accumulated a number of instances of
> $(@D)/$(@F), which really is nothing else than $@. The split form only
> needs using when we want to e.g. insert a leading . at the beginning of
> the file name portion of the full name.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
> ---
> v2: Insert blanks after ">".

Any chance of a RISC-V side ack, please?

Thanks, Jan

> --- a/xen/arch/arm/Makefile
> +++ b/xen/arch/arm/Makefile
> @@ -104,9 +104,9 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o
>  	$(MAKE) $(build)=$(@D) $(@D)/.$(@F).1.o
>  	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
>  	    $(@D)/.$(@F).1.o -o $@
> -	$(NM) -pa --format=sysv $(@D)/$(@F) \
> +	$(NM) -pa --format=sysv $@ \
>  		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
> -		>$(@D)/$(@F).map
> +		> $@.map
>  	rm -f $(@D)/.$(@F).[0-9]*
>  
>  .PHONY: include
> --- a/xen/arch/riscv/Makefile
> +++ b/xen/arch/riscv/Makefile
> @@ -10,9 +10,9 @@ $(TARGET): $(TARGET)-syms
>  
>  $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
>  	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) -o $@
> -	$(NM) -pa --format=sysv $(@D)/$(@F) \
> +	$(NM) -pa --format=sysv $@ \
>  		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
> -		>$(@D)/$(@F).map
> +		> $@.map
>  
>  $(obj)/xen.lds: $(src)/xen.lds.S FORCE
>  	$(call if_changed_dep,cpp_lds_S)
> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -150,9 +150,9 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o
>  	$(MAKE) $(build)=$(@D) $(@D)/.$(@F).1.o
>  	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
>  	    $(orphan-handling-y) $(@D)/.$(@F).1.o -o $@
> -	$(NM) -pa --format=sysv $(@D)/$(@F) \
> +	$(NM) -pa --format=sysv $@ \
>  		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
> -		>$(@D)/$(@F).map
> +		> $@.map
>  	rm -f $(@D)/.$(@F).[0-9]* $(@D)/..$(@F).[0-9]*
>  ifeq ($(CONFIG_XEN_IBT),y)
>  	$(SHELL) $(srctree)/tools/check-endbr.sh $@
> @@ -224,8 +224,9 @@ endif
>  	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
>  	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
>  	      $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o $(orphan-handling-y) $(note_file_option) -o $@
> -	$(NM) -pa --format=sysv $(@D)/$(@F) \
> -		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort >$(@D)/$(@F).map
> +	$(NM) -pa --format=sysv $@ \
> +		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
> +		> $@.map
>  ifeq ($(CONFIG_DEBUG_INFO),y)
>  	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),:$(space))$(OBJCOPY) -O elf64-x86-64 $@ $@.elf
>  endif
> 
>
Alistair Francis May 26, 2023, 1:15 a.m. UTC | #2
On Mon, May 8, 2023 at 10:58 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> Presumably by copy-and-paste we've accumulated a number of instances of
> $(@D)/$(@F), which really is nothing else than $@. The split form only
> needs using when we want to e.g. insert a leading . at the beginning of
> the file name portion of the full name.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>

Acked-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
> v2: Insert blanks after ">".
>
> --- a/xen/arch/arm/Makefile
> +++ b/xen/arch/arm/Makefile
> @@ -104,9 +104,9 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o
>         $(MAKE) $(build)=$(@D) $(@D)/.$(@F).1.o
>         $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
>             $(@D)/.$(@F).1.o -o $@
> -       $(NM) -pa --format=sysv $(@D)/$(@F) \
> +       $(NM) -pa --format=sysv $@ \
>                 | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
> -               >$(@D)/$(@F).map
> +               > $@.map
>         rm -f $(@D)/.$(@F).[0-9]*
>
>  .PHONY: include
> --- a/xen/arch/riscv/Makefile
> +++ b/xen/arch/riscv/Makefile
> @@ -10,9 +10,9 @@ $(TARGET): $(TARGET)-syms
>
>  $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
>         $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) -o $@
> -       $(NM) -pa --format=sysv $(@D)/$(@F) \
> +       $(NM) -pa --format=sysv $@ \
>                 | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
> -               >$(@D)/$(@F).map
> +               > $@.map
>
>  $(obj)/xen.lds: $(src)/xen.lds.S FORCE
>         $(call if_changed_dep,cpp_lds_S)
> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -150,9 +150,9 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o
>         $(MAKE) $(build)=$(@D) $(@D)/.$(@F).1.o
>         $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
>             $(orphan-handling-y) $(@D)/.$(@F).1.o -o $@
> -       $(NM) -pa --format=sysv $(@D)/$(@F) \
> +       $(NM) -pa --format=sysv $@ \
>                 | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
> -               >$(@D)/$(@F).map
> +               > $@.map
>         rm -f $(@D)/.$(@F).[0-9]* $(@D)/..$(@F).[0-9]*
>  ifeq ($(CONFIG_XEN_IBT),y)
>         $(SHELL) $(srctree)/tools/check-endbr.sh $@
> @@ -224,8 +224,9 @@ endif
>         $(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
>         $(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
>               $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o $(orphan-handling-y) $(note_file_option) -o $@
> -       $(NM) -pa --format=sysv $(@D)/$(@F) \
> -               | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort >$(@D)/$(@F).map
> +       $(NM) -pa --format=sysv $@ \
> +               | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
> +               > $@.map
>  ifeq ($(CONFIG_DEBUG_INFO),y)
>         $(if $(filter --strip-debug,$(EFI_LDFLAGS)),:$(space))$(OBJCOPY) -O elf64-x86-64 $@ $@.elf
>  endif
>
>
diff mbox series

Patch

--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -104,9 +104,9 @@  $(TARGET)-syms: $(objtree)/prelink.o $(o
 	$(MAKE) $(build)=$(@D) $(@D)/.$(@F).1.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
 	    $(@D)/.$(@F).1.o -o $@
-	$(NM) -pa --format=sysv $(@D)/$(@F) \
+	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
-		>$(@D)/$(@F).map
+		> $@.map
 	rm -f $(@D)/.$(@F).[0-9]*
 
 .PHONY: include
--- a/xen/arch/riscv/Makefile
+++ b/xen/arch/riscv/Makefile
@@ -10,9 +10,9 @@  $(TARGET): $(TARGET)-syms
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) -o $@
-	$(NM) -pa --format=sysv $(@D)/$(@F) \
+	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
-		>$(@D)/$(@F).map
+		> $@.map
 
 $(obj)/xen.lds: $(src)/xen.lds.S FORCE
 	$(call if_changed_dep,cpp_lds_S)
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -150,9 +150,9 @@  $(TARGET)-syms: $(objtree)/prelink.o $(o
 	$(MAKE) $(build)=$(@D) $(@D)/.$(@F).1.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds -N $< $(build_id_linker) \
 	    $(orphan-handling-y) $(@D)/.$(@F).1.o -o $@
-	$(NM) -pa --format=sysv $(@D)/$(@F) \
+	$(NM) -pa --format=sysv $@ \
 		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
-		>$(@D)/$(@F).map
+		> $@.map
 	rm -f $(@D)/.$(@F).[0-9]* $(@D)/..$(@F).[0-9]*
 ifeq ($(CONFIG_XEN_IBT),y)
 	$(SHELL) $(srctree)/tools/check-endbr.sh $@
@@ -224,8 +224,9 @@  endif
 	$(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds -N $< \
 	      $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o $(orphan-handling-y) $(note_file_option) -o $@
-	$(NM) -pa --format=sysv $(@D)/$(@F) \
-		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort >$(@D)/$(@F).map
+	$(NM) -pa --format=sysv $@ \
+		| $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \
+		> $@.map
 ifeq ($(CONFIG_DEBUG_INFO),y)
 	$(if $(filter --strip-debug,$(EFI_LDFLAGS)),:$(space))$(OBJCOPY) -O elf64-x86-64 $@ $@.elf
 endif