include/Makefile: Fix cleaning targets
PATCH v4 1/1 include/Makefile: Fix cleaning targets
From: Ricardo B. Marlière <[email protected]>
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 and move stamp-h1 to where it's actually created: within include/ directory.
---
Changes in v4:
- Defined $CLEAN_SUBDIRS
- Fixed git commit message
- Link to v3: https://lore.kernel.org/r/[email protected]
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/[email protected]
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/[email protected]
---
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 | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-)
include/Makefile +2 -2
@@ -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)
include/mk/automake.mk +6 -6
@@ -13,6 +13,8 @@ AUTOMAKE ?= automake AUTOCONFED_SUBDIRS = \ testcases/open_posix_testsuite +CLEAN_SUBDIRS = $(AUTOCONFED_SUBDIRS) include + # We want to run this every single time to ensure that all of the prereq files # are there. .PHONY: testcases/open_posix_testsuite/configure
@@ -45,7 +47,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 +57,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 $(CLEAN_SUBDIRS); 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 $(CLEAN_SUBDIRS); 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 +82,7 @@ AUTOGENERATED_FILES = \ m4/Makefile distclean:: %: clean ac-distclean - for d in $(AUTOCONFED_SUBDIRS); do \ + for d in $(CLEAN_SUBDIRS); do \ $(MAKE) -C "$(top_srcdir)/$$d" $@; \ done $(RM) -f $(AUTOGENERATED_FILES)
---
base-commit: c12387876a40837aa93aac6e50331705ed0ff393
change-id: 20250327-fix_make_clean-8e57ffe1ce2c
Best regards,
Signature · 5 lines
Ricardo B. Marlière <[email protected]> -- Mailing list info: https://lists.linux.it/listinfo/ltp
Petr Vorel
AppliedHi Ricardo,
merged, thanks!
Kind regards,
Petr
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp