]> granicus.if.org Git - postgis/commitdiff
Make POT creation rule phony, preventing useless ctime-only changes
authorSandro Santilli <strk@keybit.net>
Sat, 18 Oct 2014 11:46:02 +0000 (11:46 +0000)
committerSandro Santilli <strk@keybit.net>
Sat, 18 Oct 2014 11:46:02 +0000 (11:46 +0000)
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

doc/Makefile.in

index 7b710308a08cf131bc844cb9a5baf8902d975bb5..029699353cfe07ebfe25377afe55f2d8806089fb 100644 (file)
@@ -146,8 +146,24 @@ XML_INPUTS = $(XML_SOURCES) $(XML_GENERATED_SOURCES)
 
 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)