From a74c58b32aedd282cbb564f0ba66bf7edc4d55a2 Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Tue, 20 Feb 2024 01:46:32 +0100 Subject: [PATCH] Keep workaround for no-dist-built-files not being available As no-dist-built-files was only introduced in Automake 1.16.4, we cannot rely on that feature being present and need to continue using our own workaround. This hooks the dist-hook in a more robust fashion in the face of multiple dist-hook targets (and versioninfo.mk already uses one). --- src/Makefile.am | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index fc978271..3d7ac11f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,15 +31,19 @@ EXTRA_DIST = \ avrdude.spec \ bootstrap -CLEANFILES = \ - config_gram.c \ - config_gram.h \ - lexer.c +BUILT_SOURCES = +CLEANFILES = + +built_sources = +built_sources += config_gram.c +built_sources += config_gram.h +built_sources += lexer.c + +BUILT_SOURCES += $(built_sources) +CLEANFILES += $(built_sources) include build-helpers/versioninfo.mk -BUILT_SOURCES = $(CLEANFILES) - #SUBDIRS = doc #DIST_SUBDIRS = doc @@ -77,11 +81,12 @@ lib_LTLIBRARIES = libavrdude.la # https://savannah.nongnu.org/bugs/index.php?func=detailitem&item_id=15536 # # for why we don't want to have them. -dist-hook: - rm -f \ - $(distdir)/lexer.c \ - $(distdir)/config_gram.c \ - $(distdir)/config_gram.h +# +# We could avoid this dist-hook altogether if we could require +# Automake >= 1.16.4 and just use its no-dist-built-sources flag. +dist-hook: dist-hook-no-dist-built-sources-workaround +dist-hook-no-dist-built-sources-workaround: + cd "$(distdir)" && rm -f $(built_sources) libavrdude_a_SOURCES = \ config_gram.y \