| 1 |
SUFFICES := .pdf -wordpress.html |
| 2 |
CHAPTERS := 00_the_name_of_the_game 01_the_route_and_its_attributes 02_asynchronous_export 03_coroutines 03b_performance |
| 3 |
|
| 4 |
all: $(foreach ch,$(CHAPTERS),$(addprefix $(ch),$(SUFFICES))) |
| 5 |
|
| 6 |
00_the_name_of_the_game.pdf: 00_filter_structure.png |
| 7 |
|
| 8 |
%.pdf: %.md |
| 9 |
pandoc -f markdown -t latex -o $@ $< |
| 10 |
|
| 11 |
%.html: %.md |
| 12 |
pandoc -f markdown -t html5 -o $@ $< |
| 13 |
|
| 14 |
%-wordpress.html: %.html Makefile |
| 15 |
sed -r 's#</p>#\n#g; s#<p>##g; s#<(/?)code>#<\1tt>#g; s#<pre><tt>#<code>#g; s#</tt></pre>#</code>#g; s#</?figure>##g; s#<figcaption>#<p style="text-align: center">#; s#</figcaption>#</p>#; ' $< > $@ |
| 16 |
|
| 17 |
stats-%.csv: stats.csv stats-filter.pl |
| 18 |
perl stats-filter.pl $< $* > $@ |
| 19 |
|
| 20 |
STATS_VARIANTS := multi imex mulimex single |
| 21 |
stats-all: $(patsubst %,stats-%.csv,$(STATS_VARIANTS)) |
| 22 |
|
| 23 |
stats-2d-%.pdf: stats.csv stats-filter-2d.pl |
| 24 |
perl stats-filter-2d.pl $< $* $@ |
| 25 |
|
| 26 |
stats-2d-%.png: stats-2d-%.pdf |
| 27 |
gs -dBATCH -dNOPAUSE -sDEVICE=pngalpha -sOutputFile=$@ -r300 $< |
| 28 |
|
| 29 |
stats-all-2d: $(foreach suf,pdf png,$(patsubst %,stats-2d-%.$(suf),$(STATS_VARIANTS))) |