Fix typo in error message
[freeradius.git] / doc / Makefile
index 7edb262..aaf7675 100644 (file)
@@ -6,29 +6,42 @@
 
 include ../Make.inc
 
-SUBDIRS                = rfc
+SUBDIRS                = examples rfc
 WHAT_TO_MAKE   = all
 
-DOCS = aaa.txt ascend Autz-Type bay bugs cisco coding-methods.txt configurable_failover DIFFS duplicate-users MACOSX module_interface OS2 performance-testing processing_users_file proxy RADIUS-LDAP.schema RADIUS-LDAPv3.schema RADIUS-SQL.schema radrelay README Simultaneous-Use supervise-radiusd.txt tuning_guide variables.txt
-
+RST_FILES := $(wildcard *.rst)
 
 all:
        @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
 
 clean:
        @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-       @rm -f include/*~ *~
+       @rm -f *~
 
 install:
-       $(INSTALL) -d -m 755    $(R)$(datadir)/doc
-       $(INSTALL) -d -m 755    $(R)$(datadir)/doc/freeradius-$(RADIUSD_VERSION)
-       for i in $(DOCS) rlm_*; do \
-               $(INSTALL) -m 644 $$i $(R)$(datadir)/doc/freeradius-$(RADIUSD_VERSION); \
-       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 1;\
-       done