1
DOCDIR=/usr/doc/iputils
2
HTMLFILES=$(subst .sgml,.html,$(shell echo *.sgml))
3
MANFILES=$(subst .sgml,.8,$(shell echo *.sgml))
7
html: $(HTMLFILES) iputils.html index.html
11
# This Makefile is wrong. I still did not find a way to organize
12
# dependencies right. We have several sources, several output
13
# files and all the output is produced by a single run of docbook.
14
# It does not look a rocket science, but I honestly still did not
15
# guess right combination.
17
# docbook scripts are incredibly dirty in the sense that they leak
18
# lots of some strange temporary junk directories and files.
19
# So, scope it to a temporary dir and clean all after each run.
21
$(HTMLFILES) index.html: index.db
24
@set -e; cd tmp.db2html; docbook2html ../$< ; mv *.html ..
27
iputils.html: iputils.db
30
@set -e; cd tmp.db2html; docbook2html -u -o html ../$< ; mv html/$@ ..
33
# docbook2man produces utterly ugly output and I didi not find
34
# any way to customize this but hacking backend perl script a little.
39
@set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ; mv $@ ..
43
rm -rf $(MANFILES) $(HTMLFILES) index.html iputils.html tmp.db2html tmp.db2man
46
@date "+%y%m%d" > snapshot.db
49
mkdir -p $(DESTDIR)$(DOCDIR)
50
install -m 0644 $(HTMLFILES) iputils.html index.html $(DESTDIR)$(DOCDIR)