wscript (1039B)
1 #!/usr/bin/env python 2 # encoding: utf-8 3 # Jérôme Carretero, 2010 (zougloub) 4 5 import sys, os 6 from Utils import subprocess 7 8 def configure(cfg): 9 cfg.load("tex") 10 11 def build(bld): 12 def waf_cmd(task): 13 outfile = os.path.join(task.generator.cwd, "output") 14 with open(outfile, "w") as f: 15 cmd = [ 16 sys.executable, 17 sys.argv[0], 18 "configure", 19 "build", 20 ] 21 proc = subprocess.Popen(cmd, cwd=task.generator.cwd, stdout=f, stderr=f) 22 ret = proc.wait() 23 if ret != 0: 24 raise Exception("command failed in %s: %s" % (task.generator.cwd, cmd)) 25 26 waf_dirs = [ os.path.join(bld.path.abspath(), "snippets", d) for d in ("waf-1", "waf-2") ] 27 for d in waf_dirs: 28 bld( 29 rule=waf_cmd, 30 cwd=d, 31 always=True, 32 name=d, 33 ) 34 35 make_dirs = [ os.path.join(bld.path.abspath(), "snippets", d) for d in ("make-1", "make-2") ] 36 for d in make_dirs: 37 bld( 38 rule="make -B > output", 39 cmd="", 40 cwd=d, 41 always=True, 42 name=d, 43 ) 44 45 bld.add_group() 46 47 bld( 48 features="tex", 49 type="xelatex", 50 source="slides.tex", 51 prompt=0, 52 ) 53