include scripts/boiler.mk
# These are not yet converted to the new system
-SUBDIRS = $(wildcard raddb doc)
+SUBDIRS = $(wildcard raddb)
.PHONY: tests
tests:
+++ /dev/null
-#
-# 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)
-
--- /dev/null
+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
+++ /dev/null
-#
-# 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
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
-SUBMAKEFILES := src/all.mk
+SUBMAKEFILES := src/all.mk scripts/all.mk doc/all.mk