Updating dictionary.erx based on Juniper documentation
[freeradius.git] / doc / Makefile
index e07266f..aaf7675 100644 (file)
@@ -6,9 +6,11 @@
 
 include ../Make.inc
 
-SUBDIRS                = rfc
+SUBDIRS                = examples rfc
 WHAT_TO_MAKE   = all
 
+RST_FILES := $(wildcard *.rst)
+
 all:
        @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
 
@@ -17,17 +19,29 @@ clean:
        @rm -f *~
 
 install:
-       $(INSTALL) -d -m 755 $(R)$(datadir)/doc
-       $(INSTALL) -d -m 755 $(R)$(datadir)/doc/freeradius-$(RADIUSD_VERSION)
-       for file in *[!~]; do \
-               if [ -f $$file -a $$file != Makefile ]; then \
-                       $(INSTALL) -m 644 $$file $(R)$(datadir)/doc/freeradius-$(RADIUSD_VERSION); \
-               fi; \
-       done
-       @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
+       @if [ "$(docdir)" = no ]; then                                  \
+               echo 'Documentation files will NOT be installed.';      \
+       else                                                            \
+               $(INSTALL) -d -m 755 $(R)$(docdir);                     \
+               for file in *[!~]; do                                   \
+                       if [ -f $$file -a $$file != Makefile ]; then    \
+                               $(INSTALL) -m 644 $$file $(R)$(docdir); \
+                       fi;                                             \
+               done;                                                   \
+               $(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common;               \
+       fi
+
+common: $(SUBDIRS)
+
+$(SUBDIRS):
+       @echo "Making $(WHAT_TO_MAKE) in $@..."
+       @$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE)
+
+.PHONY: all clean install common $(SUBDIRS)
+
+%.html: %.rst
+       @rst2html.py $^ > $@
+
+.PHONY: html
+html: $(RST_FILES:.rst=.html)
 
-common:
-       @for dir in $(SUBDIRS); do \
-               echo "Making $(WHAT_TO_MAKE) in $$dir..."; \
-               (cd $$dir && $(MAKE) $(MFLAGS) $(WHAT_TO_MAKE)) || exit $?;\
-       done