[8e819a9] | 1 | SHELL := /bin/bash |
---|
| 2 | |
---|
| 3 | # The targets made here are individual code-level demos. |
---|
| 4 | # Some produce LaTeX fragments. All are being checked for the code being valid. |
---|
| 5 | # None are being built from *.tex toward *.pdf. Use the top-level makefile for that. |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | BuildBase = ../../build |
---|
| 9 | Build = ${BuildBase}/string |
---|
| 10 | |
---|
| 11 | # (plg2 has gem) |
---|
| 12 | # gem install --user-install liquid |
---|
| 13 | # gem install --user-install liquid-cli |
---|
| 14 | Liquid = ~/.gem/ruby/2.7.0/bin/liquid |
---|
| 15 | |
---|
| 16 | CFA = ../../../../../../build/driver/cfa |
---|
| 17 | |
---|
| 18 | DEMOS = ${addsuffix -demo, \ |
---|
| 19 | sharing \ |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | EZDEMOS = ${addsuffix -ezdemo, \ |
---|
| 23 | sharectx \ |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | all: $(DEMOS) $(EZDEMOS) |
---|
| 28 | |
---|
| 29 | # removing the echo rule body means the rule doesn't fire |
---|
| 30 | %-demo: $(Build)/%-demo.tex %-demo-runok | $(Build) |
---|
| 31 | @echo target $@ made |
---|
| 32 | |
---|
| 33 | %-ezdemo: %-ezdemo-runok | $(Build) |
---|
| 34 | @echo target $@ made |
---|
| 35 | |
---|
| 36 | %-demo-runok: $(Build)/%-demo | $(Build) |
---|
| 37 | $< |
---|
| 38 | |
---|
| 39 | %-ezdemo-runok: $(Build)/%-ezdemo | $(Build) |
---|
| 40 | $< |
---|
| 41 | |
---|
| 42 | $(Build)/%-demo.tex: %-demo.json %-demo.tex.liquid | $(Build) |
---|
| 43 | $(Liquid) "$$(< $<)" < $(word 2,$^) > $@ |
---|
| 44 | # echo will run $(Liquid) |
---|
| 45 | # echo will get JSON from $< |
---|
| 46 | # echo will get template from $(word 2,$^) |
---|
| 47 | |
---|
| 48 | $(Build)/%-demo: $(Build)/%-demo.cfa |
---|
| 49 | $(CFA) $< -o $@ |
---|
| 50 | |
---|
| 51 | $(Build)/%-demo.cfa: %-demo.json %-demo.cfa.liquid | $(Build) |
---|
| 52 | $(Liquid) "$$(< $<)" < $(word 2,$^) > $@ |
---|
| 53 | |
---|
| 54 | $(Build)/%-ezdemo: %-demo.cfa |
---|
| 55 | $(CFA) $< -o $@ |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | |
---|
| 60 | ${Build}: |
---|
| 61 | mkdir -p $@ |
---|
| 62 | |
---|
| 63 | .PHONY : all %-demo %-demo %-runok |
---|
| 64 | .PRECIOUS : $(Build)/%-demo.tex $(Build)/%-demo.cfa $(Build)/%-demo |
---|