Commits

Bryan O'Sullivan committed 6b7b033

Don't rerun examples unnecessarily.

Comments (0)

Files changed (2)

 	mq-stack.svg
 
 example-sources := \
-	examples/run-example \
 	examples/daily.files \
 	examples/hook.simple \
 	examples/hook.ws \
 
 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

en/examples/run-example

                     # then its output
                     ofp.write(tex_escape(output))
             self.status('\n')
+            open(self.name + '.run', 'w')
         finally:
             try:
                 output = self.sendreceive('exit\n')
     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: