home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cweb28.zip / Makefile.org < prev    next >
Makefile  |  1992-10-03  |  4KB  |  172 lines

  1. # This file is part of CWEB.
  2. # It is distributed WITHOUT ANY WARRANTY, express or implied.
  3. # Last updated by Don Knuth, October 1992
  4.  
  5. # Copyright (C) 1987,1990,1992 Silvio Levy and Donald E. Knuth
  6.  
  7. # Permission is granted to make and distribute verbatim copies of this
  8. # document provided that the copyright notice and this permission notice
  9. # are preserved on all copies.
  10.  
  11. # Permission is granted to copy and distribute modified versions of this
  12. # document under the conditions for verbatim copying, provided that the
  13. # entire resulting derived work is distributed under the terms of a
  14. # permission notice identical to this one.
  15.  
  16. # Read the README file, then edit this file to reflect local conditions
  17. #
  18.  
  19. # directory for TeX inputs (cwebmac.tex goes here)
  20. MACROSDIR= /usr/local/lib/tex/inputs
  21.  
  22. # directory for CWEB inputs in @i files
  23. INCLUDEDIR= /usr/local/lib/cweb
  24.  
  25. # extension for manual pages ("l" distinguishes local from system stuff)
  26. MANEXT= l
  27. #MANEXT= 1
  28.  
  29. # directory for manual pages (cweb.1 goes here)
  30. MANDIR= /u/man/man$(MANEXT)
  31.  
  32. # destination directory for executables; must end in /
  33. DESTDIR= /usr/local/bin/
  34.  
  35. # directory for GNU EMACS Lisp code (cweb.el goes here)
  36. EMACSDIR= /usr/local/emacs/lisp
  37.  
  38. # Set DESTPREF to null if you want to call the executables "tangle" and "weave"
  39. # (probably NOT a good idea; we recommend leaving DESTPREF=c)
  40. DESTPREF=c
  41.  
  42. # Set CCHANGES to common-foo.ch if you need changes to common.w
  43. CCHANGES=
  44.  
  45. # Set TCHANGES to ctangle-foo.ch if you need changes to ctangle.w
  46. TCHANGES=
  47.  
  48. # Set WCHANGES to cweave-foo.ch if you need changes to cweave.w
  49. WCHANGES=
  50.  
  51. # We keep debugging info around, for fun, but most users don't need it
  52. CFLAGS = -g -DDEBUG -DSTAT
  53. #CFLAGS = -O
  54.  
  55. # What C compiler are you using?
  56. CC = cc
  57.  
  58. # RM and CP are used below in case rm and cp are aliased
  59. RM= /bin/rm
  60. CP= /bin/cp
  61.  
  62. ##########  You shouldn't have to change anything after this point #######
  63.  
  64. CWEAVE = ./cweave
  65. CTANGLE = ./ctangle
  66. SOURCES = cweave.w common.w ctangle.w
  67. ALMOSTALL =  common.w ctangle.w Makefile README common.c common.h ctangle.c \
  68.     cwebman.tex cwebmac.tex examples common-vms.ch ctangle-vms.ch \
  69.     cweave-vms.ch common-man.ch ctangle-man.ch cweave-man.ch \
  70.     cweb.1 cweb.el prod.w
  71. ALL =  $(ALMOSTALL) cweave.w
  72.  
  73. .SUFFIXES: .tex .dvi .w
  74.  
  75. .w.tex:
  76.     $(CWEAVE) $*
  77.  
  78. .tex.dvi:    
  79.     tex $<
  80.  
  81. .w.dvi:
  82.     make $*.tex
  83.     make $*.dvi
  84.  
  85. .w.c:
  86.     $(CTANGLE) $*
  87.  
  88. .w.o:
  89.     make $*.c
  90.     make $*.o
  91.  
  92. all: ctangle cweave
  93.  
  94. cautiously: ctangle
  95.     $(CP) common.c SAVEcommon.c
  96.     ./ctangle common $(CCHANGES)
  97.     diff common.c SAVEcommon.c
  98.     $(RM) SAVEcommon.c
  99.     $(CP) ctangle.c SAVEctangle.c
  100.     ./ctangle ctangle $(TCHANGES)
  101.     diff ctangle.c SAVEctangle.c
  102.     $(RM) SAVEctangle.c
  103.  
  104. SAVEctangle.c:
  105.     $(CP) ctangle.c SAVEctangle.c
  106.  
  107. SAVEcommon.c:
  108.     $(CP) common.c SAVEcommon.c
  109.  
  110. common.c: common.w $(CCHANGES)
  111.     $(CTANGLE) common $(CCHANGES)
  112.  
  113. common.o: common.c
  114.     $(CC) $(CFLAGS) -DINCLUDEDIR=\"$(INCLUDEDIR)/\" -c common.c
  115.  
  116. ctangle: ctangle.o common.o
  117.     $(CC) $(CFLAGS) -o ctangle ctangle.o common.o 
  118.  
  119. ctangle.c: ctangle.w $(TCHANGES)
  120.     $(CTANGLE) ctangle $(TCHANGES)
  121.  
  122. cweave: cweave.o common.o
  123.     $(CC) $(CFLAGS) -o cweave cweave.o common.o
  124.  
  125. cweave.c: cweave.w $(WCHANGES)
  126.     $(CTANGLE) cweave $(WCHANGES)
  127.  
  128. doc: $(SOURCES:.w=.dvi)
  129.  
  130. usermanual: cwebman.tex cwebmac.tex
  131.     tex cwebman
  132.  
  133. fullmanual: usermanual $(SOURCES) common-man.ch ctangle-man.ch cweave-man.ch
  134.     make cweave
  135.     ./cweave common.w common-man.ch
  136.     tex common.tex
  137.     ./cweave ctangle.w ctangle-man.ch
  138.     tex ctangle.tex
  139.     ./cweave cweave.w cweave-man.ch
  140.     tex cweave.tex
  141.  
  142. # be sure to leave ctangle.c and common.c for bootstrapping
  143. clean:
  144.     $(RM) -f -r *~ *.o common.tex cweave.tex cweave.c ctangle.tex \
  145.       *.log *.dvi *.toc core cweave.w.[12] cweave ctangle
  146.  
  147. install: all
  148.     $(CP) cweave $(DESTDIR)$(DESTPREF)weave
  149.     chmod 755 $(DESTDIR)$(DESTPREF)weave
  150.     $(CP) ctangle $(DESTDIR)$(DESTPREF)tangle
  151.     chmod 755 $(DESTDIR)$(DESTPREF)tangle
  152.     $(CP) cweb.1 $(MANDIR)/cweb.$(MANEXT)
  153.     chmod 644 $(MANDIR)/cweb.$(MANEXT)
  154.     $(CP) cwebmac.tex $(MACROSDIR)
  155.     chmod 644 $(MACROSDIR)/cwebmac.tex
  156.     $(CP) cweb.el $(EMACSDIR)
  157.     chmod 644 $(EMACSDIR)/cweb.el
  158.  
  159. bundle: $(ALL)
  160.     sed -n '1,1500 p' cweave.w > cweave.w.1
  161.     sed -n '1501,$$ p' cweave.w > cweave.w.2
  162.     /usr/local/bin/shar -m100000 -c -v -f cweb $(ALMOSTALL) cweave.w.[12]
  163.  
  164. tarfile: $(ALL)
  165.     tar cvhf cweb.tar $(ALL)
  166.  
  167. floppy: $(ALL)
  168.     bar cvhf /dev/rfd0 $(ALL)
  169.     bar tvf /dev/rfd0
  170.     eject
  171.