chiark / gitweb /
realtime: print all movpos positions on entering Run
[trains.git] / layout / make-dgram-make
1 #!/bin/sh
2 set -e
3 stem=$1
4 echo '# autogenerated'
5 while read dgram args; do
6         sed -e "
7                 s/BASE/STEM.dgram-DGRAM/g;
8                 s/STEM/$stem/g;
9                 s/DGRAM/$dgram/g;
10                 s/ARGS/$args/g;
11         " <<'END'
12
13 BASE.run-layout:        STEM.d4 layout STEM.dgram.m
14         printf '#!/bin/sh -ex\n$(LAYOUT) "$$@" %s $<\n' "ARGS" >$@.new
15         chmod +x $@.new && mv -f $@.new $@
16
17 BASE.matrix-info:       BASE.p0.segenco.ps matrix-demonstrate.ps
18                 sed -n '1,/^%L matrix here/p' matrix-demonstrate.ps >$@.ps.new
19                 sed -n '/^%L matrix begin/,/^%L matrix end/p' $< >>$@.ps.new
20                 sed -e '1,/^%L matrix here/d' matrix-demonstrate.ps >>$@.ps.new
21                 gs -sDEVICE=nullpage -dBATCH=1 -q $@.ps.new $o
22
23 BASE.testui.ppm:        BASE.pa.segenco.ppm
24                 pnmcrop -verbose 2>&1 <$< >$@.1.new | tee BASE.crop-info
25                 pnmflip <$@.1.new -ccw >$@.2.new
26                 pnmpad <$@.2.new -white -l5 -r5 -t5 -b5 $o
27
28 BASE.overlay-info:      genoverlayinfo \
29         BASE.plandata.c STEM.redacted.for-ui BASE.matrix-info
30                 ./$^ $(PLANUI_HEIGHT) $(PLANUI_PSDPI) $o
31
32 END
33
34 done