]> rtime.felk.cvut.cz Git - omk.git/commitdiff
doc/Makefile: Correct dependencies on .version
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 17 Feb 2011 20:39:28 +0000 (21:39 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 17 Feb 2011 20:44:54 +0000 (21:44 +0100)
doc/Makefile

index b9fee7375cf99f529b9ea6fb2f44ad236d04ba3e..8d85f0c0fef83b8d6e9bbb441e430504b964199e 100644 (file)
@@ -1,14 +1,14 @@
-SOURCE = omk-manual
 VERSION:=$(shell git describe|sed -e 's/^v//')
+OLDVERSION:=$(shell cat .version 2>/dev/null)
 
 .PHONY: FORCE
 
-all: $(SOURCE).txt $(SOURCE).html $(SOURCE).pdf
+all: omk-manual.txt omk-manual.html omk-manual.pdf
 
+ifneq ($(VERSION),$(OLDVERSION))
 .version: FORCE
        echo $(VERSION) | cmp -s $@ - || echo $(VERSION) > $@
-
-%.texinfo: .version
+endif
 
 PNG_FIGS = $(wildcard *.png)
 PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS))
@@ -16,14 +16,14 @@ PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS))
 %.pdf: %.png
        convert $< -density 150 $@
 
-%.pdf: %.texinfo $(PDF_FIGS)
+%.pdf: %.texinfo $(PDF_FIGS) .version
        texi2dvi --pdf $<
        texi2dvi --pdf $<
 
-%.txt: %.texinfo
+%.txt: %.texinfo .version
        makeinfo --no-headers --force -o $@ $<
 
-%.html: %.texinfo
+%.html: %.texinfo .version
        makeinfo --html --no-split -o $@ $<
 #      texi2html --l2h $<
 # Fix texinfo HTML output
@@ -34,11 +34,11 @@ PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS))
 #      mv $@.tmp $@
 
 clean:
-       rm -f $(addprefix $(SOURCE).,aux cp cps fn ky log pg toc tp vr vrs) $(PDF_FIGS) .version
+       rm -f $(addprefix omk-manual.,aux cp cps fn ky log pg toc tp vr vrs) $(PDF_FIGS) .version
 
 WWW ?= www
 
-web: all $(WWW) $(addprefix $(WWW)/,index.html $(SOURCE).html $(wildcard *.png) $(SOURCE).pdf $(wildcard RelNotes*.txt))
+web: all $(WWW) $(addprefix $(WWW)/,index.html omk-manual.html $(wildcard *.png) omk-manual.pdf $(wildcard RelNotes*.txt))
 
 $(WWW):
        mkdir $@