[3/6] libdw: Let clean targets be unconditional

Message ID 20241010102559.9162-4-mcpratt@pm.me
State Committed
Headers
Series Various portability fixes and organization |

Commit Message

Michael Pratt Oct. 10, 2024, 10:27 a.m. UTC
  The automake rule "maintainer-clean-generic"
is always available and never conditional,
so let the variable that uses it be define
non-conditionally.

If one actually wants conditional cleaning
they should write a custom rule and set it
as a dependency of a "*clean-local" automake rule.

There is no need to do conditional cleaning here,
so move the MAINTAINERCLEANFILES variable definition
to the end of the Makefile.am file as it is
in the rest of the project.

      * libdw/Makefile.am: move MAINTAINERCLEANFILES
      variable to the end of the file
      as a non-conditional definition.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
---
 libdw/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Mark Wielaard Oct. 14, 2024, 9:05 p.m. UTC | #1
Hi Michael,

On Thu, Oct 10, 2024 at 10:27:09AM +0000, Michael Pratt wrote:
> The automake rule "maintainer-clean-generic"
> is always available and never conditional,
> so let the variable that uses it be define
> non-conditionally.
> 
> If one actually wants conditional cleaning
> they should write a custom rule and set it
> as a dependency of a "*clean-local" automake rule.
> 
> There is no need to do conditional cleaning here,
> so move the MAINTAINERCLEANFILES variable definition
> to the end of the Makefile.am file as it is
> in the rest of the project.
> 
>       * libdw/Makefile.am: move MAINTAINERCLEANFILES
>       variable to the end of the file
>       as a non-conditional definition.

You are right, there is no reason to only define MAINTAINERCLEANFILES
conditionally. Pushed.

Thanks,

Mark
  

Patch

diff --git a/libdw/Makefile.am b/libdw/Makefile.am
index 5363c02a..4b9c4413 100644
--- a/libdw/Makefile.am
+++ b/libdw/Makefile.am
@@ -97,7 +97,6 @@  libdw_a_SOURCES = dwarf_begin.c dwarf_begin_elf.c dwarf_end.c dwarf_getelf.c \
 
 if MAINTAINER_MODE
 BUILT_SOURCES = $(srcdir)/known-dwarf.h
-MAINTAINERCLEANFILES = $(srcdir)/known-dwarf.h
 $(srcdir)/known-dwarf.h: $(top_srcdir)/config/known-dwarf.awk $(srcdir)/dwarf.h
 	gawk -f $^ > $@.new
 	mv -f $@.new $@
@@ -154,3 +153,4 @@  noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h \
 EXTRA_DIST = libdw.map
 
 MOSTLYCLEANFILES = $(am_libdw_pic_a_OBJECTS) libdw.so libdw.so.$(VERSION)
+MAINTAINERCLEANFILES = $(srcdir)/known-dwarf.h