home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 February / PCWorld_2000-02_cd.bin / live / usr / X11R6 / lib / X11 / config / lnxdoc.rules < prev    next >
Text File  |  1999-09-03  |  5KB  |  169 lines

  1. XCOMM $XFree86: xc/config/cf/lnxdoc.rules,v 3.9.2.3 1999/05/25 06:55:07 hohndel Exp $
  2. XCOMM
  3. XCOMM Rules for formatting Linuxdoc-SGML documentation
  4. XCOMM
  5.  
  6. #include <lnxdoc.tmpl>
  7.  
  8. #ifdef DontInstallLinuxDoc
  9. #define LinuxDocInstall(file,dest)    /* do nothing */
  10. #define LinuxDocInstallMultiple(files,dest)    /* do nothing */
  11. #else
  12. #define LinuxDocInstall(file,dest)    InstallNonExecFile(file,dest)
  13. #define LinuxDocInstallMultiple(files,dest)                @@\
  14. InstallMultipleDest(install,files,dest)
  15. #endif
  16.  
  17. #if !HasSgmlFmt
  18. /* Version for Linuxdoc-SGML */
  19. #if BuildLinuxDocPS
  20. #define LinuxDocSgmlToPs(sgmlfile,base)                 @@\
  21. AllTarget(base.ps)                            @@\
  22.                                     @@\
  23. base.ps: sgmlfile                            @@\
  24.     RemoveFile(base.dvi)                        @@\
  25.     $(LINUXDOCFORMAT) -T latex sgmlfile | \                @@\
  26.         $(LINUXDOCLATEX) -d > base.dvi                @@\
  27.     RemoveFile(base.ps)                        @@\
  28.     $(DVIPS) $(DVIPSOPTIONS) -o base._ps base.dvi && \        @@\
  29.         $(MV) base._ps $@                        @@\
  30.     RemoveFile(base.dvi)                        @@\
  31.                                     @@\
  32. LinuxDocInstall(base.ps,$(XFREE86PSDOCDIR))                @@\
  33.                                     @@\
  34. clean::                                    @@\
  35.     RemoveFiles(base.dvi base._ps base.ps)
  36. #else
  37. #define LinuxDocSgmlToPs(sgmlfile,base) /**/
  38. #endif
  39.  
  40. #if BuildLinuxDocText
  41. #define LinuxDocSgmlToText(sgmlfile,textfile)                @@\
  42. AllTarget(textfile)                            @@\
  43.                                     @@\
  44. textfile: sgmlfile                            @@\
  45.     RemoveFile(textfile)                        @@\
  46.     $(LINUXDOCFORMAT) -T nroff sgmlfile | \                @@\
  47.         $(LINUXDOCROFF) | $(XFREE86IDENTFIX) > _$@ && \        @@\
  48.         $(MV) _$@ $@                        @@\
  49.                                     @@\
  50. LinuxDocInstall(textfile,$(XFREE86DOCDIR))                @@\
  51.                                     @@\
  52. clean::                                    @@\
  53.     RemoveFiles(Concat(_,textfile) textfile)
  54. #else
  55. #define LinuxDocSgmlToText(sgmlfile,textfile) /**/
  56. #endif
  57.  
  58. /*
  59.  * The 'echo' stuff here is a bit of a hack, but 'set -x' doesn't show
  60.  * what is going on.
  61.  */
  62. #if BuildLinuxDocHtml
  63. #define LinuxDocSgmlToHtml(sgmlfile,base)                @@\
  64. AllTarget(base.html)                            @@\
  65.                                     @@\
  66. base.html: sgmlfile                            @@\
  67.     @(TMP=/tmp/tmp.$$$$; \                        @@\
  68.       RemoveFile($${TMP}); \                    @@\
  69.       echo RemoveFiles(base*.html); \                @@\
  70.       RemoveFiles(base*.html); \                    @@\
  71.       echo "$(LINUXDOCFORMAT) -T html sgmlfile |" \            @@\
  72.         "$(LINUXDOCPREHTML) | $(LINUXDOCFIXREF) > $${TMP}"; \    @@\
  73.       $(LINUXDOCFORMAT) -T html sgmlfile | \            @@\
  74.         $(LINUXDOCPREHTML) | $(LINUXDOCFIXREF) > $${TMP};     \    @@\
  75.       echo "$(LINUXDOCFORMAT) -T html sgmlfile |" \            @@\
  76.         "$(LINUXDOCPREHTML) >> $${TMP}"; \                @@\
  77.       $(LINUXDOCFORMAT) -T html sgmlfile | \            @@\
  78.         $(LINUXDOCPREHTML) >> $${TMP}; \                @@\
  79.       echo "$(LINUXDOCHTML) base < $${TMP} > base.html &&" \    @@\
  80.         "$(MV) base._html $@"; \                    @@\
  81.       $(LINUXDOCHTML) base < $${TMP} > base._html && \        @@\
  82.         $(MV) base._html $@; \                    @@\
  83.       RemoveFile($${TMP}))                        @@\
  84.                                     @@\
  85. LinuxDocInstallMultiple(base*.html,$(XFREE86HTMLDOCDIR))        @@\
  86.                                     @@\
  87. clean::                                    @@\
  88.     RemoveFiles(base*.html base._html)
  89. #else
  90. #define LinuxDocSgmlToHtml(sgmlfile,base) /**/
  91. #endif
  92.  
  93. #else /* HasSgmlFmt */
  94.  
  95. /* Version for FreeBSD's sgmlfmt */
  96. #if BuildLinuxDocPS
  97. #define LinuxDocSgmlToPs(sgmlfile,base)                 @@\
  98. AllTarget(base.ps)                            @@\
  99.                                     @@\
  100. base.ps: sgmlfile                            @@\
  101.     RemoveFile(base.ps)                        @@\
  102.     @(BASE=`basename sgmlfile .sgml`;\                @@\
  103.       set -x;\                            @@\
  104.       RemoveFile($$BASE.ps);\                    @@\
  105.       $(SGMLFMTCMD) -f ps sgmlfile && \                @@\
  106.         $(MV) $$BASE.ps _$@ && $(MV) _$@ $@)            @@\
  107.                                     @@\
  108. LinuxDocInstall(base.ps,$(XFREE86PSDOCDIR))                @@\
  109.                                     @@\
  110. clean::                                    @@\
  111.     RemoveFile(Concat(_,base.ps) base.ps)
  112. #else
  113. #define LinuxDocSgmlToPs(sgmlfile,base) /**/
  114. #endif
  115.  
  116. #if BuildLinuxDocText
  117. #define LinuxDocSgmlToText(sgmlfile,textfile)                @@\
  118. AllTarget(textfile)                            @@\
  119.                                     @@\
  120. textfile: sgmlfile                            @@\
  121.     RemoveFile(textfile)                        @@\
  122.     @(BASE=`basename sgmlfile .sgml`;\                @@\
  123.       set -x;\                            @@\
  124.       RemoveFile($$BASE.latin1);\                    @@\
  125.       $(SGMLFMTCMD) -f latin1 -b -n sgmlfile && \            @@\
  126.       $(XFREE86IDENTFIX) < $$BASE.latin1 > _$@ && $(MV) _$@ $@ && \    @@\
  127.       RemoveFile($$BASE.latin1))                    @@\
  128.                                     @@\
  129. LinuxDocInstall(textfile,$(XFREE86DOCDIR))                @@\
  130.                                     @@\
  131. clean::                                    @@\
  132.     RemoveFiles(Concat(_,textfile) textfile)
  133. #else
  134. #define LinuxDocSgmlToText(sgmlfile,textfile) /**/
  135. #endif
  136.  
  137. #if BuildLinuxDocHtml
  138. #define LinuxDocSgmlToHtml(sgmlfile,base)                @@\
  139. AllTarget(base.html)                            @@\
  140.                                     @@\
  141. base.html: sgmlfile                            @@\
  142.     @if [ sgmlfile != base.sgml ]; then $(LN) sgmlfile base.sgml; fi @@\
  143.     RemoveFiles(base*.html)                        @@\
  144.     $(SGMLFMTCMD) -f html base.sgml || RemoveFile($@)        @@\
  145.     @if [ sgmlfile != base.sgml ]; then RemoveFile(base.sgml); fi    @@\
  146.                                     @@\
  147. LinuxDocInstallMultiple(base*.html,$(XFREE86HTMLDOCDIR))        @@\
  148.                                     @@\
  149. clean::                                    @@\
  150.     RemoveFiles(base*.html)
  151. #else
  152. #define LinuxDocSgmlToHtml(sgmlfile,base) /**/
  153. #endif
  154.  
  155. #endif /* HasSgmlFmt */
  156.  
  157.  
  158. #define LinuxDocTargetLong(sgmlfile,textfile,base)            @@\
  159. LinuxDocSgmlToText(sgmlfile,textfile)                    @@\
  160. LinuxDocSgmlToHtml(sgmlfile,base)                    @@\
  161. LinuxDocSgmlToPs(sgmlfile,base)
  162.  
  163. #define LinuxDocReadmeTarget(base)                    @@\
  164. LinuxDocTargetLong(base.sgml,README.base,base)
  165.  
  166. #define LinuxDocTarget(base)                        @@\
  167. LinuxDocTargetLong(base.sgml,base,base)
  168.  
  169.