Skip to content

Instantly share code, notes, and snippets.

@hfeeki
Created February 17, 2014 07:41
Show Gist options
  • Save hfeeki/9046390 to your computer and use it in GitHub Desktop.
Save hfeeki/9046390 to your computer and use it in GitHub Desktop.
How to execute external command in scons like make file
document.pdf: table.tex
pdflatex document.tex
table.tex:
python table_generator.py
Something along these lines should do -
```
env.Command ('document.tex', '', 'python table_generator.py')
env.PDF ('document.pdf', 'document.tex')
```
It declares that 'document.tex' is generated by calling the Python script, and requests a PDF document to be created from this generatd 'document.tex' file.
Note that this is in spirit only. It may require some tweaking. In particular, I'm not certain what kind of semantics you would want for the generation of 'document.tex' - should it be generated every time? Only when it doesn't exist? When some other file changes? (you would want to add this dependency as the second argument to Command() that case).
In addition, the output of Command() can be used as input to PDF() if desired. For clarity, I didn't do that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment