diff world/Makefile @ 2069:d0e00cd7b2a5

Add make target for building changelog.txt, that contains cleaned up versions of changelog entries regarding world maps and worldmap .loc files only. This target requires depencies that are not otherwise required (nor included or documented. :P)
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 21 Aug 2019 13:32:20 +0300
parents 97e4361d9ac9
children 1bba63b2d78f
line wrap: on
line diff
--- a/world/Makefile	Wed Aug 21 13:26:45 2019 +0300
+++ b/world/Makefile	Wed Aug 21 13:32:20 2019 +0300
@@ -30,6 +30,7 @@
 	@echo
 	@echo "gimp    : Execute Gimp with all PNG targets for post-processing."
 	@echo "clean   : Delete all the generated files."
+	@echo "changelog : Build changelog for map and location changes only."
 	@echo
 
 
@@ -46,6 +47,26 @@
 ### Special targets
 ###
 
+changelog.txt: $(addsuffix .map,$(WORLD_MAPS)) $(LOCLIST)
+	@( echo '<?xml version="1.0"?>' && echo '<log>' && \
+	hg log $+ -M -v -f --template \
+	'<logentry revision="{rev}"><author>{author|escape}</author><date>{date|isodate}</date><paths><path>{files}</path></paths><msg>{desc|escape}</msg></logentry>\n' && \
+	echo '</log>' ) | \
+	iconv -f "iso-8859-1" -t "utf-8" | \
+	xsltproc --stringparam strip-prefix "" \
+		 --stringparam linelen 80 \
+		 --stringparam groupbyday yes \
+		 --stringparam include-rev no \
+		 "svn2cl.xsl" - | \
+	sed 's/world\///g;s/maps\///g;s/Matti .*/Ggr/g;s/Jarkko .*/Jeskko/g' \
+	> $@
+
+# Build changelog
+changelog: changelog.txt
+	$(RSCP) $? $(UPLOAD_URL)
+	@touch $@
+
+
 # Upload changed files to site
 upload: $(TARGETS) $(LOCLIST)
 	$(RSCP) $? $(UPLOAD_URL)