[v2] benchtests: Generate .d dependency files [BZ #28922]

Message ID 20220224221035.987093-1-hjl.tools@gmail.com
State Committed
Commit c12c2a41b0bf626f50265e67d3393e1607c9cc77
Headers
Series [v2] benchtests: Generate .d dependency files [BZ #28922] |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

H.J. Lu Feb. 24, 2022, 10:10 p.m. UTC
  1. Add all .o files to extra-objs.
2. Include ../Rules after extra-objs has been set.
---
 benchtests/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Comments

Carlos O'Donell Feb. 25, 2022, 3:39 p.m. UTC | #1
On 2/24/22 17:10, H.J. Lu via Libc-alpha wrote:
> 1. Add all .o files to extra-objs.
> 2. Include ../Rules after extra-objs has been set.

LGTM. Fixes the ../Rules part. Still looks good.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  benchtests/Makefile | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/benchtests/Makefile b/benchtests/Makefile
> index 9b8df3b3f5..d513b29903 100644
> --- a/benchtests/Makefile
> +++ b/benchtests/Makefile
> @@ -296,11 +296,12 @@ bench-extra-objs = json-lib.o
>  extra-objs += $(bench-extra-objs)
>  others-extras = $(bench-extra-objs)
>  
> -include ../Rules
> -
>  binaries-bench := $(addprefix $(objpfx)bench-,$(bench))
> +extra-objs += $(addsuffix .o,$(addprefix bench-,$(bench)))
>  binaries-benchset := $(addprefix $(objpfx)bench-,$(benchset))
> +extra-objs += $(addsuffix .o,$(addprefix bench-,$(benchset)))
>  binaries-bench-malloc := $(addprefix $(objpfx)bench-,$(bench-malloc))
> +extra-objs += $(addsuffix .o,$(addprefix bench-,$(bench-malloc)))
>  
>  # The default duration: 1 seconds.
>  ifndef BENCH_DURATION
> @@ -334,6 +335,9 @@ run-bench = $(test-wrapper-env) \
>  	    $($*-ENV) $(test-via-rtld-prefix) $${run}
>  
>  timing-type := $(objpfx)bench-timing-type
> +extra-objs += bench-timing-type.o
> +
> +include ../Rules
>  
>  # This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
>  # for all these modules.
  

Patch

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 9b8df3b3f5..d513b29903 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -296,11 +296,12 @@  bench-extra-objs = json-lib.o
 extra-objs += $(bench-extra-objs)
 others-extras = $(bench-extra-objs)
 
-include ../Rules
-
 binaries-bench := $(addprefix $(objpfx)bench-,$(bench))
+extra-objs += $(addsuffix .o,$(addprefix bench-,$(bench)))
 binaries-benchset := $(addprefix $(objpfx)bench-,$(benchset))
+extra-objs += $(addsuffix .o,$(addprefix bench-,$(benchset)))
 binaries-bench-malloc := $(addprefix $(objpfx)bench-,$(bench-malloc))
+extra-objs += $(addsuffix .o,$(addprefix bench-,$(bench-malloc)))
 
 # The default duration: 1 seconds.
 ifndef BENCH_DURATION
@@ -334,6 +335,9 @@  run-bench = $(test-wrapper-env) \
 	    $($*-ENV) $(test-via-rtld-prefix) $${run}
 
 timing-type := $(objpfx)bench-timing-type
+extra-objs += bench-timing-type.o
+
+include ../Rules
 
 # This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
 # for all these modules.