[LTP] [PATCH v3 2/2] include/Makefile: Fix cleaning targets
Petr Vorel
pvorel@suse.cz
Wed Apr 23 09:29:23 CEST 2025
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)
More information about the ltp
mailing list