Repository : ssh://git@open-mesh.org/doc
On branches: batman-adv-doc,master
commit 7599679e6dc5c9e6f459d4ffc1f10e2e68da3d82 Author: Sven Eckelmann sven.eckelmann@gmx.de Date: Mon Jan 26 12:48:29 2009 +0100
Try to track changes on images using a stamp
It is not easy to track changes on files in subdirectories using a Makefile. A workaround is to use a stamp file which is `touch`ed when changes to images were made. We still need to call make in the images subdirectory to generate new images. Because it is not possible to depend on the image phony target in a non phony target without recreating the non phony target in every call of make, we must deoend on it in a earlier (phony) target. This can lead to errors in rare circumstances like when somebody deletes a target file in images and then tries to create batman.pdf using `make batman.pdf` instead of `make batman_doc`.
7599679e6dc5c9e6f459d4ffc1f10e2e68da3d82 Makefile | 13 +++++++------ images/Makefile | 7 +++++-- 2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index 158d98e7..67f134b7 --- a/Makefile +++ b/Makefile @@ -5,13 +5,13 @@ default: all all: batman_doc .PHONY: clean images batman_doc batman_iv_only_doc .SUFFIXES: .docbook .fo .ps .pdf .html -batman_doc: batman.pdf batman.html -batman_iv_only_doc: batman_iv_only.pdf batman_iv_only.html +batman_doc: images batman.pdf batman.html +batman_iv_only_doc: images batman_iv_only.pdf batman_iv_only.html
-batman_iv_only.html: Makefile *.docbook images -batman_iv_only.pdf: Makefile *.docbook images -batman.html: Makefile *.docbook images -batman.pdf: Makefile *.docbook images +batman_iv_only.html: Makefile *.docbook images/stamp +batman_iv_only.pdf: Makefile *.docbook images/stamp +batman.html: Makefile *.docbook images/stamp +batman.pdf: Makefile *.docbook images/stamp
.docbook.fo: xmlto fo $< @@ -25,6 +25,7 @@ batman.pdf: Makefile *.docbook images .ps.pdf: ps2pdf $<
+images/stamp: images images: make -C images/ clean: diff --git a/images/Makefile b/images/Makefile index e42d0324..deb781eb 100644 --- a/images/Makefile +++ b/images/Makefile @@ -18,7 +18,10 @@ EPS_IMAGES+=$(TEX_IMAGES:.tex=.eps) .SUFFIXES: .dia .png .eps .gp
default: all -all: $(EPS_IMAGES) $(PNG_IMAGES) +all: stamp + +stamp: $(EPS_IMAGES) $(PNG_IMAGES) + touch $@
.gp.png: gnuplot $< @@ -46,4 +49,4 @@ all: $(EPS_IMAGES) $(PNG_IMAGES) convert file_tmp.ps $@ rm -f file_tmp.* clean: - rm -f *.png *.eps + rm -f *.png *.eps stamp