[debian-edu-commits] debian-edu/ 01/01: Makefile.common: Use Make internal functions 'subst' and 'wildcard' for LANGUAGES and directory variables, add comments. Thanks to Victory.

Wolfgang Schweer schweer-guest at moszumanska.debian.org
Mon Aug 15 23:11:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

schweer-guest pushed a commit to branch master
in repository debian-edu-doc.

commit 3e4afbaba13156d77969a686705381c12ed9da3a
Author: Wolfgang Schweer <wschweer at arcor.de>
Date:   Tue Aug 16 01:10:44 2016 +0200

    Makefile.common: Use Make internal functions 'subst' and 'wildcard' for LANGUAGES and directory variables, add comments.
    Thanks to Victory.
---
 debian/changelog                     |  8 ++++++++
 documentation/common/Makefile.common | 10 +++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 19d9376..47ca3b7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+debian-edu-doc (1.905~20160821) UNRELEASED; urgency=medium
+
+  * Makefile.common: Use Make internal functions 'subst' and 'wildcard'
+    for LANGUAGES and directory variables, add comments.
+    Thanks to Victory.
+
+ -- Wolfgang Schweer <wschweer at arcor.de>  Tue, 16 Aug 2016 01:04:26 +0200
+
 debian-edu-doc (1.904~20160815) unstable; urgency=medium
 
   [ Holger Levsen ]
diff --git a/documentation/common/Makefile.common b/documentation/common/Makefile.common
index 5b1ac8e..555305c 100644
--- a/documentation/common/Makefile.common
+++ b/documentation/common/Makefile.common
@@ -3,15 +3,19 @@
 #
 DESTDIR=
 DESTPATH = /usr/share/doc
-LANGUAGES = `find . -name "$(name).*.po" | sed -e "s/.\/$(name).//" -e "s/.po//"`
+# Use Make internal functions 'subst' and 'wildcard'; (from right to left):
+# get list of all PO files in dir, first substitute the extension with nothing,
+# then do so for the manual name to get the list of languages.
+LANGUAGES = $(subst $(name).,,$(subst .po,,$(wildcard *.po)))
 # Program name and option
 DBTOEPUB = dbtoepub
 XP = xsltproc --nonet --novalid --xinclude ../common/html.xsl
 DBLATEX = dblatex -T db2latex -b xetex -p ../common/dblatex.xsl
 SED_JA_REGEX = 's/dbtimestamp/dbtimestamp\ format=\"Y\ 年\ m\ 月\ d\ 日\"/'
 
-# that's ugly, smarter approach appreciated
-directory = `echo $(name) | sed 's/-manual//'`
+# Use Make internal function 'subst': substitute -manual with nothing to get
+# the directory name.
+directory = $(subst -manual,,$(name))
 
 all: build
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-doc.git



More information about the debian-edu-commits mailing list