bscpkgs/garlic/doc/Makefile

43 lines
1.2 KiB
Makefile
Raw Normal View History

2021-02-04 18:01:45 +01:00
all: ug.pdf ug.html
2020-11-04 12:56:35 +01:00
TTYOPT=-rPO=4m -rLL=72m
PDFOPT=-dpaper=a4 -rPO=4c -rLL=13c
2021-01-26 12:57:09 +01:00
#MMOPT=-dpaper=a4 -rpo=5c -rll=13c
PREPROC=-k -t -p -R
2021-01-26 12:57:09 +01:00
POSTPROC=
REGISTERS=-dcurdate="`date '+%Y-%m-%d'`"
REGISTERS+=-dgitcommit="`git rev-parse HEAD`"
PREPROC+=$(REGISTERS)
2021-02-04 18:01:45 +01:00
HTML_OPT=$(PREPROC) -P-Dimg -P-i120 -Thtml
2021-01-26 12:57:09 +01:00
# Embed fonts?
#POSTPROC+=-P -e
2020-10-07 18:34:08 +02:00
2021-02-01 11:09:53 +01:00
blackbox.pdf: blackbox.ms Makefile
REFER=ref.i groff -ms $(PREPROC) -dpaper=a4 -rPO=2c -rLL=17c -Tpdf $< > $@
2021-01-25 20:02:25 +01:00
2021-02-08 18:53:10 +01:00
%.html: %.ms Makefile
mkdir -p img
REFER=ref.i groff -ms -mwww $(HTML_OPT) $< > $@
echo $(HTML_OPT)
2021-02-08 18:53:10 +01:00
sed -i '/<\/head>/i<link rel="stylesheet" href="s.css">' $@
sed -i 's/^<a name="\([^"]*\)"><\/a>/<a name="\1" href="#\1">\&sect;<\/a>/g' $@
#sed -i '/<h1 /,/<hr>/s/^<a href="#[0-9]\+\.[0-9]\+\.[0-9]\+.*//' $@
sed -i '/<h1 /,/<hr>/s/^<a href="#[0-9]\+\.[0-9]\+.*//' $@
%.pdf: %.ms Makefile
REFER=ref.i groff -ms -mwww $(PREPROC) $(PDFOPT) -Tpdf $< > $@
2020-10-30 12:22:19 +01:00
-killall -HUP mupdf
2020-10-07 18:34:08 +02:00
2020-11-04 12:56:35 +01:00
%.utf8: %.ms
REFER=ref.i groff -ms -mwww $(PREPROC) $(TTYOPT) -Tutf8 $^ > $@
2020-11-04 12:56:35 +01:00
%.ascii: %.ms
REFER=ref.i groff -ms -mwww -c $(PREPROC) $(TTYOPT) -Tascii $^ > $@
doc.tar.gz: ug.pdf ug.html s.css
tar czf $@ $^ img s.css
clean:
rm -rf img ug.pdf ug.html doc.tar.gz