1SGMLFILES=$(shell echo *.sgml)
2HTMLFILES=$(subst .sgml,.html,$(SGMLFILES)) index.html
3MANFILES=$(subst .sgml,.8,$(SGMLFILES))
4
5all: html
6
7html: $(HTMLFILES) iputils.html
8
9man: $(MANFILES)
10
11# docbook scripts are incredibly dirty in the sense that they leak
12# lots of some strange temporary junk directories and files.
13# So, scope it to a temporary dir and clean all after each run.
14
15$(HTMLFILES): index.db
16	@-rm -rf tmp.db2html
17	@mkdir tmp.db2html
18	@set -e; cd tmp.db2html; docbook2html ../$< ; mv *.html ..
19	@-rm -rf tmp.db2html
20
21iputils.html: iputils.db
22	@-rm -rf tmp.db2html
23	@mkdir tmp.db2html
24	@set -e; cd tmp.db2html; docbook2html -u -o html ../$< ; mv html/$@ ..
25	@-rm -rf tmp.db2html
26
27# docbook2man produces utterly ugly output and I did not find
28# any way to customize this but hacking backend perl script a little.
29# Well, hence...
30
31$(MANFILES): index.db
32	@-mkdir tmp.db2man
33	@set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ;	mv $@ ..
34	@-rm -rf tmp.db2man
35
36clean:
37	@rm -rf $(MANFILES) $(HTMLFILES) iputils.html tmp.db2html tmp.db2man index.out
38
39snapshot:
40	@date "+%y%m%d" > snapshot.db
41
42
43$(MANFILES): $(SGMLFILES)
44
45$(HTMLFILES): $(SGMLFILES)
46