From 4685df45efa71c36321128043288d362c9a9057a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Fri, 16 Apr 2010 01:13:21 -0400 Subject: [PATCH] Transitioned build system from Make to SCons --- .gitignore | 3 + README | 4 +- tex/Makefile | 23 ----- tex/SConstruct | 8 ++ tex/site_cons/__init__.py | 0 tex/site_cons/site_init.py | 43 +++++++++ tex/site_cons/site_tools/__init__.py | 0 tex/site_cons/site_tools/asymptote.py | 89 ++++++++++++++++++ tex/site_cons/site_tools/gnuplot.py | 75 +++++++++++++++ tex/src/Makefile | 15 --- tex/src/SConscript | 51 ++++++++++ tex/src/apparatus/Makefile | 3 - tex/src/cantilever-calib/Makefile | 3 - tex/src/cantilever-calib/test/Makefile | 9 -- tex/src/cantilever-calib/test/SConscript | 15 +++ tex/src/cantilever/Makefile | 3 - tex/src/contour-space/Makefile | 3 - tex/src/figures/Makefile | 16 ---- tex/src/figures/SConscript | 9 ++ tex/src/figures/asy/SConscript | 8 ++ tex/src/figures/biotin-streptavidin/Makefile | 7 -- .../figures/biotin-streptavidin/SConscript | 11 +++ .../figures/calibration-concept-map/Makefile | 7 -- .../calibration-concept-map/SConscript | 10 ++ tex/src/figures/cantilever-data/Makefile | 72 -------------- tex/src/figures/cantilever-data/SConscript | 89 ++++++++++++++++++ .../cantilever-data/make_v_dep_plots.sh | 4 +- tex/src/figures/cantilever-data/wtk_graph.asy | 1 - tex/src/figures/cantilever-sim/Makefile | 14 --- tex/src/figures/cantilever-sim/SConscript | 14 +++ tex/src/figures/cantilever-sim/wtk_graph.asy | 1 - tex/src/figures/contour/Makefile | 14 --- tex/src/figures/contour/SConscript | 14 +++ tex/src/figures/expt-sawtooth/Makefile | 7 -- tex/src/figures/expt-sawtooth/SConscript | 8 ++ .../figures/expt-sawtooth/{plot.gp => fig.gp} | 0 tex/src/figures/fit-space/Makefile | 7 -- tex/src/figures/fit-space/SConscript | 8 ++ tex/src/figures/fit-space/{plot.gp => fig.gp} | 0 tex/src/figures/fit-space/king_vs_best.gp | 4 +- tex/src/figures/fit-space/king_vs_best.png | Bin 4972 -> 0 bytes tex/src/figures/fit-space/means.gp | 3 +- tex/src/figures/i27/Makefile | 7 -- tex/src/figures/i27/SConscript | 11 +++ tex/src/figures/kappa-sawteeth/Makefile | 7 -- tex/src/figures/kappa-sawteeth/SConscript | 8 ++ .../kappa-sawteeth/{plot.gp => fig.gp} | 0 tex/src/figures/order-dep/Makefile | 7 -- tex/src/figures/order-dep/SConscript | 19 ++++ tex/src/figures/order-dep/{plot.gp => fig.gp} | 0 tex/src/figures/schematic/Makefile | 14 --- tex/src/figures/schematic/SConscript | 17 ++++ tex/src/figures/schematic/wtk_graph.asy | 1 - tex/src/figures/sim-hist/Makefile | 7 -- tex/src/figures/sim-hist/SConscript | 8 ++ tex/src/figures/sim-hist/{plot.gp => fig.gp} | 0 tex/src/figures/sim-sawtooth/Makefile | 7 -- tex/src/figures/sim-sawtooth/SConscript | 9 ++ .../figures/sim-sawtooth/{plot.gp => fig.gp} | 0 tex/src/figures/v-dep/Makefile | 10 -- tex/src/figures/v-dep/SConscript | 8 ++ .../figures/v-dep/{plot-sd.gp => fig-sd.gp} | 0 tex/src/figures/v-dep/{plot.gp => fig.gp} | 0 tex/src/future/Makefile | 3 - tex/src/introduction/Makefile | 3 - tex/src/packages/Makefile | 11 --- tex/src/packages/SConscript | 16 ++++ tex/src/sawsim/Makefile | 3 - tex/src/temperature-theory/Makefile | 3 - tex/src/temperature/Makefile | 3 - tex/src/tension/Makefile | 3 - tex/src/unfolding-distributions/Makefile | 3 - tex/src/unfolding/Makefile | 3 - tex/src/viscocity/Makefile | 3 - 74 files changed, 559 insertions(+), 310 deletions(-) create mode 100644 .gitignore delete mode 100644 tex/Makefile create mode 100644 tex/SConstruct create mode 100644 tex/site_cons/__init__.py create mode 100644 tex/site_cons/site_init.py create mode 100644 tex/site_cons/site_tools/__init__.py create mode 100644 tex/site_cons/site_tools/asymptote.py create mode 100644 tex/site_cons/site_tools/gnuplot.py delete mode 100644 tex/src/Makefile create mode 100644 tex/src/SConscript delete mode 100644 tex/src/apparatus/Makefile delete mode 100644 tex/src/cantilever-calib/Makefile delete mode 100644 tex/src/cantilever-calib/test/Makefile create mode 100644 tex/src/cantilever-calib/test/SConscript delete mode 100644 tex/src/cantilever/Makefile delete mode 100644 tex/src/contour-space/Makefile delete mode 100644 tex/src/figures/Makefile create mode 100644 tex/src/figures/SConscript create mode 100644 tex/src/figures/asy/SConscript delete mode 100644 tex/src/figures/biotin-streptavidin/Makefile create mode 100644 tex/src/figures/biotin-streptavidin/SConscript delete mode 100644 tex/src/figures/calibration-concept-map/Makefile create mode 100644 tex/src/figures/calibration-concept-map/SConscript delete mode 100644 tex/src/figures/cantilever-data/Makefile create mode 100644 tex/src/figures/cantilever-data/SConscript delete mode 120000 tex/src/figures/cantilever-data/wtk_graph.asy delete mode 100644 tex/src/figures/cantilever-sim/Makefile create mode 100644 tex/src/figures/cantilever-sim/SConscript delete mode 120000 tex/src/figures/cantilever-sim/wtk_graph.asy delete mode 100644 tex/src/figures/contour/Makefile create mode 100644 tex/src/figures/contour/SConscript delete mode 100644 tex/src/figures/expt-sawtooth/Makefile create mode 100644 tex/src/figures/expt-sawtooth/SConscript rename tex/src/figures/expt-sawtooth/{plot.gp => fig.gp} (100%) delete mode 100644 tex/src/figures/fit-space/Makefile create mode 100644 tex/src/figures/fit-space/SConscript rename tex/src/figures/fit-space/{plot.gp => fig.gp} (100%) delete mode 100644 tex/src/figures/fit-space/king_vs_best.png delete mode 100644 tex/src/figures/i27/Makefile create mode 100644 tex/src/figures/i27/SConscript delete mode 100644 tex/src/figures/kappa-sawteeth/Makefile create mode 100644 tex/src/figures/kappa-sawteeth/SConscript rename tex/src/figures/kappa-sawteeth/{plot.gp => fig.gp} (100%) delete mode 100644 tex/src/figures/order-dep/Makefile create mode 100644 tex/src/figures/order-dep/SConscript rename tex/src/figures/order-dep/{plot.gp => fig.gp} (100%) delete mode 100644 tex/src/figures/schematic/Makefile create mode 100644 tex/src/figures/schematic/SConscript delete mode 120000 tex/src/figures/schematic/wtk_graph.asy delete mode 100644 tex/src/figures/sim-hist/Makefile create mode 100644 tex/src/figures/sim-hist/SConscript rename tex/src/figures/sim-hist/{plot.gp => fig.gp} (100%) delete mode 100644 tex/src/figures/sim-sawtooth/Makefile create mode 100644 tex/src/figures/sim-sawtooth/SConscript rename tex/src/figures/sim-sawtooth/{plot.gp => fig.gp} (100%) delete mode 100644 tex/src/figures/v-dep/Makefile create mode 100644 tex/src/figures/v-dep/SConscript rename tex/src/figures/v-dep/{plot-sd.gp => fig-sd.gp} (100%) rename tex/src/figures/v-dep/{plot.gp => fig.gp} (100%) delete mode 100644 tex/src/future/Makefile delete mode 100644 tex/src/introduction/Makefile delete mode 100644 tex/src/packages/Makefile create mode 100644 tex/src/packages/SConscript delete mode 100644 tex/src/sawsim/Makefile delete mode 100644 tex/src/temperature-theory/Makefile delete mode 100644 tex/src/temperature/Makefile delete mode 100644 tex/src/tension/Makefile delete mode 100644 tex/src/unfolding-distributions/Makefile delete mode 100644 tex/src/unfolding/Makefile delete mode 100644 tex/src/viscocity/Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a3f5fec --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.pyc +.sconsign.dblite +config.log diff --git a/README b/README index 69d6731..a085c5a 100644 --- a/README +++ b/README @@ -9,10 +9,10 @@ All the goodies are in the tex/ directory. Build with $ cd tex - tex$ make + tex$ scons Rebuild (after editing some file(s) in tex/src/) with - tex$ make + tex$ scons Getting the source diff --git a/tex/Makefile b/tex/Makefile deleted file mode 100644 index 2d1c300..0000000 --- a/tex/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -LATEX = pdflatex -#LATEX = xelatex - -thesis.pdf : build - (cd ./build && $(LATEX) root) - (cd ./build && bibtex root) - (cd ./build && $(LATEX) root) - (cd ./build && bibtex root) - (cd ./build && $(LATEX) root) - (cd ./build && bibtex root) - (cd ./build && makeindex root.nlo -s nomencl.ist -o root.nls) - (cd ./build && makeindex root.idx) - (cd ./build && $(LATEX) root) - (cd ./build && $(LATEX) root) - mv build/root.pdf $@ - -.PHONY: build -build : - rsync -a src/ build - $(MAKE) --directory build all - -clean : - rm -rf build thesis.pdf diff --git a/tex/SConstruct b/tex/SConstruct new file mode 100644 index 0000000..89d20a0 --- /dev/null +++ b/tex/SConstruct @@ -0,0 +1,8 @@ +#Help("""...""") + +VariantDir('build', 'src') +thesis_build = SConscript('build/SConscript') +Clean(thesis_build, 'build') +thesis_pdf = Command('thesis.pdf', thesis_build, Copy("$TARGET", "$SOURCE")) +Alias('pdf', thesis_pdf) +Default(thesis_pdf) diff --git a/tex/site_cons/__init__.py b/tex/site_cons/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tex/site_cons/site_init.py b/tex/site_cons/site_init.py new file mode 100644 index 0000000..a4131ff --- /dev/null +++ b/tex/site_cons/site_init.py @@ -0,0 +1,43 @@ +import os.path +import SCons.Node.FS + + +def include_child_SConscripts(env, SConscript): + """Get all the nested SConscripts in that may alter and pass back + the environment. They may also add thesis subdependencies to that + environment. + """ + for subdir in env.Glob('*'): + if not isinstance(subdir, SCons.Node.FS.Dir): + continue # subdir isn't a directory + var_sconscript_path = os.path.join(subdir.abspath, + 'SConscript') + src_sconscript_path = os.path.join(subdir.srcnode().abspath, + 'SConscript') + if os.path.exists(src_sconscript_path): + if env.GetOption('silent') is False: + # ideally 'silent' should be -Q, not the current -s/--silent/--quiet + print 'Including', var_sconscript_path + env = SConscript(var_sconscript_path, 'env') + return env + +def check_exec(context, executible): + # TODO: context.env vs. context.vardict + context.Message('Checking for %s executible...' % executible) + if executible.upper() in context.env: + context.Result('yes') + return 'yes' + result = 'no' + for p in context.env.Dictionary()['ENV']['PATH']: + path = os.path.join(p, executible) + if os.path.exists(path): + result = 'yes' + break + context.Result(result) + if result is 'yes': + context.env[executible.upper()] = path + return result + +def link_wtk_graph(env): + return env.Command('wtk_graph.asy', '../asy/wtk_graph.asy', + SCons.Script.Copy('$TARGET', '$SOURCE')) diff --git a/tex/site_cons/site_tools/__init__.py b/tex/site_cons/site_tools/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tex/site_cons/site_tools/asymptote.py b/tex/site_cons/site_tools/asymptote.py new file mode 100644 index 0000000..40de5ab --- /dev/null +++ b/tex/site_cons/site_tools/asymptote.py @@ -0,0 +1,89 @@ +import os.path +import re +import SCons.Action +import SCons.Scanner +import SCons.Script +import SCons.Util +import doctest + + +double_quoted_string_re = re.compile(r'"([^"]*)"', re.M) + +def asymptote_scan(node, env, path, arg=None): + """ + >>> class node (object): + ... def __init__(self, path): + ... self.path = path + ... self.abspath = os.path.abspath(self.path) + ... if os.path.isfile(self.path): + ... self.dir = node(os.path.dirname(path)) + ... def get_text_contents(self): + ... return open(self.path, 'r').read() + ... def get_contents(self): + ... return self.get_text_contents() + ... def srcnode(self): + ... return self + >>> for p in asymptote_scan( + ... node('../../src/figures/cantilever-sim/v-dep.asy'), + ... None, None, None): + ... print p + v-dep.d/v_dep_127_8 + v-dep.d/v_dep_27_8 + v-dep.d/v_dep_127_30 + v-dep.d/v_dep_27_30 + v-dep.d/v_dep_0.1_1 + v-dep.d/v_dep_0.1_30 + """ + try: + contents = node.get_text_contents() + except AttributeError: + contents = node.get_contents() # for older versions of SCons, fall back on binary read + ret = [] + for string in double_quoted_string_re.findall(contents): + p = os.path.join(node.dir.srcnode().abspath, string) + if len(string) > 0 and \ + ((string not in ret and os.path.exists(p)) + or string.endswith('.dat')): + ret.append(string) + return ret + +def asymptote_emitter(target, source, env): + assert str(source[0]).endswith('.asy'), str(source[0]) + filebase = str(source[0])[:-len('.asy')] + target.extend(['%s_%s' % (filebase, ext) + for ext in ['.tex', '.pre', '0.pdf']]) + target.extend(['%s-comp.%s' % (filebase, ext) + for ext in ['idx', 'log', 'nlo', 'pdf']]) + source.append(SCons.Script.Alias('asytools')) + return target, source + +AsymptoteAction = None + +def generate(env): + """Add Builders and construction variables for Asymptote to an Environment.""" + global AsymptoteAction + if AsymptoteAction is None: + AsymptoteAction = SCons.Action.Action('$ASYMPTOTECOM', '$ASYMPTOTECOMSTR') + + #import pdf + #pdf.generate(env) + + env['BUILDERS']['Asymptote'] = SCons.Script.Builder( + action=AsymptoteAction, suffix='_.tex', src_suffix = '.asy', + emitter=asymptote_emitter) + env['ASYMPTOTE'] = '../asy/asyprocess' + env['ASYMPTOTEFLAGS'] = SCons.Util.CLVar( + "--texinputs=../..: " + "--pretex='\documentclass{drexel-thesis} \input{packages}' " + "--") + env['ASYMPTOTECOM'] = 'cd ${TARGET.dir} && $ASYMPTOTE $ASYMPTOTEFLAGS ${SOURCE.filebase}' + env.Append(SCANNERS=SCons.Scanner.Base( + function=asymptote_scan, + name='Asymptote', + skeys=['.asy'])) + +def exists(env): + return env.Detect('asymptote') + +if __name__ == '__main__': + doctest.testmod() diff --git a/tex/site_cons/site_tools/gnuplot.py b/tex/site_cons/site_tools/gnuplot.py new file mode 100644 index 0000000..7d62bc3 --- /dev/null +++ b/tex/site_cons/site_tools/gnuplot.py @@ -0,0 +1,75 @@ +import os.path +import re +import SCons.Action +import SCons.Scanner +import SCons.Script +import SCons.Util +import doctest + +quoted_string_re = re.compile(r"'([^']*)'", re.M) + +def gnuplot_scan(node, env, path, arg=None): + """ + >>> class node (object): + ... def __init__(self, path): + ... self.path = path + ... self.abspath = os.path.abspath(self.path) + ... if os.path.isfile(self.path): + ... self.dir = node(os.path.dirname(path)) + ... def get_text_contents(self): + ... return open(self.path, 'r').read() + ... def get_contents(self): + ... return self.get_text_contents() + ... def srcnode(self): + ... return self + >>> for p in gnuplot_scan( + ... node('../../src/figures/order-dep/fig.gp'), + ... None, None, None): + ... print p + data/order.avg-4 + data/order.avg-8 + data/order.avg-12 + data/order.avg-16 + data/hist3i.hist + data/hist3ii.hist + data/hist3iii.hist + """ + try: + contents = node.get_text_contents() + except AttributeError: + contents = node.get_contents() # for older versions of SCons, fall back on binary read + ret = [] + for string in quoted_string_re.findall(contents): + p = os.path.join(node.dir.srcnode().abspath, string) + if len(string) > 0 and \ + ((string not in ret and os.path.exists(p)) + or string.endswith('.dat')): + ret.append(string) + return ret + +GnuplotAction = None + +def generate(env): + """Add Builders and construction variables for Gnuplot to an Environment.""" + global GnuplotAction + if GnuplotAction is None: + GnuplotAction = SCons.Action.Action('$GNUPLOTCOM', '$GNUPLOTCOMSTR') + + #import pdf + #pdf.generate(env) + + env['BUILDERS']['Gnuplot'] = SCons.Script.Builder( + action=GnuplotAction, suffix='.pdf', src_suffix = '.gp') + env['GNUPLOT'] = 'gnuplot' + env['GNUPLOTFLAGS'] = '' #SCons.Util.CLVar('') + env['GNUPLOTCOM'] = 'cd ${TARGET.dir} && $GNUPLOT $GNUPLOTLAGS ${SOURCE.file}' + env.Append(SCANNERS=SCons.Scanner.Base( + function=gnuplot_scan, + name='Gnuplot', + skeys=['.gp'])) + +def exists(env): + return env.Detect('gnuplot') + +if __name__ == '__main__': + doctest.testmod() diff --git a/tex/src/Makefile b/tex/src/Makefile deleted file mode 100644 index b747772..0000000 --- a/tex/src/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -SUBDIRS = packages apparatus cantilever cantilever-calib contour-space \ - figures future introduction sawsim temperature temperature-theory \ - tension unfolding unfolding-distributions viscocity - -all : - @for i in $(SUBDIRS); do \ - echo "make all in $$i..."; \ - (cd $$i; $(MAKE) $(MFLAGS) all); done - @for file in $(shell find . -name '*.tex'); do \ - cat local_words >> $$file; done - -clean : - @for i in $(SUBDIRS); do \ - echo "make clean in $$i..."; \ - (cd $$i; $(MAKE) $(MFLAGS) clean); done diff --git a/tex/src/SConscript b/tex/src/SConscript new file mode 100644 index 0000000..ce08fd4 --- /dev/null +++ b/tex/src/SConscript @@ -0,0 +1,51 @@ +import os.path +import SCons.Scanner + +from site_cons.site_init import include_child_SConscripts, check_exec +from site_cons.site_tools import asymptote, gnuplot + +# Make a new environment. +env = Environment(ENV={ + 'PATH':['/usr/local/bin', '/opt/bin', '/bin', '/usr/bin'], + 'HOME':os.path.expanduser('~'), + 'DISPLAY':os.environ['DISPLAY'], + 'PYMOL_PATH':'/usr/lib/python2.6/site-packages/pymol', + 'PYMOL_DATA':'/usr/share/pymol/data', + 'PYMOL_SCRIPTS':'/usr/share/pymol/scripts', + }) +asymptote.generate(env) +gnuplot.generate(env) + +if not env.GetOption('clean'): + # Configure the environment since we're not cleaning. + conf = Configure(env, custom_tests={'CheckExec':check_exec}) + if not conf.CheckExec('pymol'): + print 'PyMol is not installed!' + Exit(1) + conf.CheckExec('dot') + env = conf.Finish() + +# Include sub-SConscript files with rules for figures, packages, etc. +env = include_child_SConscripts(env, SConscript) + +# Alias the thesis' base latex, which is used by asyprocess when +# building the Asymptote graphics. +Alias('latex-base', [Glob('*.tex'), Alias('extra-packages')]) + +# Add a rule for the thesis itself. +#thesis = Command('thesis', objs, 'TODO') +thesis = env.Command('thesis.pdf', [], Touch('$TARGET')) + +Return('thesis') + +#thesis.pdf : build +# (cd ./build && $(LATEX) root) +# (cd ./build && bibtex root) +# (cd ./build && $(LATEX) root) +# (cd ./build && bibtex root) +# (cd ./build && $(LATEX) root) +# (cd ./build && bibtex root) +# (cd ./build && makeindex root.nlo -s nomencl.ist -o root.nls) +# (cd ./build && makeindex root.idx) +# (cd ./build && $(LATEX) root) +# (cd ./build && $(LATEX) root) diff --git a/tex/src/apparatus/Makefile b/tex/src/apparatus/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/apparatus/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/cantilever-calib/Makefile b/tex/src/cantilever-calib/Makefile deleted file mode 100644 index a260214..0000000 --- a/tex/src/cantilever-calib/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/cantilever-calib/test/Makefile b/tex/src/cantilever-calib/test/Makefile deleted file mode 100644 index 386a300..0000000 --- a/tex/src/cantilever-calib/test/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -PYTHON_FILES = Lorentz_root locate_roots test_integral test_roots - -all : $(PYTHON_FILES:%=%.png) - -%.png : %.py - python $< - -clean : - rm -f $(PYTHON_FILES:%=%.png) diff --git a/tex/src/cantilever-calib/test/SConscript b/tex/src/cantilever-calib/test/SConscript new file mode 100644 index 0000000..0ed1c31 --- /dev/null +++ b/tex/src/cantilever-calib/test/SConscript @@ -0,0 +1,15 @@ +print 'reading', __file__ + +# Get the passed in environment. +Import('env') + +# Configure the builders. This is all we're doing here for this case. +env = SConscript('builders.SConscript', 'env') + +for python_file in Glob('*.py'): + env.Command(python_file.replace('.py', '.png'), + python_file, + 'python $SOURCE') + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/cantilever/Makefile b/tex/src/cantilever/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/cantilever/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/contour-space/Makefile b/tex/src/contour-space/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/contour-space/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/figures/Makefile b/tex/src/figures/Makefile deleted file mode 100644 index 96fdf01..0000000 --- a/tex/src/figures/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -SUBDIRS = biotin-streptavidin cantilever-data cantilever-sim contour \ - expt-sawtooth fit-space i27 kappa-sawteeth order-dep schematic \ - sim-hist sim-sawtooth v-dep \ - # calibration-concept-map - -all : - @for i in $(SUBDIRS); do \ - echo "make all in $$i..."; \ - $(MAKE) --directory $$i $(MFLAGS) all; \ - done - -clean : - @for i in $(SUBDIRS); do \ - echo "make all in $$i..."; \ - $(MAKE) --directory $$i $(MFLAGS) clean; \ - done diff --git a/tex/src/figures/SConscript b/tex/src/figures/SConscript new file mode 100644 index 0000000..0eac076 --- /dev/null +++ b/tex/src/figures/SConscript @@ -0,0 +1,9 @@ +from site_cons.site_init import include_child_SConscripts + +# Get the passed in environment. +Import('env') + +env = include_child_SConscripts(env, SConscript) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/asy/SConscript b/tex/src/figures/asy/SConscript new file mode 100644 index 0000000..3318e5c --- /dev/null +++ b/tex/src/figures/asy/SConscript @@ -0,0 +1,8 @@ +# Get the passed in environment. +Import('env') + +asy = env.Alias('asytools', ['asyprocess', 'wtk_graph.asy']) +Depends(asy, Alias('latex-base')) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/biotin-streptavidin/Makefile b/tex/src/figures/biotin-streptavidin/Makefile deleted file mode 100644 index 005062a..0000000 --- a/tex/src/figures/biotin-streptavidin/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all : 1SWE.png - -clean : - rm -f 1SWE.png - -%.png : %.pml %.pdb - pymol -cq $< diff --git a/tex/src/figures/biotin-streptavidin/SConscript b/tex/src/figures/biotin-streptavidin/SConscript new file mode 100644 index 0000000..5b88d51 --- /dev/null +++ b/tex/src/figures/biotin-streptavidin/SConscript @@ -0,0 +1,11 @@ +# Get the passed in environment. +Import('env') + +swe = env.Command( + '1SWE.png', + ['1SWE.pml', '1SWE.pdb'], + 'pymol -cq 1SWE.pml', + chdir=True) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/calibration-concept-map/Makefile b/tex/src/figures/calibration-concept-map/Makefile deleted file mode 100644 index b9f8fec..0000000 --- a/tex/src/figures/calibration-concept-map/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all : concept_map.png - -clean : - rm -f concept_map.png - -concept_map.png : - dot -Tpng concept_map.dot > $@ diff --git a/tex/src/figures/calibration-concept-map/SConscript b/tex/src/figures/calibration-concept-map/SConscript new file mode 100644 index 0000000..a66b71b --- /dev/null +++ b/tex/src/figures/calibration-concept-map/SConscript @@ -0,0 +1,10 @@ +# Get the passed in environment. +Import('env') + +if 'DOT' in env: + env.Command('concept_map.png', 'concept_map.dot', + 'dot -Tpng $SOURCE > $TARGET', + chdir=True) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/cantilever-data/Makefile b/tex/src/figures/cantilever-data/Makefile deleted file mode 100644 index a10c733..0000000 --- a/tex/src/figures/cantilever-data/Makefile +++ /dev/null @@ -1,72 +0,0 @@ -ASYPROCESS = ../asy/asyprocess \ - --texinputs=../..: \ - --pretex='\documentclass{drexel-thesis} \input{packages}' \ - -- - -FIGS = v-dep loading-rate -V_DEP_DATA = v-dep.d/v_dep_131.98.dat \ - v-dep.d/v_dep_131.98.fit \ - v-dep.d/v_dep_24.33.dat \ - v-dep.d/v_dep_24.33.fit -LOADING_RATE_DATA = loading-rate.d/loading_rate_131.98.dat \ - loading-rate.d/loading_rate_24.33.dat -DATA = $(V_DEP_DATA) $(LOADING_RATE_DATA) -DATA_DIRS = data v-dep.d loading-rate.d - -# Never delete intermediates. (`info make` 10.4 Chains of Implicit Rules) -.SECONDARY : - - -all : $(FIGS:%=%_.tex) - -clean : - rm -f $(FIGS:%=%_*) $(FIGS:%=%-*) v-dep.asy v-dep.gp *.pyc - #rm -rf $(DATA_DIRS) - -%_.tex : %.asy $(DATA) - $(ASYPROCESS) $(patsubst %.asy, %, $<) - -$(DATA_DIRS) : - mkdir $@ - -data/raw : extract_f_v_k_data.sh | data - touch data/raw -# ./$< > $@ - -data/avg : avg_data.py data/raw - touch $@ # "avg" marks the time of last avg_data.py run - python $< - -data/spring-constants data/averaged-data : data/avg - @echo "$@ already build for target data/avg" - -v-dep.d/dat : get_v_dep.sh data/spring-constants data/averaged-data \ - | v-dep.d - touch $@ # "dat" marks the time of last *.dat file generation - ./$< - -v-dep.d/v_dep_%.dat : v-dep.d/dat - @echo "$@ already build for target v-dep.d/dat" - -v-dep.d/v_dep_%.fit : fit_data.py v-dep.d/v_dep_%.dat - python $^ > $@ - -v-dep.asy v-dep.gp : make_v_dep_plots.sh $(V_DEP_DATA) - ./$< - -v-dep.pdf : v-dep.gp $(V_DEP_DATA) - gnuplot $< - -v-dep.eps : v-dep.pdf - pdftoeps $< - -v-dep-rotated.pdf : v-dep.pdf - pdftk $< cat 1E output $@ - -loading-rate.d/dat : get_loading_rates.py avg_data.py data/raw \ - | loading-rate.d - touch $@ # "dat" marks the time of last *.dat file generation - python $< - -loading-rate.d/loading_rate_%.dat : loading-rate.d/dat - @echo "$@ already build for target loading-rate.d/dat" diff --git a/tex/src/figures/cantilever-data/SConscript b/tex/src/figures/cantilever-data/SConscript new file mode 100644 index 0000000..9331766 --- /dev/null +++ b/tex/src/figures/cantilever-data/SConscript @@ -0,0 +1,89 @@ +import os.path + +from site_cons.site_init import link_wtk_graph + + +FIGURES = ['v-dep', 'loading-rate'] +Ks = ['131.98', '24.33'] # HACK! these are not static + +# Get the passed in environment. +Import('env') + +data_dir = Dir('data') +raw = File(os.path.join(str(data_dir), 'raw')) +raw = [raw] +# = env.Command( +# os.path.join(str(data_dir), 'raw'), +# ['extract_f_v_k_data.sh'], +# './$SOURCE > $TARGET') +#env.Requires(raw, data_dir) + +averaged_data = env.Command( + os.path.join(str(data_dir), 'averaged-data'), + ['avg_data.py'] + raw, + 'cd .. && python avg_data.py', + chdir=True) +spring_constants = env.SideEffect( + os.path.join(str(data_dir), 'spring-constants'), + averaged_data) + +loading_rate_dir = Dir('loading-rate.d') +def loading_rate_file(k): + return os.path.join(str(loading_rate_dir), 'loading_rate_%s.dat' % k) + +loading_rates = env.Command( + loading_rate_file(Ks[0]), + ['get_loading_rates.py', 'avg_data.py', raw], + 'cd .. && python get_loading_rates.py', + chdir=True) +#env.Requires(loading_rates, loading_rate_dir) + +loading_rate_data = [loading_rates] +for k in Ks[1:]: + loading_rate_data.append( + env.SideEffect(loading_rate_file(k), loading_rates)) + +v_dep_dir = Dir('v-dep.d') +def v_dep_file(k): + return os.path.join(str(v_dep_dir), 'v_dep_%s.dat' % k) +def v_dep_fit_file(k): + return os.path.join(str(v_dep_dir), 'v_dep_%s.fit.dat' % k) + +v_deps = env.Command( + v_dep_file(Ks[0]), + ['get_v_dep.sh', spring_constants, averaged_data], + 'cd .. && ./get_v_dep.sh', + chdir=True) +#env.Requires(v_deps, v_dep_dir) + +v_dep_data = [v_deps] +for k in Ks[1:]: + v_dep_data.append( + env.SideEffect(v_dep_file(k), v_deps)) + +for k,data in zip(Ks, v_dep_data): + v_dep_data.append( + env.Command( + v_dep_fit_file(k), + ['fit_data.py'] + data, + 'python $SOURCES > $TARGET')) + +v_dep = env.Command( + 'v-dep.asy', + ['make_v_dep_plots.sh'] + v_dep_data, + './make_v_dep_plots.sh', + chdir=True) +env.SideEffect('v-dep.gp', v_dep) + + +wtk_graph = link_wtk_graph(env) + +for fig in FIGURES: + asyfile = '%s.asy' % fig # static .asy file + pyfig = fig.replace('-', '_') + if pyfig in globals(): # generated .asy file + asyfile = globals()[pyfig] + env.Asymptote([asyfile, wtk_graph]) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/cantilever-data/make_v_dep_plots.sh b/tex/src/figures/cantilever-data/make_v_dep_plots.sh index 60fa9f7..c217890 100755 --- a/tex/src/figures/cantilever-data/make_v_dep_plots.sh +++ b/tex/src/figures/cantilever-data/make_v_dep_plots.sh @@ -29,10 +29,10 @@ do esac ASYPLOTS=$(echo -e "$ASYPLOTS\ngraphFile(\"$FILE.dat\", xscale, yscale, $PEN, m8, markroutine=marksize(\"$FILE.dat\", $PEN, m8, 10), t=units(\"$K\",\"pN/nm\"), dots=true);") - ASYPLOTS=$(echo -e "$ASYPLOTS\ngraphFile(\"$FILE.fit\", xscale, yscale, $PEN, + ASYPLOTS=$(echo -e "$ASYPLOTS\ngraphFile(\"$FILE.fit.dat\", xscale, yscale, $PEN, t=units(\"$K\",\"pN/nm\"));") GPPLOTS="$GPPLOTS, '$FILE.dat' using 1:2:(sqrt(\$4)) with points pt 6 pointsize variable t '$K (pN/nm)'" - GPPLOTS="$GPPLOTS, '$FILE.fit' using 1:2 with lines notitle" + GPPLOTS="$GPPLOTS, '$FILE.fit.dat' using 1:2 with lines notitle" done < <(tac "$KFILE") GPPLOTS="${GPPLOTS:2}" # remove leading ' ,' diff --git a/tex/src/figures/cantilever-data/wtk_graph.asy b/tex/src/figures/cantilever-data/wtk_graph.asy deleted file mode 120000 index 6142fdb..0000000 --- a/tex/src/figures/cantilever-data/wtk_graph.asy +++ /dev/null @@ -1 +0,0 @@ -../asy/wtk_graph.asy \ No newline at end of file diff --git a/tex/src/figures/cantilever-sim/Makefile b/tex/src/figures/cantilever-sim/Makefile deleted file mode 100644 index 60d7187..0000000 --- a/tex/src/figures/cantilever-sim/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -ASYPROCESS = ../asy/asyprocess \ - --texinputs=../..: \ - --pretex='\documentclass{drexel-thesis} \input{packages}' \ - -- - -FIGS = loading-rate v-dep i-dep - -all : $(FIGS:%=%_.tex) - -clean : - rm -f $(FIGS:%=%_*) $(FIGS:%=%-*) - -%_.tex : %.asy - $(ASYPROCESS) $(patsubst %.asy, %, $<) diff --git a/tex/src/figures/cantilever-sim/SConscript b/tex/src/figures/cantilever-sim/SConscript new file mode 100644 index 0000000..ee40383 --- /dev/null +++ b/tex/src/figures/cantilever-sim/SConscript @@ -0,0 +1,14 @@ +from site_cons.site_init import link_wtk_graph + +FIGURES = ['v-dep', 'i-dep'] #'loading-rate', 'i-dep'] + +# Get the passed in environment. +Import('env') + +wtk_graph = link_wtk_graph(env) + +for fig in FIGURES: + env.Asymptote(['%s.asy' % fig, wtk_graph]) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/cantilever-sim/wtk_graph.asy b/tex/src/figures/cantilever-sim/wtk_graph.asy deleted file mode 120000 index 6142fdb..0000000 --- a/tex/src/figures/cantilever-sim/wtk_graph.asy +++ /dev/null @@ -1 +0,0 @@ -../asy/wtk_graph.asy \ No newline at end of file diff --git a/tex/src/figures/contour/Makefile b/tex/src/figures/contour/Makefile deleted file mode 100644 index 377c7fa..0000000 --- a/tex/src/figures/contour/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -ASYPROCESS = ../asy/asyprocess \ - --texinputs=../..: \ - --pretex='\documentclass{drexel-thesis} \input{packages}' \ - -- - -FIGS = contour - -all : $(FIGS:%=%_.tex) - -clean : - rm -f $(FIGS:%=%_*) $(FIGS:%=%-*) - -%_.tex : %.asy - $(ASYPROCESS) $(patsubst %.asy, %, $<) diff --git a/tex/src/figures/contour/SConscript b/tex/src/figures/contour/SConscript new file mode 100644 index 0000000..e096876 --- /dev/null +++ b/tex/src/figures/contour/SConscript @@ -0,0 +1,14 @@ +from site_cons.site_init import link_wtk_graph + +FIGURES = ['contour'] + +# Get the passed in environment. +Import('env') + +wtk_graph = link_wtk_graph(env) + +for fig in FIGURES: + env.Asymptote(['%s.asy' % fig, wtk_graph]) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/expt-sawtooth/Makefile b/tex/src/figures/expt-sawtooth/Makefile deleted file mode 100644 index fcfaa89..0000000 --- a/tex/src/figures/expt-sawtooth/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all : fig.pdf - -clean : - rm -f fig.pdf - -fig.pdf : - gnuplot plot.gp diff --git a/tex/src/figures/expt-sawtooth/SConscript b/tex/src/figures/expt-sawtooth/SConscript new file mode 100644 index 0000000..d8ff28f --- /dev/null +++ b/tex/src/figures/expt-sawtooth/SConscript @@ -0,0 +1,8 @@ +# Get the passed in environment. +Import('env') + +for gp in Glob('*.gp'): + env.Gnuplot(gp) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/expt-sawtooth/plot.gp b/tex/src/figures/expt-sawtooth/fig.gp similarity index 100% rename from tex/src/figures/expt-sawtooth/plot.gp rename to tex/src/figures/expt-sawtooth/fig.gp diff --git a/tex/src/figures/fit-space/Makefile b/tex/src/figures/fit-space/Makefile deleted file mode 100644 index fcfaa89..0000000 --- a/tex/src/figures/fit-space/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all : fig.pdf - -clean : - rm -f fig.pdf - -fig.pdf : - gnuplot plot.gp diff --git a/tex/src/figures/fit-space/SConscript b/tex/src/figures/fit-space/SConscript new file mode 100644 index 0000000..d8ff28f --- /dev/null +++ b/tex/src/figures/fit-space/SConscript @@ -0,0 +1,8 @@ +# Get the passed in environment. +Import('env') + +for gp in Glob('*.gp'): + env.Gnuplot(gp) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/fit-space/plot.gp b/tex/src/figures/fit-space/fig.gp similarity index 100% rename from tex/src/figures/fit-space/plot.gp rename to tex/src/figures/fit-space/fig.gp diff --git a/tex/src/figures/fit-space/king_vs_best.gp b/tex/src/figures/fit-space/king_vs_best.gp index b29574e..db144f9 100644 --- a/tex/src/figures/fit-space/king_vs_best.gp +++ b/tex/src/figures/fit-space/king_vs_best.gp @@ -1,5 +1,5 @@ -set terminal png -set output 'king_vs_best.png' +set terminal pdf enhanced font 'Times,7' size 9cm, 6cm +set output 'king_vs_best.pdf' g(x) = 39.727*exp(-40.7215e9*x) f(x) = 25.4465*exp(-44.6235e9*x) set logscale y diff --git a/tex/src/figures/fit-space/king_vs_best.png b/tex/src/figures/fit-space/king_vs_best.png deleted file mode 100644 index 51e4fb514ea0a821aaf1e13540d7a655db9b9af4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4972 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 YEveQ%`1Io)>eE32e1m&1 | grep -A10 '^Fitted Kwlcs:' > fit.params diff --git a/tex/src/figures/order-dep/SConscript b/tex/src/figures/order-dep/SConscript new file mode 100644 index 0000000..3e1e590 --- /dev/null +++ b/tex/src/figures/order-dep/SConscript @@ -0,0 +1,19 @@ +# Get the passed in environment. +Import('env') + +#order_data = Glob('data/order.avg-*') +#hist_data = Glob('data/hist*.hist') +#fig = env.Command('fig.pdf', +# ['fig.gp'] + order_data + hist_data, +# 'gnuplot fig.gp 2>&1 | grep -A10 "^Fitted Kwlcs:" > fit.params', +# chdir=True) +envb = env.Clone() +envb['GNUPLOTCOM'] = \ + ('cd ${TARGET.dir} && $GNUPLOT $GNPLOTLAGS ${SOURCE.file} 2>&1 |' + 'grep -A10 "^Fitted Kwlcs:" > fit.params') +fig = envb.Gnuplot('fig.gp') +env.SideEffect('fit.log', fig) +env.SideEffect('fit.params', fig) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/order-dep/plot.gp b/tex/src/figures/order-dep/fig.gp similarity index 100% rename from tex/src/figures/order-dep/plot.gp rename to tex/src/figures/order-dep/fig.gp diff --git a/tex/src/figures/schematic/Makefile b/tex/src/figures/schematic/Makefile deleted file mode 100644 index 93ba39d..0000000 --- a/tex/src/figures/schematic/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -ASYPROCESS = ../asy/asyprocess \ - --texinputs=../..: \ - --pretex='\documentclass{drexel-thesis} \input{packages}' \ - -- - -FIGS = unfolding afm landscape-cant monte-carlo - -all : $(FIGS:%=%_.tex) - -clean : - rm -f $(FIGS:%=%_*) $(FIGS:%=%-*) - -%_.tex : %.asy - $(ASYPROCESS) $(patsubst %.asy, %, $<) diff --git a/tex/src/figures/schematic/SConscript b/tex/src/figures/schematic/SConscript new file mode 100644 index 0000000..9ed8806 --- /dev/null +++ b/tex/src/figures/schematic/SConscript @@ -0,0 +1,17 @@ +from site_cons.site_init import link_wtk_graph + +FIGURES = ['unfolding', 'afm', 'landscape-cant', 'monte-carlo'] + +# Get the passed in environment. +Import('env') + +wtk_graph = link_wtk_graph(env) + +for fig in FIGURES: + deps = [wtk_graph] + if fig in ['afm']: + deps.append('base_afm.asy') + env.Asymptote(['%s.asy' % fig] + deps) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/schematic/wtk_graph.asy b/tex/src/figures/schematic/wtk_graph.asy deleted file mode 120000 index 6142fdb..0000000 --- a/tex/src/figures/schematic/wtk_graph.asy +++ /dev/null @@ -1 +0,0 @@ -../asy/wtk_graph.asy \ No newline at end of file diff --git a/tex/src/figures/sim-hist/Makefile b/tex/src/figures/sim-hist/Makefile deleted file mode 100644 index fcfaa89..0000000 --- a/tex/src/figures/sim-hist/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all : fig.pdf - -clean : - rm -f fig.pdf - -fig.pdf : - gnuplot plot.gp diff --git a/tex/src/figures/sim-hist/SConscript b/tex/src/figures/sim-hist/SConscript new file mode 100644 index 0000000..d8ff28f --- /dev/null +++ b/tex/src/figures/sim-hist/SConscript @@ -0,0 +1,8 @@ +# Get the passed in environment. +Import('env') + +for gp in Glob('*.gp'): + env.Gnuplot(gp) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/sim-hist/plot.gp b/tex/src/figures/sim-hist/fig.gp similarity index 100% rename from tex/src/figures/sim-hist/plot.gp rename to tex/src/figures/sim-hist/fig.gp diff --git a/tex/src/figures/sim-sawtooth/Makefile b/tex/src/figures/sim-sawtooth/Makefile deleted file mode 100644 index fcfaa89..0000000 --- a/tex/src/figures/sim-sawtooth/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -all : fig.pdf - -clean : - rm -f fig.pdf - -fig.pdf : - gnuplot plot.gp diff --git a/tex/src/figures/sim-sawtooth/SConscript b/tex/src/figures/sim-sawtooth/SConscript new file mode 100644 index 0000000..8ecd2a1 --- /dev/null +++ b/tex/src/figures/sim-sawtooth/SConscript @@ -0,0 +1,9 @@ +# Get the passed in environment. +Import('env') + +for gp in Glob('*.gp'): + env.Gnuplot(gp) + +# Pass back the modified environment. +Return('env') + diff --git a/tex/src/figures/sim-sawtooth/plot.gp b/tex/src/figures/sim-sawtooth/fig.gp similarity index 100% rename from tex/src/figures/sim-sawtooth/plot.gp rename to tex/src/figures/sim-sawtooth/fig.gp diff --git a/tex/src/figures/v-dep/Makefile b/tex/src/figures/v-dep/Makefile deleted file mode 100644 index 51c81bd..0000000 --- a/tex/src/figures/v-dep/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -all : fig.pdf fig-sd.pdf - -clean : - rm -f fig.pdf fig-sd.pdf - -fig.pdf : - gnuplot plot.gp - -fig-sd.pdf : - gnuplot plot-sd.gp diff --git a/tex/src/figures/v-dep/SConscript b/tex/src/figures/v-dep/SConscript new file mode 100644 index 0000000..d8ff28f --- /dev/null +++ b/tex/src/figures/v-dep/SConscript @@ -0,0 +1,8 @@ +# Get the passed in environment. +Import('env') + +for gp in Glob('*.gp'): + env.Gnuplot(gp) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/figures/v-dep/plot-sd.gp b/tex/src/figures/v-dep/fig-sd.gp similarity index 100% rename from tex/src/figures/v-dep/plot-sd.gp rename to tex/src/figures/v-dep/fig-sd.gp diff --git a/tex/src/figures/v-dep/plot.gp b/tex/src/figures/v-dep/fig.gp similarity index 100% rename from tex/src/figures/v-dep/plot.gp rename to tex/src/figures/v-dep/fig.gp diff --git a/tex/src/future/Makefile b/tex/src/future/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/future/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/introduction/Makefile b/tex/src/introduction/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/introduction/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/packages/Makefile b/tex/src/packages/Makefile deleted file mode 100644 index 53ad8af..0000000 --- a/tex/src/packages/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -PACKAGES = $(shell ls *.sty) $(shell ls *.ist) $(shell ls *.cfg) \ - $(shell ls *.pdf) $(shell ls *.eps) -TARGETS = $(PACKAGES:%=../%) - -all : $(TARGETS) - -../% : % - (cd ../ ; ln -s packages/$<) - -clean : - rm -f $(TARGETS) diff --git a/tex/src/packages/SConscript b/tex/src/packages/SConscript new file mode 100644 index 0000000..87ab164 --- /dev/null +++ b/tex/src/packages/SConscript @@ -0,0 +1,16 @@ +import os.path + +# Get the passed in environment. +Import('env') + +# Copy all non-SConscript files into the parent directory. +packages = [] +for path in Glob('*'): + if str(path) is not 'SConscript': + packages.append(env.Command( + os.path.join('..', str(path)), path, + Copy('$TARGET', '$SOURCE'))) +env.Alias('extra-packages', packages) + +# Pass back the modified environment. +Return('env') diff --git a/tex/src/sawsim/Makefile b/tex/src/sawsim/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/sawsim/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/temperature-theory/Makefile b/tex/src/temperature-theory/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/temperature-theory/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/temperature/Makefile b/tex/src/temperature/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/temperature/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/tension/Makefile b/tex/src/tension/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/tension/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/unfolding-distributions/Makefile b/tex/src/unfolding-distributions/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/unfolding-distributions/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/unfolding/Makefile b/tex/src/unfolding/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/unfolding/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : diff --git a/tex/src/viscocity/Makefile b/tex/src/viscocity/Makefile deleted file mode 100644 index a1f4f4c..0000000 --- a/tex/src/viscocity/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -all : - -clean : -- 2.26.2