changeset 45:6b7b0339e7d6

Don't rerun examples unnecessarily.
author Bryan O'Sullivan <bos@serpentine.com>
date Sun, 23 Jul 2006 23:34:24 -0700
parents 012df94a02fe
children dd657c4d3a47
files en/Makefile en/examples/run-example
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/en/Makefile	Sun Jul 23 23:25:52 2006 -0700
+++ b/en/Makefile	Sun Jul 23 23:34:24 2006 -0700
@@ -17,7 +17,6 @@
 	mq-stack.svg
 
 example-sources := \
-	examples/run-example \
 	examples/daily.files \
 	examples/hook.simple \
 	examples/hook.ws \
@@ -111,8 +110,11 @@
 
 examples: examples/.run
 
-examples/.run: $(example-sources)
-	cd examples && ./run-example
+examples/.run: $(example-sources:%=%.run)
+	touch examples/.run
+
+examples/%.run: examples/% examples/run-example
+	cd examples && ./run-example $(notdir $<)
 
 build_id.tex: $(wildcard ../.hg/00changelog.[id])
 	echo -n $(hg_id) > build_id.tex
--- a/en/examples/run-example	Sun Jul 23 23:25:52 2006 -0700
+++ b/en/examples/run-example	Sun Jul 23 23:34:24 2006 -0700
@@ -122,6 +122,7 @@
                     # then its output
                     ofp.write(tex_escape(output))
             self.status('\n')
+            open(self.name + '.run', 'w')
         finally:
             try:
                 output = self.sendreceive('exit\n')
@@ -143,6 +144,7 @@
     for name in os.listdir(path):
         if name == 'run-example' or name.startswith('.'): continue
         if name.endswith('.out') or name.endswith('~'): continue
+        if name.endswith('.run'): continue
         pathname = os.path.join(path, name)
         st = os.lstat(pathname)
         if stat.S_ISREG(st.st_mode) and st.st_mode & 0111: