summary refs log tree commit diff
path: root/doc/Makefile
blob: 6fc15e4943edf35911abaa6b6f95dab446bd1cce (plain) (blame)
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
.PHONY: all clean sync

DOCS = abi il llvm

all: $(DOCS:%=html/%.html) html/txt.css

html/txt.css: txt/txt.css
	cp -f $< $@

clean:
	rm -fr html

html/%.html: %.txt
	mkdir html 2> /dev/null || true
	( echo '<!doctype html>'; \
	  echo '<meta name=viewport content="width=device-width, initial-scale=1">'; \
	  echo '<link rel="stylesheet" href="/css/simple.css" type="text/css" />'; \
	  echo '<link rel="stylesheet" href="txt.css" type="text/css" />'; \
	  sed -ne '2{s,.*,<title>&</title>,;p;q}' $<; \
	  echo '<div class="container">'; \
	  sed -ne '2{s,.*,<h2>&</h2>,;p;q}' $<; \
	  sed -e '1,3d' $< | ocaml txt/txt.ml; \
	  echo '</div>'; \
	) > $@

sync:
	scp html/* h:/srv/data/w/compile/doc/