Properly track relative / absolute filenames
[freeradius.git] / doc / all.mk
1 ifneq "$(docdir)" "no"
2 install: install.doc
3
4 clean: clean.doc
5
6 DOCFILES        := $(filter-out %~ %/Makefile doc/00-OLD doc/examples doc/rfc doc/source,$(wildcard doc/* doc/rfc/*.txt doc/examples/*))
7 DOCINSTALL      := $(patsubst doc/%,$(R)$(docdir)/%,$(DOCFILES))
8
9 DOCDIRS         := $(R)/$(docdir)/ $(R)/$(docdir)/rfc/ $(R)/$(docdir)/examples/
10
11
12 #  Create the directories
13 $(DOCDIRS):
14         @echo INSTALL $@
15         @$(INSTALL) -d -m 755 $@
16
17 #  Files depend on directories (order only).
18 #  We don't care if the directories change.
19 $(DOCINSTALL): | $(DOCDIRS)
20
21 #  Wildcard installation rule
22 $(R)$(docdir)/%: doc/%
23         @echo INSTALL $<
24         @$(INSTALL) -m 644 $< $@
25
26 install.doc: $(DOCINSTALL)
27
28 .PHONY: clean.doc
29 clean.doc:
30         @rm -f *~ rfc/*~ examples/*~
31
32 #
33 #  Deal with these later
34 #
35 DOCRST := $(wildcard *.rst)
36 %.html: %.rst
37         @rst2html.py $^ > $@
38
39 .PHONY: html
40 html: $(DOCRST:.rst=.html)
41
42 endif