]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use boilermake for documentation.
authorAlan T. DeKok <aland@freeradius.org>
Mon, 25 Feb 2013 16:14:48 +0000 (11:14 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 25 Feb 2013 16:30:09 +0000 (11:30 -0500)
Makefile
doc/Makefile [deleted file]
doc/all.mk [new file with mode: 0644]
doc/examples/Makefile [deleted file]
doc/rfc/Makefile
main.mk

index 9689e75abf12cf8f6f919bbcbfaf5fec5d16e55e..243300262f9b494213bbc37276775671de275300 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ export DESTDIR := $(R)
 include scripts/boiler.mk
 
 # These are not yet converted to the new system
-SUBDIRS                = $(wildcard raddb doc)
+SUBDIRS                = $(wildcard raddb)
 
 .PHONY: tests
 tests:
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644 (file)
index aaf7675..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#
-# Makefile
-#
-# Version:     $Id$
-#
-
-include ../Make.inc
-
-SUBDIRS                = examples rfc
-WHAT_TO_MAKE   = all
-
-RST_FILES := $(wildcard *.rst)
-
-all:
-       @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-
-clean:
-       @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=$@ common
-       @rm -f *~
-
-install:
-       @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)
-
diff --git a/doc/all.mk b/doc/all.mk
new file mode 100644 (file)
index 0000000..5698f21
--- /dev/null
@@ -0,0 +1,42 @@
+ifneq "$(docdir)" "no"
+install: install.doc
+
+clean: clean.doc
+
+DOCFILES       := $(filter-out %~ %/Makefile doc/00-OLD doc/examples doc/rfc doc/source,$(wildcard doc/* doc/rfc/*.txt doc/examples/*))
+DOCINSTALL     := $(patsubst doc/%,$(R)$(docdir)/%,$(DOCFILES))
+
+DOCDIRS                := $(R)/$(docdir)/ $(R)/$(docdir)/rfc/ $(R)/$(docdir)/examples/
+
+
+#  Create the directories
+$(DOCDIRS):
+       @echo INSTALL $@
+       @$(INSTALL) -d -m 755 $@
+
+#  Files depend on directories (order only).
+#  We don't care if the directories change.
+$(DOCINSTALL): | $(DOCDIRS)
+
+#  Wildcard installation rule
+$(R)$(docdir)/%: doc/%
+       @echo INSTALL $<
+       @$(INSTALL) -m 644 $< $@
+
+install.doc: $(DOCINSTALL)
+
+.PHONY: clean.doc
+clean.doc:
+       @rm -f *~ rfc/*~ examples/*~
+
+#
+#  Deal with these later
+#
+DOCRST := $(wildcard *.rst)
+%.html: %.rst
+       @rst2html.py $^ > $@
+
+.PHONY: html
+html: $(DOCRST:.rst=.html)
+
+endif
diff --git a/doc/examples/Makefile b/doc/examples/Makefile
deleted file mode 100644 (file)
index c02b369..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#
-# Makefile
-#
-# Version:     $Id$
-#
-
-include ../../Make.inc
-
-all:
-
-clean:
-       @rm -f *~
-
-install:
-       $(INSTALL) -d -m 755 $(R)$(docdir)/examples
-       for file in *[!~]; do \
-               if [ -f $$file -a $$file != Makefile ]; then \
-                       $(INSTALL) -m 644 $$file $(R)$(docdir)/examples; \
-               fi; \
-       done
-
-.PHONY: all clean install
index de84b2ced3c6b31c6fb2e653d8ed90490017c4d4..d999cc5e233d076a38e2d1e487c59a23e5a1f9e9 100644 (file)
@@ -28,10 +28,4 @@ refs: $(RFC)
 clean:
        @rm -f refs *rfc*.html *~ .rewrite index.html
 
-install:
-       $(INSTALL) -d -m 755 $(R)$(docdir)/rfc
-       for file in `ls -1 *.txt *.html`; do \
-               $(INSTALL) -m 644 $$file $(R)$(docdir)/rfc; \
-       done
-
-.PHONY: all clean install html
+.PHONY: all clean html
diff --git a/main.mk b/main.mk
index 79d45ce7998428fad50aa0478b15bf8367460c0a..666d5b90c10b2e58689664f23546adf508586677 100644 (file)
--- a/main.mk
+++ b/main.mk
@@ -1 +1 @@
-SUBMAKEFILES := src/all.mk
+SUBMAKEFILES := src/all.mk scripts/all.mk doc/all.mk