New build path variable
[freeradius.git] / doc / Makefile
1 #
2 # Makefile
3 #
4 # Version:      $Id$
5 #
6
7 include ../Make.inc
8
9 SUBDIRS         = examples rfc
10 WHAT_TO_MAKE    = all
11
12 RST_FILES := $(wildcard *.rst)
13
14 all:
15         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
16
17 clean:
18         @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
19         @rm -f *~
20
21 install:
22         @if [ "$(docdir)" = no ]; then                                  \
23                 echo 'Documentation files will NOT be installed.';      \
24         else                                                            \
25                 $(INSTALL) -d -m 755 $(R)$(docdir);                     \
26                 for file in *[!~]; do                                   \
27                         if [ -f $$file -a $$file != Makefile ]; then    \
28                                 $(INSTALL) -m 644 $$file $(R)$(docdir); \
29                         fi;                                             \
30                 done;                                                   \
31                 $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common;               \
32         fi
33
34 common: $(SUBDIRS)
35
36 $(SUBDIRS):
37         @echo "Making $(WHAT_TO_MAKE) in $@..."
38         @$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE)
39
40 .PHONY: all clean install common $(SUBDIRS)
41
42 %.html: %.rst
43         @rst2html.py $^ > $@
44
45 .PHONY: html
46 html: $(RST_FILES:.rst=.html)
47