Also adds an "update-pot" rule to just update the pots, with no merging
of the pos (not really useful if not for debugging)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13089
b70326c6-7e19-0410-871a-
916f4a2858ee
XML_INPUTS_POT = $(XML_SOURCES:%.xml=po/templates/%.xml.pot)
+.PHONY: $(XML_INPUTS_POT)
$(XML_INPUTS_POT): po/templates/%.xml.pot: %.xml
- $(XML2POT) $< > $@
+ @if test -f $@; then \
+ $(XML2POT) $< > $@.tmp; \
+ changed=`diff $@.tmp $@ | grep -v '^[<>] "POT-Creation-Date:' | wc -l`; \
+ if expr $${changed} \> 3 >/dev/null; then \
+ echo "$@ updated"; \
+ mv $@.tmp $@; \
+ else \
+ echo "$@ unchanged"; \
+ rm $@.tmp; \
+ fi; \
+ else \
+ $(XML2POT) $< > $@; \
+ fi;
+
+# Update translation templates
+update-pot: $(XML_INPUTS_POT)
# Creates or updates translation files
update-po: $(XML_INPUTS_POT)