-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathMakefile
71 lines (60 loc) · 1.88 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Default is show help; e.g.
#
# make
#
# prints the help text.
SHELL := bash
MAKEFLAGS += --warn-undefined-variables
.SILENT:
Top=$(shell git rev-parse --show-toplevel)
Data ?= $(Top)/../data/optimize
Tmp ?= $(HOME)/tmp
Act ?= mqs
help : ## show help
gawk -f $(Top)/etc/help.awk $(MAKEFILE_LIST)
pull : ## download
git pull
push : ## save
read -ep "\033[33mWhy this push? \033[0m" x; git commit -am "$$x"; git push; git status
$(Top)/docs/%.pdf: %.py ## make doco: .py ==> .pdf
mkdir -p ~/tmp
echo "pdf-ing $@ ... "
a2ps \
-Br \
--chars-per-line=90 \
--file-align=fill \
--line-numbers=1 \
--pro=color \
--left-title="" \
--borders=no \
--left-footer="$< " \
--right-footer="page %s. of %s#" \
--columns 3 \
-M letter \
-o [email protected] $<
ps2pdf [email protected] $@; rm [email protected]
open $@
docs/%.html : docs/%.md etc/b4.html docs/ezr.css Makefile ## make doco: md -> html
echo "$< ... "
pandoc -s -f markdown --number-sections --toc --toc-depth=5 \
-B etc/b4.html --mathjax \
--css ezr.css --highlight-style tango \
-o $@ $<
docs/%.html : %.py etc/py2html.awk etc/b4.html docs/ezr.css Makefile ## make doco: md -> html
echo "$< ... "
gawk -f etc/py2html.awk $< \
| pandoc -s -f markdown --number-sections --toc --toc-depth=5 \
-B etc/b4.html --mathjax \
--css ezr.css --highlight-style tango \
--metadata title="$<" \
-o $@
# another commaned
acts: ## experiment: mqs
$(MAKE) Data=$(Data) Tmp=~/tmp/ Act=mqs act
act: ## experiment: mqs
$(foreach d, config hpo misc process, \
$(foreach f, $(wildcard $(Data)/$d/*.csv), \
mkdir -p $(Out)/$(Act)/$d; \
./ezr.py -t $f -e $(Act) | tee $(Out)/$(Act)/$d/$f ; ))
fred:
echo $x