-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
42 lines (37 loc) · 1.28 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
MAKEFLAGS += --silent
SHELL:= /bin/bash#
R=$(shell git rev-parse --show-toplevel)
help : Makefile
echo ""; printf "usage: make [OPTIONS]\n\n"
@awk 'BEGIN {FS="[ \t]*:.*##[ \t]*"} \
NF==2 { printf \
" \033[36m%-25s\033[0m %s\n","make " $$1,$$2}' $< \
| grep -v awk
docs/index.html: docs/shortr.html ## commit to main
cp docs/shortr.html docs/index.html
ready: ## commit to main
git add *;git commit -am save;git push;git status
docs/%.html: %.lua ## make html
(awk '\
BEGIN { FS="(-|[ \t]*)?->[ \t]*"}\
NF==3 && /^-->/ { $$2=gensub(/([A-Za-z0-9_]+):/," `\\1`: ","g",$$2);\
print "--**"$$2"** <br> "$$3 ; next}\
1' $^ ) > tmp.lua
echo "docco: $< -> $@"
docco -l classic tmp.lua > /dev/null
awk 'sub(/>tmp.lua</,">$<<") 1 ' docs/tmp.html > $@
rm tmp.lua
cp $R/etc/docco.css docs/docco.css
docs/%.pdf : %.lua ## make pdf
@mkdir -p docs
@echo "pdf-ing $@ ... "
@a2ps -Bjr -q \
-L 125 \
--line-numbers=1 \
--highlight-level=normal \
--borders=no --pro=color --columns 3 \
--right-footer="" --left-footer="" \
--pretty-print=$R/etc/lua.ssh \
--footer="page %p." \
-M letter -o [email protected] $<
@ps2pdf [email protected] $@; rm [email protected]; git add $@