home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / new / dev / misc / cweb / makefile.c89 < prev    next >
Makefile  |  1993-12-21  |  6KB  |  208 lines

  1. # This file is part of CWEB.
  2. # This program by Silvio Levy is based on a program by D. E. Knuth.
  3. # It is distributed WITHOUT ANY WARRANTY, express or implied.
  4. #
  5. # Modified for the c89 HP compiler under HP-UX 8.0 on a HP 9000/400 by
  6. # Klaus Guntermann <gunterma@iti.informatik.th-darmstadt.de> and
  7. # Hans-Hermann Bode <HHBODE@DOSUNI1.BITNET>, August 1992.
  8. # Last updated by Klaus Guntermann, August 1992
  9.  
  10. # Copyright (C) 1987,1990 Silvio Levy and Donald E. Knuth
  11. # Copyright (C) 1992     Klaus Guntermann
  12.  
  13. # Permission is granted to make and distribute verbatim copies of this
  14. # document provided that the copyright notice and this permission notice
  15. # are preserved on all copies.
  16.  
  17. # Permission is granted to copy and distribute modified versions of this
  18. # document under the conditions for verbatim copying, provided that the
  19. # entire resulting derived work is distributed under the terms of a
  20. # permission notice identical to this one.
  21.  
  22. # Read the readme.c89 file, then edit this file to reflect local conditions
  23. #
  24.  
  25. # directory for TeX inputs (cwebmac.tex goes here)
  26. MACROSDIR= /usr/local/lib/tex/inputs
  27.  
  28. # directory for CWEB inputs in @i files
  29. INCLUDEDIR= /usr/local/lib/cweb
  30.  
  31. # extension for manual pages ("l" distinguishes local from system stuff)
  32. MANEXT= l
  33. #MANEXT= 1
  34.  
  35. # directory for manual pages (cweb.1 goes here)
  36. MANDIR= /u/man/man$(MANEXT)
  37.  
  38. # destination directory for executables; must end in /
  39. DESTDIR= /usr/local/bin/
  40.  
  41. # directory for GNU EMACS Lips code (cweb.el goes here)
  42. EMACSDIR= /usr/local/emacs/lisp
  43.  
  44. # Set DESTPREF to null if you want to call the executables "tangle" and "weave"
  45. # (probably not a good idea)
  46. DESTPREF=c
  47.  
  48. # Set CHCHANGES to common-foo.hch if you need changes to common.h
  49. CHCHANGES=common-p.hch
  50.  
  51. # Set CCHANGES to common-foo.ch if you need changes to common.w
  52. CCHANGES=common-p.ch
  53.  
  54. # Set TCHANGES to ctangle-foo.ch if you need changes to ctangle.w
  55. TCHANGES=ctangl-p.ch
  56.  
  57. # Set WCHANGES to cweave-foo.ch if you need changes to cweave.w
  58. WCHANGES=cweave-p.ch
  59.  
  60. # Set PCHANGES to prod-foo.ch if you need changes to prod.w
  61. PCHANGES=prod-p.ch
  62.  
  63. # Set MCHANGES to wmerge-foo.ch if you need changes to prod.w
  64. MCHANGES=wmerge-p.ch
  65.  
  66. # We keep debugging info around, for fun, but most users don't need it
  67. CFLAGS =
  68.  
  69. # Set WMERGE such that the wmerge processor can be found.
  70. # It will be needed if you made additional changes to 
  71. # common-p.hch, prod-w.ch, or ccwebmac.ch.
  72. # If you installed a copy, e.g. in /usr/local/bin, and this is in
  73. # you PATH, just call wmerge; but if it is not installed, you may
  74. # have to call it from the subdirectory
  75. WMERGE=./examples/wmerge
  76.  
  77. # RM and CP are used below in case rm and cp are aliased
  78. RM= /bin/rm
  79. CP= /bin/cp
  80. INSTALL= install
  81. #INSTALL= /bin/cp  # use this if `install' isn't available
  82. CC = c89
  83.  
  84. ##########  You shouldn't have to change anything after this point #######
  85.  
  86. CWEAVE = ./cweave
  87. CTANGLE = ./ctangle
  88. SOURCES = cweave.w common.w ctangle.w
  89. ALMOSTALL = common.w ctangle.w makefile.org readme.org common.c common.h \
  90.     ctangle.c cwebman.tex cwebmac.tex examples cweb.1 cweb.el prod.w \
  91.     $(CCHANGES) $(CHCHANGES) $(TCHANGES) $(WCHANGES) $(PCHANGES) \
  92.     readme.c89 ccwebmac.ch cweb.man readme.pc makefile.pc
  93. ALL =  $(ALMOSTALL) cweave.w
  94.  
  95. .SUFFIXES: .tex .dvi .w
  96.  
  97. .w.tex:
  98.     $(CWEAVE) $*
  99.  
  100. .tex.dvi:    
  101.     tex $*
  102.  
  103. .w.dvi:
  104.     make $*.tex
  105.     make $*.dvi
  106.  
  107. .w.c:
  108.     $(CTANGLE) $*
  109.  
  110. .w.o:
  111.     make $*.c
  112.     make $*.o
  113.  
  114. all: ctangle cweave examples/wmerge
  115.  
  116. cautiously: ctangle
  117.     $(CP) common.c SAVEcommon.c
  118.     ./ctangle common $(CCHANGES)
  119.     diff common.c SAVEcommon.c
  120.     $(RM) SAVEcommon.c
  121.     $(CP) ctangle.c SAVEctangle.c
  122.     ./ctangle ctangle $(TCHANGES)
  123.     diff ctangle.c SAVEctangle.c
  124.     $(RM) SAVEctangle.c
  125.  
  126. SAVEctangle.c:
  127.     $(CP) ctangle.c SAVEctangle.c
  128.  
  129. SAVEcommon.c:
  130.     $(CP) common.c SAVEcommon.c
  131.  
  132. common.c: common.w $(CCHANGES)
  133.     $(CTANGLE) common $(CCHANGES)
  134.  
  135. common.o: common.c
  136.     $(CC) $(CFLAGS) -DINCLUDEDIR -c common.c
  137.  
  138. ctangle: ctangle.o common.o
  139.     $(CC) $(CFLAGS) -o ctangle ctangle.o common.o
  140.  
  141. ctangle.c: ctangle.w $(TCHANGES) common-p.h
  142.     $(CTANGLE) ctangle $(TCHANGES)
  143.  
  144. cweave: cweave.o common.o
  145.     $(CC) $(CFLAGS) -o cweave cweave.o common.o
  146.  
  147. cweave.c: cweave.w $(WCHANGES) common-p.h prod-p.w
  148.     $(CTANGLE) cweave $(WCHANGES)
  149.  
  150. # additional rules to `wmerge' the remaining files
  151. #
  152. examples/wmerge: examples/wmerge.c
  153.     (cd examples; $(CC) $(CFLAGS) -o wmerge wmerge.c)
  154.  
  155. examples/wmerge.c: examples/wmerge.w examples/$(MCHANGES)
  156.     (cd examples; ../$(CTANGLE) wmerge $(MCHANGES))
  157.  
  158. common-p.h: common.h $(CHCHANGES)
  159.     $(WMERGE) common.h $(CHCHANGES) > common-p.h
  160.  
  161. prod-p.w: prod.w $(PCHANGES)
  162.     $(WMERGE) prod.w $(PCHANGES) > prod-p.w
  163.  
  164. ccwebmac.tex: cwebmac.tex ccwebmac.ch
  165.     $(WMERGE) cwebmac.tex ccwebmac.ch > ccwebmac.tex
  166.  
  167. doc:    $(SOURCES) examples/wmerge.w
  168.     for i in $?; do make `echo $$i | sed "s/w$$/dvi/"`; done
  169.     @touch doc
  170.  
  171. # making the documentation we will have to include the change files
  172. ctangle.tex: ctangle.w $(TCHANGES)
  173.     $(CWEAVE) ctangle $(TCHANGES)
  174.  
  175. cweave.tex: cweave.w $(WCHANGES)
  176.     $(CWEAVE) cweave $(WCHANGES)
  177.  
  178. common.tex: common.w $(CCHANGES)
  179.     $(CWEAVE) common $(CCHANGES)
  180.  
  181. examples/wmerge.tex: examples/wmerge.w
  182.     (cd examples; ../$(CWEAVE) wmerge $(MCHANGES))
  183.  
  184. # be sure to leave ctangle.c and common.c for bootstrapping
  185. clean:
  186.     $(RM) -f -r *~ *.o common.tex cweave.tex cweave.c ctangle.tex \
  187.       *.log *.dvi *.toc core cweave.w.[12] cweave ctangle \
  188.       examples/wmerge.tex examples/wmerge
  189.  
  190. install: all ccwebmac.tex
  191.     $(INSTALL) cweave $(DESTDIR)$(DESTPREF)weave
  192.     $(INSTALL) examples/wmerge $(DESTDIR)wmerge
  193.     $(INSTALL) ctangle $(DESTDIR)$(DESTPREF)tangle
  194.     $(INSTALL) ccwebmac.tex $(MACROSDIR)
  195.     $(INSTALL) cweb.1 $(MANDIR)/cweb.$(MANEXT)
  196.     $(INSTALL) cweb.el $(EMACSDIR)
  197.  
  198. bundle: $(ALL)
  199.     sed -n '1,1500 p' cweave.w > cweave.w.1
  200.     sed -n '1501,$$ p' cweave.w > cweave.w.2
  201.     /usr/local/bin/shar -m100000 -c -v -f cweb $(ALMOSTALL) cweave.w.[12]
  202.  
  203. floppy: $(ALL)
  204.     bar cvf /dev/rfd0 $(ALL)
  205.     bar tvf /dev/rfd0
  206.     eject
  207.