Re: [LTP] [PATCH 2/4] openposix: Makefile: Add the standard "maintainer-clean" target

Petr Vorel
2025-04-01T07:38:52Z

Hi Ricardo,

> 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>

Thanks for fixing dark corners of LTP build system.

What a strange target name. Obviously it was meant to be run before release
file, but it was not even called in Makefile.release which I removed in
1088d93d99.

I was thinking whether we really need this target. Maybe it could be part of
distclean.

Kind regards,
Petr

> 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) $^