Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/4] Some Makefile clean target cleanups
@ 2026-09-03 17:37 Simon Marchi
  2026-09-03 17:37 ` [PATCH 1/4] gdb: remove gcore, gstack and gdb-add-index in the clean target Simon Marchi
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Simon Marchi @ 2026-09-03 17:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Here are a few fixes related to the clean and distclean targets.  There
would be more to fix, these are just some low hanging fruits.

Simon Marchi (4):
  gdb: remove gcore, gstack and gdb-add-index in the clean target
  gdbserver: remove undefined ADD_FILES from the clean target
  gdb: gdb-gdb.gdb and gdb-gdb.py in distclean
  gdb: remove stray "b" from the distclean target

 gdb/Makefile.in       | 8 ++++++--
 gdbserver/Makefile.in | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)


base-commit: 2986ed8ba365f7e583e2f6c9098ea5ec57ee50e1
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/4] gdb: remove gcore, gstack and gdb-add-index in the clean target
  2026-09-03 17:37 [PATCH 0/4] Some Makefile clean target cleanups Simon Marchi
@ 2026-09-03 17:37 ` Simon Marchi
  2026-09-04 11:18   ` Tom de Vries
  2026-09-03 17:37 ` [PATCH 2/4] gdbserver: remove undefined ADD_FILES from " Simon Marchi
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Simon Marchi @ 2026-09-03 17:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Those are created by "make", so remove them in the clean target.

On the other hand, gcore.in and gdb-add-index.in are created at
configure time, so delete them in the distclean target (like gstack.in).

Change-Id: Ie5557b4e1039641dd0ff837788ff57e0e3bb30de
---
 gdb/Makefile.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 767f92808644..6fd528c71c5f 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2408,6 +2408,7 @@ clean mostlyclean: $(CONFIG_CLEAN)
 	rm -f gdb$(EXEEXT) core make.log
 	rm -f gdb[0-9]$(EXEEXT)
 	rm -f xml-builtin.c stamp-xml
+	rm -f gcore gstack gdb-add-index
 	rm -f $(addsuffix /*.o,$(CONFIG_SRC_SUBDIR))
 	rm -f $(addsuffix /*,$(ALL_DEPDIRS))
 	for d in $(ALL_DEPDIRS); do \
@@ -2420,7 +2421,8 @@ clean mostlyclean: $(CONFIG_CLEAN)
 # functionality described is if the distributed files are unmodified.
 distclean: clean
 	@$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(CLEANDIRS)" subdir_do
-	rm -f nm.h config.status config.h stamp-h b jit-reader.h gcore gstack gstack.in stamp-nmh
+	rm -f nm.h config.status config.h stamp-h b jit-reader.h stamp-nmh
+	rm -f gcore.in gstack.in gdb-add-index.in
 	rm -f gdb-gdb.gdb
 	rm -f y.output yacc.acts yacc.tmp y.tab.h
 	rm -f config.log config.cache
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 2/4] gdbserver: remove undefined ADD_FILES from the clean target
  2026-09-03 17:37 [PATCH 0/4] Some Makefile clean target cleanups Simon Marchi
  2026-09-03 17:37 ` [PATCH 1/4] gdb: remove gcore, gstack and gdb-add-index in the clean target Simon Marchi
@ 2026-09-03 17:37 ` Simon Marchi
  2026-09-04 10:55   ` Tom de Vries
  2026-09-03 17:37 ` [PATCH 3/4] gdb: gdb-gdb.gdb and gdb-gdb.py in distclean Simon Marchi
  2026-09-03 17:37 ` [PATCH 4/4] gdb: remove stray "b" from the distclean target Simon Marchi
  3 siblings, 1 reply; 10+ messages in thread
From: Simon Marchi @ 2026-09-03 17:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

ADD_FILES is not defined anywhere in gdbserver, so it expands to
nothing, drop it.

Change-Id: I792aec1977a8daf6ce3e438c78a324b8fae4d9f0
---
 gdbserver/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 5c3252d64454..aac8742a9231 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -423,7 +423,7 @@ TAGS:	${TAGFILES}
 tags: TAGS
 
 mostlyclean clean:
-	rm -f *.o ${ADD_FILES} *~
+	rm -f *.o *~
 	rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
 	rm -f $(IPA_LIB)
 	rm -f *-generated.cc
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 3/4] gdb: gdb-gdb.gdb and gdb-gdb.py in distclean
  2026-09-03 17:37 [PATCH 0/4] Some Makefile clean target cleanups Simon Marchi
  2026-09-03 17:37 ` [PATCH 1/4] gdb: remove gcore, gstack and gdb-add-index in the clean target Simon Marchi
  2026-09-03 17:37 ` [PATCH 2/4] gdbserver: remove undefined ADD_FILES from " Simon Marchi
@ 2026-09-03 17:37 ` Simon Marchi
  2026-09-04 10:48   ` Tom de Vries
  2026-09-03 17:37 ` [PATCH 4/4] gdb: remove stray "b" from the distclean target Simon Marchi
  3 siblings, 1 reply; 10+ messages in thread
From: Simon Marchi @ 2026-09-03 17:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Both gdb-gdb.gdb and gdb-gdb.py are created by configure through
AC_CONFIG_LINKS.  When building in-tree, this does nothing.  When
building out-of-tree, AC_CONFIG_LINKS created a link or a copy.  Either
way, distclean should delete them but only when building out of tree.

Change-Id: Iceca0a6b131c97028ecbc79650f451e83a2c5aed
---
 gdb/Makefile.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 6fd528c71c5f..f159a510dd6d 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2423,7 +2423,9 @@ distclean: clean
 	@$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(CLEANDIRS)" subdir_do
 	rm -f nm.h config.status config.h stamp-h b jit-reader.h stamp-nmh
 	rm -f gcore.in gstack.in gdb-add-index.in
-	rm -f gdb-gdb.gdb
+	if test "$(srcdir)" != "."; then \
+		rm -f gdb-gdb.gdb gdb-gdb.py; \
+	fi
 	rm -f y.output yacc.acts yacc.tmp y.tab.h
 	rm -f config.log config.cache
 	rm -f config.lt libtool
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 4/4] gdb: remove stray "b" from the distclean target
  2026-09-03 17:37 [PATCH 0/4] Some Makefile clean target cleanups Simon Marchi
                   ` (2 preceding siblings ...)
  2026-09-03 17:37 ` [PATCH 3/4] gdb: gdb-gdb.gdb and gdb-gdb.py in distclean Simon Marchi
@ 2026-09-03 17:37 ` Simon Marchi
  2026-09-04 10:50   ` Tom de Vries
  3 siblings, 1 reply; 10+ messages in thread
From: Simon Marchi @ 2026-09-03 17:37 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

The distclean target removes a file called "b".  It looks like a typo
introduced in commit 141ec9f67f11 ("Copy gdb-gdb.py to
build dir").  That was mine, sorry about that.

Change-Id: I17509018e525f6cdbc733a5444b6f463a6f4b6be
---
 gdb/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index f159a510dd6d..c529c4e1562e 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2421,7 +2421,7 @@ clean mostlyclean: $(CONFIG_CLEAN)
 # functionality described is if the distributed files are unmodified.
 distclean: clean
 	@$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(CLEANDIRS)" subdir_do
-	rm -f nm.h config.status config.h stamp-h b jit-reader.h stamp-nmh
+	rm -f nm.h config.status config.h stamp-h jit-reader.h stamp-nmh
 	rm -f gcore.in gstack.in gdb-add-index.in
 	if test "$(srcdir)" != "."; then \
 		rm -f gdb-gdb.gdb gdb-gdb.py; \
-- 
2.55.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/4] gdb: gdb-gdb.gdb and gdb-gdb.py in distclean
  2026-09-03 17:37 ` [PATCH 3/4] gdb: gdb-gdb.gdb and gdb-gdb.py in distclean Simon Marchi
@ 2026-09-04 10:48   ` Tom de Vries
  2026-09-04 14:07     ` Simon Marchi
  0 siblings, 1 reply; 10+ messages in thread
From: Tom de Vries @ 2026-09-04 10:48 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 9/3/26 7:37 PM, Simon Marchi wrote:
> Both gdb-gdb.gdb and gdb-gdb.py are created by configure through
> AC_CONFIG_LINKS.  When building in-tree, this does nothing.  When
> building out-of-tree, AC_CONFIG_LINKS created a link or a copy.  Either
> way, distclean should delete them but only when building out of tree.
> 

Hi Simon,

thanks for cleaning up the fallout of my two rename patches.

I've reproduced the issue:
- did in-tree build
- ran make distclean
- saw git status mention gdb/gdb-gdb.gdb as deleted

The fix LGTM.

Approved-By: Tom de Vries <tdevries@suse.de>

FWIW, I found that a further cleanup related to the rename was needed in 
the all target ( 
https://sourceware.org/pipermail/gdb-patches/2026-September/230054.html ).

Thanks,
- Tom

> Change-Id: Iceca0a6b131c97028ecbc79650f451e83a2c5aed
> ---
>   gdb/Makefile.in | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index 6fd528c71c5f..f159a510dd6d 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -2423,7 +2423,9 @@ distclean: clean
>   	@$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(CLEANDIRS)" subdir_do
>   	rm -f nm.h config.status config.h stamp-h b jit-reader.h stamp-nmh
>   	rm -f gcore.in gstack.in gdb-add-index.in
> -	rm -f gdb-gdb.gdb
> +	if test "$(srcdir)" != "."; then \
> +		rm -f gdb-gdb.gdb gdb-gdb.py; \
> +	fi
>   	rm -f y.output yacc.acts yacc.tmp y.tab.h
>   	rm -f config.log config.cache
>   	rm -f config.lt libtool


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 4/4] gdb: remove stray "b" from the distclean target
  2026-09-03 17:37 ` [PATCH 4/4] gdb: remove stray "b" from the distclean target Simon Marchi
@ 2026-09-04 10:50   ` Tom de Vries
  0 siblings, 0 replies; 10+ messages in thread
From: Tom de Vries @ 2026-09-04 10:50 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 9/3/26 7:37 PM, Simon Marchi wrote:
> The distclean target removes a file called "b".  It looks like a typo
> introduced in commit 141ec9f67f11 ("Copy gdb-gdb.py to
> build dir").  That was mine, sorry about that.
> 

LGTM.

FWIW, looks obvious to me.

Approved-By: Tom de Vries <tdevries@suse.de>

Thanks,
- Tom

> Change-Id: I17509018e525f6cdbc733a5444b6f463a6f4b6be
> ---
>   gdb/Makefile.in | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index f159a510dd6d..c529c4e1562e 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -2421,7 +2421,7 @@ clean mostlyclean: $(CONFIG_CLEAN)
>   # functionality described is if the distributed files are unmodified.
>   distclean: clean
>   	@$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(CLEANDIRS)" subdir_do
> -	rm -f nm.h config.status config.h stamp-h b jit-reader.h stamp-nmh
> +	rm -f nm.h config.status config.h stamp-h jit-reader.h stamp-nmh
>   	rm -f gcore.in gstack.in gdb-add-index.in
>   	if test "$(srcdir)" != "."; then \
>   		rm -f gdb-gdb.gdb gdb-gdb.py; \


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/4] gdbserver: remove undefined ADD_FILES from the clean target
  2026-09-03 17:37 ` [PATCH 2/4] gdbserver: remove undefined ADD_FILES from " Simon Marchi
@ 2026-09-04 10:55   ` Tom de Vries
  0 siblings, 0 replies; 10+ messages in thread
From: Tom de Vries @ 2026-09-04 10:55 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 9/3/26 7:37 PM, Simon Marchi wrote:
> ADD_FILES is not defined anywhere in gdbserver, so it expands to
> nothing, drop it.
>

LGTM.

Approved-By: Tom de Vries <tdevries@suse.de>

Thanks,
- Tom

> Change-Id: I792aec1977a8daf6ce3e438c78a324b8fae4d9f0
> ---
>   gdbserver/Makefile.in | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
> index 5c3252d64454..aac8742a9231 100644
> --- a/gdbserver/Makefile.in
> +++ b/gdbserver/Makefile.in
> @@ -423,7 +423,7 @@ TAGS:	${TAGFILES}
>   tags: TAGS
>   
>   mostlyclean clean:
> -	rm -f *.o ${ADD_FILES} *~
> +	rm -f *.o *~
>   	rm -f gdbserver$(EXEEXT) gdbreplay$(EXEEXT) core make.log
>   	rm -f $(IPA_LIB)
>   	rm -f *-generated.cc


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/4] gdb: remove gcore, gstack and gdb-add-index in the clean target
  2026-09-03 17:37 ` [PATCH 1/4] gdb: remove gcore, gstack and gdb-add-index in the clean target Simon Marchi
@ 2026-09-04 11:18   ` Tom de Vries
  0 siblings, 0 replies; 10+ messages in thread
From: Tom de Vries @ 2026-09-04 11:18 UTC (permalink / raw)
  To: Simon Marchi, gdb-patches

On 9/3/26 7:37 PM, Simon Marchi wrote:
> Those are created by "make", so remove them in the clean target.
> 
> On the other hand, gcore.in and gdb-add-index.in are created at
> configure time, so delete them in the distclean target (like gstack.in).
> 

LGTM.

Approved-By: Tom de Vries <tdevries@suse.de>

Thanks,
- Tom

> Change-Id: Ie5557b4e1039641dd0ff837788ff57e0e3bb30de
> ---
>   gdb/Makefile.in | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index 767f92808644..6fd528c71c5f 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -2408,6 +2408,7 @@ clean mostlyclean: $(CONFIG_CLEAN)
>   	rm -f gdb$(EXEEXT) core make.log
>   	rm -f gdb[0-9]$(EXEEXT)
>   	rm -f xml-builtin.c stamp-xml
> +	rm -f gcore gstack gdb-add-index
>   	rm -f $(addsuffix /*.o,$(CONFIG_SRC_SUBDIR))
>   	rm -f $(addsuffix /*,$(ALL_DEPDIRS))
>   	for d in $(ALL_DEPDIRS); do \
> @@ -2420,7 +2421,8 @@ clean mostlyclean: $(CONFIG_CLEAN)
>   # functionality described is if the distributed files are unmodified.
>   distclean: clean
>   	@$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(CLEANDIRS)" subdir_do
> -	rm -f nm.h config.status config.h stamp-h b jit-reader.h gcore gstack gstack.in stamp-nmh
> +	rm -f nm.h config.status config.h stamp-h b jit-reader.h stamp-nmh
> +	rm -f gcore.in gstack.in gdb-add-index.in
>   	rm -f gdb-gdb.gdb
>   	rm -f y.output yacc.acts yacc.tmp y.tab.h
>   	rm -f config.log config.cache


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 3/4] gdb: gdb-gdb.gdb and gdb-gdb.py in distclean
  2026-09-04 10:48   ` Tom de Vries
@ 2026-09-04 14:07     ` Simon Marchi
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Marchi @ 2026-09-04 14:07 UTC (permalink / raw)
  To: Tom de Vries, Simon Marchi, gdb-patches



On 2026-09-04 06:48, Tom de Vries wrote:
> On 9/3/26 7:37 PM, Simon Marchi wrote:
>> Both gdb-gdb.gdb and gdb-gdb.py are created by configure through
>> AC_CONFIG_LINKS.  When building in-tree, this does nothing.  When
>> building out-of-tree, AC_CONFIG_LINKS created a link or a copy.  Either
>> way, distclean should delete them but only when building out of tree.
>>
> 
> Hi Simon,
> 
> thanks for cleaning up the fallout of my two rename patches.
> 
> I've reproduced the issue:
> - did in-tree build
> - ran make distclean
> - saw git status mention gdb/gdb-gdb.gdb as deleted
> 
> The fix LGTM.
> 
> Approved-By: Tom de Vries <tdevries@suse.de>

Thanks for testing, I pushed the series.
> 
> FWIW, I found that a further cleanup related to the rename was needed in the all target ( https://sourceware.org/pipermail/gdb-patches/2026-September/230054.html ).

I'll check that.

Simon

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-09-04 14:08 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-03 17:37 [PATCH 0/4] Some Makefile clean target cleanups Simon Marchi
2026-09-03 17:37 ` [PATCH 1/4] gdb: remove gcore, gstack and gdb-add-index in the clean target Simon Marchi
2026-09-04 11:18   ` Tom de Vries
2026-09-03 17:37 ` [PATCH 2/4] gdbserver: remove undefined ADD_FILES from " Simon Marchi
2026-09-04 10:55   ` Tom de Vries
2026-09-03 17:37 ` [PATCH 3/4] gdb: gdb-gdb.gdb and gdb-gdb.py in distclean Simon Marchi
2026-09-04 10:48   ` Tom de Vries
2026-09-04 14:07     ` Simon Marchi
2026-09-03 17:37 ` [PATCH 4/4] gdb: remove stray "b" from the distclean target Simon Marchi
2026-09-04 10:50   ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox