home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / forut062.zip / ForUtil-0.62 / man / makefile < prev    next >
Makefile  |  1996-08-21  |  2KB  |  80 lines

  1. #
  2. # ForUtil/man/Makefile
  3. #
  4. # Makefile for building each of the manual page directories from the
  5. # groff source in man/man
  6. #
  7. # Needed to build these things are:
  8. # man2html
  9. # groff
  10. # add_urls.sh
  11. #
  12.  
  13. #
  14. # Commands used in this Makefile
  15. GROFF=groff -Tascii -man
  16. SED=sed
  17. RM=rm -f
  18. MAKE=make
  19. ADDURL=./add_urls.sh
  20. MAN2HTML= man2html -title
  21.  
  22. #
  23. # groff source files for the ForUtil manual pages
  24. SRCS= man/fflow.1 \
  25.     man/ffscan.1 \
  26.     man/ftags.1 \
  27.     man/get_common.1 \
  28.     man/scan_commons.1 \
  29.     man/list_commons.1 \
  30.     man/scan_commons.1
  31.  
  32. #
  33. # Compilation actions
  34. all: rest-in-groff text html
  35. .PHONY: all
  36.  
  37. #
  38. # This is to prevent unneccesary creation of the preformat/* manual pages
  39. # if nothing in man/* has been touched.
  40. # (See the GNU make info on Empty Targets for more information)
  41. .PHONY: rest-in-groff
  42. rest-in-groff: stmp-preformat
  43.  
  44. stmp-preformat: $(SRCS)
  45.     $(MAKE) format
  46.     touch $@
  47.  
  48. #
  49. # Rule to create formatted manual pages from groff source
  50. # This rule is never instanciated directly.
  51. format::
  52.     @(set -x; for file in man/*.1 ; do \
  53.         $(GROFF) $$file > preformat/`basename $$file .1`.1 ; \
  54.     done )
  55.  
  56. #
  57. # Rule to create plain text version of formatted manual pages in preformat
  58. text:: rest-in-groff
  59.     @(set -x; for file in preformat/*.1 ; do \
  60.         $(SED) -e 's/.//g' $$file > doc/`basename $$file .1`.txt ; \
  61.     done )
  62.  
  63. #
  64. # Rule to create html versions of formatted manual pages in preformat
  65. html:: rest-in-groff
  66.     @(set -x; for file in preformat/*.1 ; do \
  67.         base=`basename $$file .1` ; \
  68.         $(MAN2HTML) "$$base Manual Page" < $$file > html/$$base.html ; \
  69.     done ; \
  70.     $(ADDURL) )
  71.  
  72. clean::
  73.     $(RM) preformat/*.1
  74.     $(RM) doc/*.txt
  75.     $(RM) html/*.html
  76.     $(RM) stmp-preformat
  77.  
  78. #
  79. # No dependencies
  80.