--- a/Makefile Thu Oct 03 17:22:01 2019 +0200
+++ b/Makefile Fri Oct 04 19:40:40 2019 +0200
@@ -13,6 +13,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
+VERSION_PARAMS := $(shell hg log -r '.' --template '--stringparam versionTag {latesttag} --stringparam versionDistance {latesttagdistance} --stringparam versionHash {node|short}')
+
all: validate xhtml txt pdf logo-png statistics
validate:
@@ -20,19 +22,19 @@
xhtml:
mkdir -p build
- xsltproc --output build/index.xhtml --nonet templates/ssm.xhtml.xsl text/ssm.en.xml
+ xsltproc $(VERSION_PARAMS) --output build/index.xhtml --nonet templates/ssm.xhtml.xsl text/ssm.en.xml
cp templates/*.css build
cp templates/*.woff build
pdf:
mkdir -p build
- xsltproc --output build/ssm.en.fodt --nonet templates/ssm.odt.xsl text/ssm.en.xml
+ xsltproc $(VERSION_PARAMS) --output build/ssm.en.fodt --nonet templates/ssm.odt.xsl text/ssm.en.xml
libreoffice --convert-to pdf --outdir build build/ssm.en.fodt
# TODO: better line wrapping
txt:
mkdir -p build
- xsltproc --nonet templates/ssm.txt.xsl text/ssm.en.xml | fmt -w 74 -s | sed -E 's/( +)([^- ])/\1 \2/g' > build/ssm.en.txt
+ xsltproc $(VERSION_PARAMS) --nonet templates/ssm.txt.xsl text/ssm.en.xml | fmt -w 74 -s | sed -E 's/( +)([^- ])/\1 \2/g' > build/ssm.en.txt
logo-png:
mkdir -p build