Commit 054bca1a2e9810b3017c868e344af8d6c4270767

Guillem Jover 2023-04-11T00:19:46

build: Terminate lists in variables with «# EOL» This means we can add a trailing «\» to every element, so that they can be removed without requiring modification of other lines, and can be easily sorted. Replace the old usage of $(nil) which could possibly end up with junk added if such variable is ever defined, in the environment.

diff --git a/Makefile.am b/Makefile.am
index afb2fdc..70acb1e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,11 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = include man src test
+SUBDIRS = \
+	include \
+	man \
+	src \
+	test \
+	# EOL
 
 ACLOCAL_AMFLAGS = -I m4
 
@@ -8,7 +13,7 @@ EXTRA_DIST = \
 	autogen \
 	get-version \
 	m4/libmd-linker.m4 \
-	$(nil)
+	# EOL
 
 dist-hook:
 	echo $(VERSION) >$(distdir)/.dist-version
diff --git a/include/Makefile.am b/include/Makefile.am
index e65451e..0df224e 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -7,7 +7,7 @@ include_HEADERS = \
 	rmd160.h \
 	sha1.h \
 	sha2.h \
-	$(nil)
+	# EOL
 
 # Compatibility headers
 include_HEADERS += \
@@ -15,4 +15,4 @@ include_HEADERS += \
 	sha.h \
 	sha256.h \
 	sha512.h \
-	$(nil)
+	# EOL
diff --git a/man/Makefile.am b/man/Makefile.am
index 141d83c..655e2ab 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,11 +1,11 @@
 EXTRA_DIST = \
 	mdX.3 \
-	$(nil)
+	# EOL
 
 CLEANFILES = \
 	md4.3 \
 	md5.3 \
-	$(nil)
+	# EOL
 
 SED_MD2_SUBST = -e 's/mdX/md2/g' -e 's/MDX/MD2/g'
 SED_MD4_SUBST = -e 's/mdX/md4/g' -e 's/MDX/MD4/g'
@@ -28,7 +28,7 @@ dist_man_MANS = \
 	rmd160.3 \
 	sha1.3 \
 	sha2.3 \
-	$(nil)
+	# EOL
 
 md2_FUNCS = \
 	MD2Transform \
@@ -39,7 +39,7 @@ md2_FUNCS = \
 	MD2File \
 	MD2FileChunk \
 	MD2Data \
-	$(nil)
+	# EOL
 
 $(md2_FUNCS): md2.3
 	$(LN_S) -f md2.3 $(DESTDIR)$(man3dir)/$@.3
@@ -54,7 +54,7 @@ md4_FUNCS = \
 	MD4FileChunk \
 	MD4Pad \
 	MD4Data \
-	$(nil)
+	# EOL
 
 $(md4_FUNCS): md4.3
 	$(LN_S) -f md4.3 $(DESTDIR)$(man3dir)/$@.3
@@ -69,7 +69,7 @@ md5_FUNCS = \
 	MD5FileChunk \
 	MD5Pad \
 	MD5Data \
-	$(nil)
+	# EOL
 
 $(md5_FUNCS): md5.3
 	$(LN_S) -f md5.3 $(DESTDIR)$(man3dir)/$@.3
@@ -84,7 +84,7 @@ rmd160_FUNCS = \
 	RMD160FileChunk \
 	RMD160Pad \
 	RMD160Data \
-	$(nil)
+	# EOL
 
 $(rmd160_FUNCS): rmd160.3
 	$(LN_S) -f rmd160.3 $(DESTDIR)$(man3dir)/$@.3
@@ -99,7 +99,7 @@ sha1_FUNCS = \
 	SHA1FileChunk \
 	SHA1Pad \
 	SHA1Data \
-	$(nil)
+	# EOL
 
 $(sha1_FUNCS): sha1.3
 	$(LN_S) -f sha1.3 $(DESTDIR)$(man3dir)/$@.3
@@ -132,7 +132,7 @@ sha2_FUNCS = \
 	SHA512File \
 	SHA512FileChunk \
 	SHA512Data \
-	$(nil)
+	# EOL
 
 $(sha2_FUNCS): sha2.3
 	$(LN_S) -f sha2.3 $(DESTDIR)$(man3dir)/$@.3
@@ -144,6 +144,6 @@ digest_FUNCS = \
 	$(rmd160_FUNCS) \
 	$(sha1_FUNCS) \
 	$(sha2_FUNCS) \
-	$(nil)
+	# EOL
 
 install-data-hook: $(digest_FUNCS)
diff --git a/src/Makefile.am b/src/Makefile.am
index 85b385c..d32f52f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,12 +4,12 @@ AM_CPPFLAGS = \
 	-I$(top_builddir) \
 	-I$(srcdir) \
 	-I$(top_srcdir)/include \
-	$(nil)
+	# EOL
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = \
 	libmd.pc \
-	$(nil)
+	# EOL
 
 lib_LTLIBRARIES = libmd.la
 
@@ -24,26 +24,30 @@ libmd_la_helper_sources = \
 	sha384hl.c \
 	sha512hl.c \
 	sha512_256hl.c \
-	$(nil)
+	# EOL
 
 EXTRA_libmd_la_DEPENDENCIES = \
 	libmd.map
 
 libmd_la_LDFLAGS = \
 	-no-undefined \
-	-version-number $(LIBMD_ABI)
+	-version-number $(LIBMD_ABI) \
+	# EOL
 if HAVE_LINKER_VERSION_SCRIPT
 libmd_la_LDFLAGS += \
-	-Wl,--version-script=$(srcdir)/libmd.map
+	-Wl,--version-script=$(srcdir)/libmd.map \
+	# EOL
 else
 libmd_la_LDFLAGS += \
-	-export-symbols libmd.sym
+	-export-symbols libmd.sym \
+	# EOL
 EXTRA_libmd_la_DEPENDENCIES += \
-	libmd.sym
+	libmd.sym \
+	# EOL
 endif
 EXTRA_libmd_la_DEPENDENCIES += \
 	helper.c \
-	$(nil)
+	# EOL
 libmd_la_SOURCES = \
 	local-link.h \
 	md2.c \
@@ -53,25 +57,25 @@ libmd_la_SOURCES = \
 	sha1.c \
 	sha2.c \
 	$(libmd_la_helper_sources) \
-	$(nil)
+	# EOL
 
 BUILT_SOURCES = \
 	$(libmd_la_helper_sources) \
-	$(nil)
+	# EOL
 
 EXTRA_DIST = \
 	libmd.map \
 	libmd.pc.in \
 	helper.c \
-	$(nil)
+	# EOL
 
 CLEANFILES = \
 	$(libmd_la_helper_sources) \
-	$(nil)
+	# EOL
 
 DISTCLEANFILES = \
 	libmd.sym \
-	$(nil)
+	# EOL
 
 # Generate a simple libtool symbol export list to be used as a fallback if
 # there is no version script support.
diff --git a/test/Makefile.am b/test/Makefile.am
index 9417069..0f7b41f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -3,13 +3,13 @@
 AM_CPPFLAGS = \
 	-I$(top_builddir) \
 	-I$(top_srcdir)/include \
-	$(nil)
+	# EOL
 
 LDADD = $(top_builddir)/src/libmd.la
 
 check_HEADERS = \
 	test.h \
-	$(nil)
+	# EOL
 
 check_PROGRAMS = \
 	md2 \
@@ -18,6 +18,6 @@ check_PROGRAMS = \
 	rmd160 \
 	sha1 \
 	sha2 \
-	$(nil)
+	# EOL
 
 TESTS = $(check_PROGRAMS)