summaryrefslogtreecommitdiff
path: root/Makefile
blob: 1afe7c191dd814798364a423de1472cfe8724426 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
include config.mk

.PHONY: all pages clean

all: $(PAGES:=.html) index.html

pages: $(PAGES:=.html)

.SUFFIXES: .7 .html

.7.html:
	mandoc -K utf-8 -O man=./%N.html,style=/style.css -T html $< > $@

clean:
	rm -f $(PAGES:=.html) index.html

index.html: $(PAGES:=.7)
	cat index.html.head > index.html
	for i in $(PAGES:=.7); do printf '<tr><td><a href="%s.html">%s</a></td><td>%s</td></tr>\n' "$${i%%.7}" "$${i%%.7}" "$$(grep -m 1 '^\.Nd ' "$${i}" | cut -d' ' '-f2-')" >> index.html; done
	cat index.html.tail >> index.html