Bryan O'Sullivan avatar 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:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.