* [LTP] [PATCH v3 0/2] configure: Tidy up removal of generated artifacts
@ 2025-04-09 16:36 Ricardo B. Marlière via ltp
2025-04-09 16:36 ` [LTP] [PATCH v3 1/2] openposix: Makefile: Add the standard "maintainer-clean" target Ricardo B. Marlière via ltp
2025-04-09 16:36 ` [LTP] [PATCH v3 2/2] include/Makefile: Fix cleaning targets Ricardo B. Marlière via ltp
0 siblings, 2 replies; 6+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-04-09 16:36 UTC (permalink / raw)
To: Linux Test Project; +Cc: Ricardo B. Marlière
Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
Changes in v3:
- Added "include" dir to existing for loop instead of adding a new $(MAKE)
directive.
- Added it also to `make distclean` target.
- Link to v2: https://lore.kernel.org/r/20250408-fix_make_clean-v2-0-48f93c3dd0bf@suse.com
Changes in v2:
- Dropped the commit that added files to ac-maintainer-clean target
(They're already in AUTOMAKE_FILES, thanks P. Vorel!)
- Added "compile" file to the AUTOMAKE_FILES list
- Added missing call to include/Makefile to ac-maintainer-clean target
- Link to v1: https://lore.kernel.org/r/20250327-fix_make_clean-v1-0-8b9ed2a8d96a@suse.com
---
Ricardo B. Marlière (2):
openposix: Makefile: Add the standard "maintainer-clean" target
include/Makefile: Fix cleaning targets
include/Makefile | 4 ++--
include/mk/automake.mk | 10 ++++------
testcases/open_posix_testsuite/Makefile | 10 +++++++++-
3 files changed, 15 insertions(+), 9 deletions(-)
---
base-commit: 8000c950d6ba61a541a9278cdda6d68141c2fc0d
change-id: 20250327-fix_make_clean-8e57ffe1ce2c
Best regards,
--
Ricardo B. Marlière <rbm@suse.com>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH v3 1/2] openposix: Makefile: Add the standard "maintainer-clean" target
2025-04-09 16:36 [LTP] [PATCH v3 0/2] configure: Tidy up removal of generated artifacts Ricardo B. Marlière via ltp
@ 2025-04-09 16:36 ` Ricardo B. Marlière via ltp
2025-04-23 7:14 ` Petr Vorel
2025-04-09 16:36 ` [LTP] [PATCH v3 2/2] include/Makefile: Fix cleaning targets Ricardo B. Marlière via ltp
1 sibling, 1 reply; 6+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-04-09 16:36 UTC (permalink / raw)
To: Linux Test Project; +Cc: Ricardo B. Marlière
From: Ricardo B. Marlière <rbm@suse.com>
The include/mk/automake.mk file define the standard "maintainer-clean" and
"ac-maintainer-clean" targets and therein it calls the same targets under
each AUTOCONFED_SUBDIRS, but in the case of the openposix test suite, they
don't exist. Add them and also remove some dangling files in ac-clean.
This fixes the following error when calling `make maintainer-clean` from
the project's top level directory:
make[1]: Entering directory './testcases/open_posix_testsuite'
make[1]: *** No rule to make target 'ac-maintainer-clean'. Stop.
make[1]: Leaving directory './testcases/open_posix_testsuite'
make: *** [./include/mk/automake.mk:68: ac-maintainer-clean] Error 2
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
testcases/open_posix_testsuite/Makefile | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/testcases/open_posix_testsuite/Makefile b/testcases/open_posix_testsuite/Makefile
index 8b4c8c0a24b833fa0fb21ce3e253629f358f1800..c0ccd499b8b9c93e45133f5b3f189eda7d09beb3 100644
--- a/testcases/open_posix_testsuite/Makefile
+++ b/testcases/open_posix_testsuite/Makefile
@@ -31,11 +31,16 @@ AUTOGENERATED_FILES = include/mk/config.mk
.PHONY: ac-clean
ac-clean: clean
+ $(RM) -rf autom4te.cache
+ $(RM) -f config.log config.status
+
+.PHONE: ac-maintainer-clean
+ac-maintainer-clean:
+ $(RM) -f configure
.PHONY: clean
clean:
$(RM) -f $(LOGFILE)*
- $(RM) -f config.log config.status
@for dir in $(SUBDIRS) tools; do \
$(MAKE) -C $$dir clean >/dev/null; \
done
@@ -51,6 +56,9 @@ distclean-makefiles:
$(MAKE) -C $$dir $@; \
done
+.PHONY: maintainer-clean
+maintainer-clean: distclean-makefiles ac-maintainer-clean
+
$(AUTOGENERATED_FILES): $(top_builddir)/config.status
$(SHELL) $^
--
2.49.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH v3 2/2] include/Makefile: Fix cleaning targets
2025-04-09 16:36 [LTP] [PATCH v3 0/2] configure: Tidy up removal of generated artifacts Ricardo B. Marlière via ltp
2025-04-09 16:36 ` [LTP] [PATCH v3 1/2] openposix: Makefile: Add the standard "maintainer-clean" target Ricardo B. Marlière via ltp
@ 2025-04-09 16:36 ` Ricardo B. Marlière via ltp
2025-04-23 7:29 ` Petr Vorel
1 sibling, 1 reply; 6+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-04-09 16:36 UTC (permalink / raw)
To: Linux Test Project; +Cc: Ricardo B. Marlière
From: Ricardo B. Marlière <rbm@suse.com>
Add ac-clean target as dependency of ac-maintainer-clean and add missing
files to the removal list. This way the project top level Makefile cleaning
targets can make use of it. Also, add "compile" to the AUTOMAKE_FILES
list.
Cc: Andrea Cervesato <andrea.cervesato@suse.com>
Fixes: 817d8095fbfe ("Rename linux_syscall_numbers.h to lapi/syscalls.h")
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
NOTE: The "compile" file is added during the autotools target:
$ make autotools
<snip>
configure.ac:26: installing './compile'
configure.ac:24: installing './config.guess'
configure.ac:24: installing './config.sub'
configure.ac:7: installing './install-sh'
configure.ac:7: installing './missing'
<snip>
---
include/Makefile | 4 ++--
include/mk/automake.mk | 10 ++++------
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/include/Makefile b/include/Makefile
index 25e96df9b8cdd7d1d7e6f19925bf2160d682f0d9..6b31b046e452e71afb5097cc3fadf8af01282629 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -18,8 +18,8 @@ MAKE_TARGETS :=
distclean:: clean ac-distclean
maintainer-clean:: distclean ac-maintainer-clean
ac-clean ac-distclean::
- $(RM) -f config.h
-ac-maintainer-clean::
+ $(RM) -f config.h lapi/syscalls.h stamp-h1
+ac-maintainer-clean:: ac-clean
$(RM) -f config.h.in
vpath %.h $(abs_srcdir)
diff --git a/include/mk/automake.mk b/include/mk/automake.mk
index 3df3b4ba99ca865caa89388999e53cbc500615dc..3b248ac9575a613c695de7ec22c427d4e97da39f 100644
--- a/include/mk/automake.mk
+++ b/include/mk/automake.mk
@@ -45,7 +45,7 @@ m4/ltp-version.m4: VERSION
sed -n '1{s:LTP-:m4_define([LTP_VERSION],[:;s:$$:]):;p;q}' $< > $@
.PHONY: automake
-AUTOMAKE_FILES := config.guess config.sub install-sh missing stamp-h1
+AUTOMAKE_FILES := compile config.guess config.sub install-sh missing
automake: aclocal $(AUTOMAKE_FILES)
$(AUTOMAKE_FILES): m4/Makefile.in
m4/Makefile.in: m4/Makefile.am aclocal.m4
@@ -55,19 +55,17 @@ m4/Makefile.in: m4/Makefile.am aclocal.m4
ac-clean::
$(RM) -rf autom4te.cache
$(RM) -f config.log config.status
- $(RM) -f include/config.h include/stamp-h1
$(RM) -f m4/Makefile m4/ltp-version.m4
- for d in $(AUTOCONFED_SUBDIRS); do \
+ for d in $(AUTOCONFED_SUBDIRS) include; do \
$(MAKE) -C "$(top_srcdir)/$$d" $@; \
done
ac-distclean:: ac-clean
ac-maintainer-clean:: ac-distclean
- for d in $(AUTOCONFED_SUBDIRS); do \
+ for d in $(AUTOCONFED_SUBDIRS) include; do \
$(MAKE) -C "$(top_srcdir)/$$d" $@; \
done
$(RM) -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in
- $(RM) -f include/*config.h.in
# Don't include config.h, or make will (rightfully) whine about overriding
# rules.
@@ -82,7 +80,7 @@ AUTOGENERATED_FILES = \
m4/Makefile
distclean:: %: clean ac-distclean
- for d in $(AUTOCONFED_SUBDIRS); do \
+ for d in $(AUTOCONFED_SUBDIRS) include; do \
$(MAKE) -C "$(top_srcdir)/$$d" $@; \
done
$(RM) -f $(AUTOGENERATED_FILES)
--
2.49.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH v3 1/2] openposix: Makefile: Add the standard "maintainer-clean" target
2025-04-09 16:36 ` [LTP] [PATCH v3 1/2] openposix: Makefile: Add the standard "maintainer-clean" target Ricardo B. Marlière via ltp
@ 2025-04-23 7:14 ` Petr Vorel
0 siblings, 0 replies; 6+ messages in thread
From: Petr Vorel @ 2025-04-23 7:14 UTC (permalink / raw)
To: Ricardo B. Marlière; +Cc: Linux Test Project
Hi Ricardo,
patch merged. Thank you!
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH v3 2/2] include/Makefile: Fix cleaning targets
2025-04-09 16:36 ` [LTP] [PATCH v3 2/2] include/Makefile: Fix cleaning targets Ricardo B. Marlière via ltp
@ 2025-04-23 7:29 ` Petr Vorel
2025-04-24 15:24 ` Ricardo B. Marlière via ltp
0 siblings, 1 reply; 6+ messages in thread
From: Petr Vorel @ 2025-04-23 7:29 UTC (permalink / raw)
To: Ricardo B. Marlière; +Cc: Joerg Vehlow, Joerg Vehlow, Linux Test Project
Hi Ricardo,
[ Cc Joerg, who touched build system in the past. ]
> Add ac-clean target as dependency of ac-maintainer-clean and add missing
> files to the removal list. This way the project top level Makefile cleaning
> targets can make use of it. Also, add "compile" to the AUTOMAKE_FILES
> list.
nit: You also remove stamp-h1 from AUTOMAKE_FILES. Why? Did I suggest that?
It's created by configure (e.g. not automake), but I considered AUTOMAKE_FILES
holding files created by autotools.
> Cc: Andrea Cervesato <andrea.cervesato@suse.com>
FYI: we usually don't keep Cc: in the commit message (git format-patch --cc ...
or git send-email --cc ... has the same effect - sending mail, but don't
preserve it). Of course it can stay. I personally see more value with adding
Link: tag to patch in lore (for these who want/need to dig in history).
> Fixes: 817d8095fbfe ("Rename linux_syscall_numbers.h to lapi/syscalls.h")
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
> ---
> NOTE: The "compile" file is added during the autotools target:
> $ make autotools
> <snip>
> configure.ac:26: installing './compile'
> configure.ac:24: installing './config.guess'
> configure.ac:24: installing './config.sub'
> configure.ac:7: installing './install-sh'
> configure.ac:7: installing './missing'
> <snip>
> ---
> include/Makefile | 4 ++--
> include/mk/automake.mk | 10 ++++------
> 2 files changed, 6 insertions(+), 8 deletions(-)
> diff --git a/include/Makefile b/include/Makefile
> index 25e96df9b8cdd7d1d7e6f19925bf2160d682f0d9..6b31b046e452e71afb5097cc3fadf8af01282629 100644
> --- a/include/Makefile
> +++ b/include/Makefile
> @@ -18,8 +18,8 @@ MAKE_TARGETS :=
> distclean:: clean ac-distclean
> maintainer-clean:: distclean ac-maintainer-clean
> ac-clean ac-distclean::
> - $(RM) -f config.h
> -ac-maintainer-clean::
> + $(RM) -f config.h lapi/syscalls.h stamp-h1
> +ac-maintainer-clean:: ac-clean
> $(RM) -f config.h.in
> vpath %.h $(abs_srcdir)
> diff --git a/include/mk/automake.mk b/include/mk/automake.mk
> index 3df3b4ba99ca865caa89388999e53cbc500615dc..3b248ac9575a613c695de7ec22c427d4e97da39f 100644
> --- a/include/mk/automake.mk
> +++ b/include/mk/automake.mk
> @@ -45,7 +45,7 @@ m4/ltp-version.m4: VERSION
> sed -n '1{s:LTP-:m4_define([LTP_VERSION],[:;s:$$:]):;p;q}' $< > $@
> .PHONY: automake
> -AUTOMAKE_FILES := config.guess config.sub install-sh missing stamp-h1
> +AUTOMAKE_FILES := compile config.guess config.sub install-sh missing
> automake: aclocal $(AUTOMAKE_FILES)
> $(AUTOMAKE_FILES): m4/Makefile.in
> m4/Makefile.in: m4/Makefile.am aclocal.m4
> @@ -55,19 +55,17 @@ m4/Makefile.in: m4/Makefile.am aclocal.m4
> ac-clean::
> $(RM) -rf autom4te.cache
> $(RM) -f config.log config.status
> - $(RM) -f include/config.h include/stamp-h1
> $(RM) -f m4/Makefile m4/ltp-version.m4
> - for d in $(AUTOCONFED_SUBDIRS); do \
> + for d in $(AUTOCONFED_SUBDIRS) include; do \
nit: Wouldn't be better to have another variable which would be used in for loops?
CLEAN_SUBDIRS = $(AUTOCONFED_SUBDIRS) include
> $(MAKE) -C "$(top_srcdir)/$$d" $@; \
> done
> ac-distclean:: ac-clean
> ac-maintainer-clean:: ac-distclean
> - for d in $(AUTOCONFED_SUBDIRS); do \
> + for d in $(AUTOCONFED_SUBDIRS) include; do \
> $(MAKE) -C "$(top_srcdir)/$$d" $@; \
> done
> $(RM) -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in
> - $(RM) -f include/*config.h.in
> # Don't include config.h, or make will (rightfully) whine about overriding
> # rules.
> @@ -82,7 +80,7 @@ AUTOGENERATED_FILES = \
> m4/Makefile
> distclean:: %: clean ac-distclean
> - for d in $(AUTOCONFED_SUBDIRS); do \
> + for d in $(AUTOCONFED_SUBDIRS) include; do \
> $(MAKE) -C "$(top_srcdir)/$$d" $@; \
> done
> $(RM) -f $(AUTOGENERATED_FILES)
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH v3 2/2] include/Makefile: Fix cleaning targets
2025-04-23 7:29 ` Petr Vorel
@ 2025-04-24 15:24 ` Ricardo B. Marlière via ltp
0 siblings, 0 replies; 6+ messages in thread
From: Ricardo B. Marlière via ltp @ 2025-04-24 15:24 UTC (permalink / raw)
To: Petr Vorel; +Cc: Joerg Vehlow, Joerg Vehlow, Linux Test Project
Hello Petr!
On Wed Apr 23, 2025 at 4:29 AM -03, Petr Vorel wrote:
> Hi Ricardo,
>
> [ Cc Joerg, who touched build system in the past. ]
>
>> Add ac-clean target as dependency of ac-maintainer-clean and add missing
>> files to the removal list. This way the project top level Makefile cleaning
>> targets can make use of it. Also, add "compile" to the AUTOMAKE_FILES
>> list.
>
> nit: You also remove stamp-h1 from AUTOMAKE_FILES. Why? Did I suggest that?
> It's created by configure (e.g. not automake), but I considered AUTOMAKE_FILES
> holding files created by autotools.
>
Indeed, from my local testing the only stamp-h1 created by configure is
in include/ directory, which is why I added it to include/Makefile. Is
the top-level stamp-h1 still created somehow, e.g. using an older
version of automake? I didn't check.
>> Cc: Andrea Cervesato <andrea.cervesato@suse.com>
> FYI: we usually don't keep Cc: in the commit message (git format-patch --cc ...
> or git send-email --cc ... has the same effect - sending mail, but don't
> preserve it). Of course it can stay. I personally see more value with adding
> Link: tag to patch in lore (for these who want/need to dig in history).
>
When working on a series like this, you can tag individual commits so
that `b4` takes care of sending it to the relevant parties. Adding it to
the cover letter will send the whole series to them. But I guess we
don't need that tag anyway due to low traffic in LTP ML. I'll drop it.
>> Fixes: 817d8095fbfe ("Rename linux_syscall_numbers.h to lapi/syscalls.h")
>> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>> Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
>> ---
>
>> NOTE: The "compile" file is added during the autotools target:
>> $ make autotools
>> <snip>
>> configure.ac:26: installing './compile'
>> configure.ac:24: installing './config.guess'
>> configure.ac:24: installing './config.sub'
>> configure.ac:7: installing './install-sh'
>> configure.ac:7: installing './missing'
>> <snip>
>> ---
>> include/Makefile | 4 ++--
>> include/mk/automake.mk | 10 ++++------
>> 2 files changed, 6 insertions(+), 8 deletions(-)
>
>> diff --git a/include/Makefile b/include/Makefile
>> index 25e96df9b8cdd7d1d7e6f19925bf2160d682f0d9..6b31b046e452e71afb5097cc3fadf8af01282629 100644
>> --- a/include/Makefile
>> +++ b/include/Makefile
>> @@ -18,8 +18,8 @@ MAKE_TARGETS :=
>> distclean:: clean ac-distclean
>> maintainer-clean:: distclean ac-maintainer-clean
>> ac-clean ac-distclean::
>> - $(RM) -f config.h
>> -ac-maintainer-clean::
>> + $(RM) -f config.h lapi/syscalls.h stamp-h1
>> +ac-maintainer-clean:: ac-clean
>> $(RM) -f config.h.in
>
>> vpath %.h $(abs_srcdir)
>> diff --git a/include/mk/automake.mk b/include/mk/automake.mk
>> index 3df3b4ba99ca865caa89388999e53cbc500615dc..3b248ac9575a613c695de7ec22c427d4e97da39f 100644
>> --- a/include/mk/automake.mk
>> +++ b/include/mk/automake.mk
>> @@ -45,7 +45,7 @@ m4/ltp-version.m4: VERSION
>> sed -n '1{s:LTP-:m4_define([LTP_VERSION],[:;s:$$:]):;p;q}' $< > $@
>
>> .PHONY: automake
>> -AUTOMAKE_FILES := config.guess config.sub install-sh missing stamp-h1
>> +AUTOMAKE_FILES := compile config.guess config.sub install-sh missing
>> automake: aclocal $(AUTOMAKE_FILES)
>> $(AUTOMAKE_FILES): m4/Makefile.in
>> m4/Makefile.in: m4/Makefile.am aclocal.m4
>> @@ -55,19 +55,17 @@ m4/Makefile.in: m4/Makefile.am aclocal.m4
>> ac-clean::
>> $(RM) -rf autom4te.cache
>> $(RM) -f config.log config.status
>> - $(RM) -f include/config.h include/stamp-h1
>> $(RM) -f m4/Makefile m4/ltp-version.m4
>> - for d in $(AUTOCONFED_SUBDIRS); do \
>> + for d in $(AUTOCONFED_SUBDIRS) include; do \
> nit: Wouldn't be better to have another variable which would be used in for loops?
>
> CLEAN_SUBDIRS = $(AUTOCONFED_SUBDIRS) include
>
Agreed.
>> $(MAKE) -C "$(top_srcdir)/$$d" $@; \
>> done
>
>> ac-distclean:: ac-clean
>> ac-maintainer-clean:: ac-distclean
>> - for d in $(AUTOCONFED_SUBDIRS); do \
>> + for d in $(AUTOCONFED_SUBDIRS) include; do \
>> $(MAKE) -C "$(top_srcdir)/$$d" $@; \
>> done
>> $(RM) -f aclocal.m4 configure $(AUTOMAKE_FILES) m4/Makefile.in
>> - $(RM) -f include/*config.h.in
>
>> # Don't include config.h, or make will (rightfully) whine about overriding
>> # rules.
>> @@ -82,7 +80,7 @@ AUTOGENERATED_FILES = \
>> m4/Makefile
>
>> distclean:: %: clean ac-distclean
>> - for d in $(AUTOCONFED_SUBDIRS); do \
>> + for d in $(AUTOCONFED_SUBDIRS) include; do \
>> $(MAKE) -C "$(top_srcdir)/$$d" $@; \
>> done
>> $(RM) -f $(AUTOGENERATED_FILES)
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-04-24 15:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09 16:36 [LTP] [PATCH v3 0/2] configure: Tidy up removal of generated artifacts Ricardo B. Marlière via ltp
2025-04-09 16:36 ` [LTP] [PATCH v3 1/2] openposix: Makefile: Add the standard "maintainer-clean" target Ricardo B. Marlière via ltp
2025-04-23 7:14 ` Petr Vorel
2025-04-09 16:36 ` [LTP] [PATCH v3 2/2] include/Makefile: Fix cleaning targets Ricardo B. Marlière via ltp
2025-04-23 7:29 ` Petr Vorel
2025-04-24 15:24 ` Ricardo B. Marlière via ltp
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox