From: Junio C Hamano Date: Mon, 26 Mar 2007 05:33:42 GMT Subject: Re: [PATCH 1/2] Documentation: Replace @@GIT_VERSION@@ in documentation Message-ID: <7v7it41scp.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <11748238102228-git-send-email-frank@lichtenheld.de> Frank Lichtenheld writes: > %.html : %.txt > $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $< > + sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' $@ >$@+ > + mv $@+ $@ > > %.1 %.7 : %.xml > xmlto -m callouts.xsl man $< > > %.xml : %.txt > $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf $< > + sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' $@ >$@+ > + mv $@+ $@ > > user-manual.xml: user-manual.txt user-manual.conf > $(ASCIIDOC) -b docbook -d book $< Sorry, but these compositions are wrong, as the build procedure can die after asciidoc finishes but before it manages to finish sed/mv. The next make invocation would not know that the previous one did not complete and would assume that the build product %.html or %.xml are up to date. Ideally if we can persuade asciidoc to output to its stdout, we could do this: rm -f $@+ $@ $(ASCIIDOC) --to-stdout ... | sed -e $(script) >$@+ mv $@+ $@