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