summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@lilypond.org>2014-05-15 11:17:09 +0200
committerhanwen <hanwen@lilypond.org>2014-06-11 10:08:40 +0200
commitf6dc5e44d6bac45c3997461208eec4e246748d9d (patch)
treee2b938ea48c32960c859c85268c4142983f52335 /scripts
parent0f9658c1391e09387e050231279d86c9f25ae485 (diff)
Generate a .pe script for one design size at a time.
In make a b: c command is shorthand for a: c command b: c command this means that in parallel builds the same command may be invoked twice. Fix this by associating each command with only one target, and adding dummy dependencies. Also, generate the .pe for only one design size at a time. Relative to botched commit 366316fd6be846c2050be6b1b3955b261026187e, this: * does not write .dep files from gen-emmentaler-scripts (the makefile already writes them) * declares explicit dependencies on out/*.lisp for the out/%.otf-table rule.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/gen-emmentaler-scripts.py56
1 files changed, 24 insertions, 32 deletions
diff --git a/scripts/build/gen-emmentaler-scripts.py b/scripts/build/gen-emmentaler-scripts.py
index 9f645b5929..0bd4168230 100644
--- a/scripts/build/gen-emmentaler-scripts.py
+++ b/scripts/build/gen-emmentaler-scripts.py
@@ -6,25 +6,26 @@ import os
(options, files) = \
getopt.getopt (sys.argv[1:],
- '',
- ['dir='])
-
+ '',
+ ['dir=', 'design-size='])
+design_size = 0
outdir = ''
for opt in options:
o = opt[0]
a = opt[1]
if o == '--dir':
outdir = a
+ elif o == '--design-size':
+ design_size = int(a)
else:
print o
raise getopt.error
-# Ugh
-for design_size in [11,13,14,16,18,20,23,26]:
- name = 'Emmentaler'
- filename = name.lower ()
- script = '''#!@FONTFORGE@
+
+name = 'Emmentaler'
+filename = name.lower ()
+script = '''#!@FONTFORGE@
New();
@@ -80,32 +81,23 @@ Generate("%(filename)s-%(design_size)d.svg");
Generate("%(filename)s-%(design_size)d.woff");
''' % vars()
- basename = '%s-%d' % (filename, design_size)
- path = os.path.join (outdir, basename + '.pe')
- open (path, 'w').write (script)
-
- subfonts = ['feta%(design_size)d',
- 'feta-noteheads%(design_size)d',
- 'feta-flags%(design_size)d',
- 'parmesan%(design_size)d',
- 'parmesan-noteheads%(design_size)d',
- 'feta-alphabet%(design_size)d']
+basename = '%s-%d' % (filename, design_size)
+path = os.path.join (outdir, basename + '.genpe')
+open (path, 'w').write (script)
- ns = []
- for s in subfonts:
- ns.append ('%s' % (s % vars()))
+subfonts = ['feta%(design_size)d',
+ 'feta-noteheads%(design_size)d',
+ 'feta-flags%(design_size)d',
+ 'parmesan%(design_size)d',
+ 'parmesan-noteheads%(design_size)d',
+ 'feta-alphabet%(design_size)d']
- subfonts_str = ' '.join (ns)
+ns = []
+for s in subfonts:
+ ns.append ('%s' % (s % vars()))
- open (os.path.join (outdir, '%(filename)s-%(design_size)d.subfonts' % vars()), 'w').write (subfonts_str)
+subfonts_str = ' '.join (ns)
- path = os.path.join (outdir, '%s-%d.dep' % (filename, design_size))
-
- deps = r'''%(filename)s-%(design_size)d.otf: $(outdir)/feta%(design_size)d.pfb \
- $(outdir)/parmesan%(design_size)d.pfb \
- $(outdir)/feta-alphabet%(design_size)d.pfb feta%(design_size)d.otf-table \
- feta%(design_size)d.otf-gtable
-''' % vars()
- open (path, 'w').write (deps)
+open (os.path.join (outdir, '%(filename)s-%(design_size)d.subfonts' % vars()), 'w').write (subfonts_str)
- open (os.path.join (outdir, basename + '.fontname'), 'w').write ("%s-%d" % (name, design_size))
+open (os.path.join (outdir, basename + '.fontname'), 'w').write ("%s-%d" % (name, design_size))