[LTP] [PATCH 3/4] include/Makefile: Fix cleaning targets

Ricardo B. Marliere via ltp
2025-03-27T21:58:22Z

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.

Cc: Andrea Cervesato <andrea.cervesato@suse.com>
Fixes: 817d8095fbfe ("Rename linux_syscall_numbers.h to lapi/syscalls.h")
Signed-off-by: Ricardo B. Marlière <rbm@suse.com>
---
include/Makefile | 4 ++--
include/mk/automake.mk | 4 ++--
2 files changed, 4 insertions(+), 4 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..d96da8313dc8dc4f4d6d728db72b0f749d269bfe 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 := 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,8 +55,8 @@ 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
+ $(MAKE) -C "$(top_srcdir)/include" $@;
for d in $(AUTOCONFED_SUBDIRS); do \
$(MAKE) -C "$(top_srcdir)/$$d" $@; \
done

--
2.49.0