doc_makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # This file was written by Paul Rombouts.
  2. # Because pdnsd currently has a very idiosyncratic method of building documentation
  3. # I prefer to keep the actual build rules outside of the Makefiles an ordinary user
  4. # would use to compile pdnsd and therefore I have put them into separate 'doc_makefile's.
  5. #
  6. # To rebuild pdnsd docs after you have modified something that other files depend on,
  7. # run 'make -f doc_makefile doc' in the doc/ directory.
  8. # This makefile is also invoked when you build a pdnsd distribution tarball
  9. # using 'make dist' in the toplevel pdnsd source directory.
  10. #
  11. # If anyone thinks there is a much more elegant method for building the pdnsd docs
  12. # using a conventional autoconf/automake process, please let me know.
  13. versionfile = ../version
  14. doc: pdnsd-ctl.8 pdnsd.conf.5.in html txt
  15. .PHONY: pdnsd-ctl.8 doc html txt clean
  16. pdnsd-ctl.8:
  17. @pver=`cat $(versionfile)` && \
  18. mver=`perl -e 'while(<>) {if(/^\s*\.TH(?:\s+(?:"[^"]*"|[^"\s]+)){3}\s+"pdnsd\s+([^"]*)"/) {print "$$1\n";exit 0}} \
  19. die "Cannot find version in $$ARGV\n"' $@` && { \
  20. test "$$mver" = "$$pver" || { \
  21. perl -p -i.makesave -e 's/^(\s*\.TH(?:\s+(?:"[^"]*"|[^"\s]+)){3}\s+"pdnsd\s+)[^"]*(")/$${1}'"$$pver"'$${2}/' $@ && \
  22. echo "Updated version in $@: $$mver -> $$pver"; \
  23. }; \
  24. }
  25. pdnsd.conf.5.in: html/doc.html html2confman.pl
  26. perl html2confman.pl $< > $@
  27. html txt:
  28. @cd $@ && $(MAKE) -f doc_makefile
  29. clean:
  30. @rm -fv pdnsd.conf.5.in
  31. @cd html && $(MAKE) -f doc_makefile clean
  32. @cd txt && $(MAKE) -f doc_makefile clean