[PATCH] Have stamp-init depend on config.status

Simon Marchi simark@simark.ca
Fri Oct 30 17:01:53 GMT 2020


On 2020-10-30 12:29 p.m., Tom Tromey wrote:
> I recently wrote a patch to modify configure.tgt.  However, I did this
> incorrectly the first time, and had to go back and add another file.
> After building, I was surprised that my changes did not seem to work.
> I tracked this down to the fact that init.c had not been rebuilt after
> my changes -- because the files I added to the build were already
> older than the existing init.c.
> 
> This patch changes the gdb Makefile so that init.c will be rebuilt if
> config.status changes.  This should cover various scenarios that cause
> a re-configure, like editing configure.tgt.
> 
> gdb/ChangeLog
> 2020-10-30  Tom Tromey  <tromey@adacore.com>
> 
> 	* Makefile.in (stamp-init): Depend on config.status.
> ---
>  gdb/ChangeLog   | 4 ++++
>  gdb/Makefile.in | 2 +-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index 8a160896e2c..b3be21bb5a0 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -1833,7 +1833,7 @@ INIT_FILES = \
>  	      $(COMMON_OBS))))
>  
>  init.c: stamp-init; @true
> -stamp-init: $(INIT_FILES)
> +stamp-init: $(INIT_FILES) config.status
>  	@$(ECHO_INIT_C) echo "Making init.c"
>  	@rm -f init.c-tmp init.l-tmp
>  	@touch init.c-tmp
> -- 
> 2.26.2
> 

That makes sense and LGTM.

Simon


More information about the Gdb-patches mailing list