home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d551 / cweb.lha / CWeb / cweb2.lzh / cweb / Makefile < prev    next >
Makefile  |  1990-12-12  |  4KB  |  139 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. # $Revision 2.0$ -- Don Knuth, July 1990
  5.  
  6. # Copyright (C) 1987,1990 Silvio Levy and Donald E. Knuth
  7.  
  8. # Permission is granted to make and distribute verbatim copies of this
  9. # document provided that the copyright notice and this permission notice
  10. # are preserved on all copies.
  11.  
  12. # Permission is granted to copy and distribute modified versions of this
  13. # document under the conditions for verbatim copying, provided that the
  14. # entire resulting derived work is distributed under the terms of a
  15. # permission notice identical to this one.
  16.  
  17. # Read the README file, then edit this file to reflect local conditions
  18. #
  19.  
  20. # directory for TeX inputs (cwebmac.tex goes here)
  21. MACROSDIR= /usr/local/lib/tex/inputs
  22. #MACROSDIR= /home/tex/local/lib
  23.  
  24. # directory for manual pages (cweb.1 goes here)
  25. MANDIR= /u/man/man1
  26. #MANDIR= /usr/man/man1
  27.  
  28. # destination directory for executables; must end in /
  29. DESTDIR= /usr/local/bin/
  30.  
  31. # Set DESTPREF to null if you want to call the executables "tangle" and "weave"
  32. # (probably not a good idea)
  33. DESTPREF=c
  34.  
  35. # Set CCHANGES to common-foo.ch if you need changes to common.w
  36. CCHANGES=
  37.  
  38. # Set TCHANGES to ctangle-foo.ch if you need changes to ctangle.w
  39. TCHANGES=
  40.  
  41. # Set WCHANGES to cweave-sunview.ch if you want to support SunView
  42. # (cweave-sunview.ch is a sample file demonstrating many other possibilities)
  43. WCHANGES= cweave-sunview.ch
  44.  
  45. # We keep debugging info around, for fun, but most users don't need it
  46. CFLAGS = -g -DDEBUG -DSTAT
  47. #CFLAGS = -O
  48.  
  49. # RM and CP are used below in case rm and cp are aliased
  50. RM= /bin/rm
  51. CP= /bin/cp
  52. INSTALL= install
  53. #INSTALL= /bin/cp  # use this if `install' isn't available
  54.  
  55. ##########  You shouldn't have to change anything after this point #######
  56.  
  57. CWEAVE = ./cweave
  58. CTANGLE = ./ctangle
  59. SOURCES = cweave.w common.w ctangle.w
  60. ALMOSTALL =  common.w ctangle.w Makefile README common.c common.h ctangle.c \
  61.     cwebman.tex cwebmac.tex examples common-vms.ch cweave-sunview.ch \
  62.     cweb.1 cweb.el prod.w
  63. ALL =  $(ALMOSTALL) cweave.w
  64.  
  65. .SUFFIXES: .tex .dvi .w
  66.  
  67. .w.tex:
  68.     $(CWEAVE) $*
  69.  
  70. .tex.dvi:    
  71.     tex $*
  72.  
  73. .w.dvi:
  74.     $(CWEAVE) $*
  75.     tex $*
  76.  
  77. .w.c:
  78.     $(CTANGLE) $*
  79.  
  80. .w.o:
  81.     make $*.c
  82.     make $*.o
  83.  
  84. all: ctangle cweave
  85.  
  86. cautiously: ctangle
  87.     $(CP) common.c SAVEcommon.c
  88.     ./ctangle common $(CCHANGES)
  89.     diff common.c SAVEcommon.c
  90.     $(RM) SAVEcommon.c
  91.     $(CP) ctangle.c SAVEctangle.c
  92.     ./ctangle ctangle $(TCHANGES)
  93.     diff ctangle.c SAVEctangle.c
  94.     $(RM) SAVEctangle.c
  95.  
  96. SAVEctangle.c:
  97.     $(CP) ctangle.c SAVEctangle.c
  98.  
  99. SAVEcommon.c:
  100.     $(CP) common.c SAVEcommon.c
  101.  
  102. common.c: common.w $(CCHANGES)
  103.     $(CTANGLE) common $(CCHANGES)
  104.  
  105. ctangle: ctangle.o common.o
  106.     cc $(CFLAGS) -o ctangle ctangle.o common.o 
  107.  
  108. ctangle.c: ctangle.w $(TCHANGES)
  109.     $(CTANGLE) ctangle $(TCHANGES)
  110.  
  111. cweave: cweave.o common.o
  112.     cc $(CFLAGS) -o cweave cweave.o common.o
  113.  
  114. cweave.c: cweave.w $(WCHANGES)
  115.     $(CTANGLE) cweave $(WCHANGES)
  116.  
  117. doc: $(SOURCES)
  118.     for i in $?; do make `echo $$i | sed "s/web$$/dvi/"`; done
  119.     @touch doc
  120.  
  121. # be sure to leave ctangle.c and common.c for bootstrapping
  122. clean:
  123.     $(RM) -f -r *~ *.o common.tex cweave.tex cweave.c ctangle.tex \
  124.       *.log *.dvi *.toc core cweave.w.[12] cweave ctangle
  125.  
  126. install: all
  127.     $(INSTALL) cweave $(DESTDIR)$(DESTPREF)weave
  128.     $(INSTALL) ctangle $(DESTDIR)$(DESTPREF)tangle
  129.     $(INSTALL) cweb.1 $(MANDIR)
  130.     $(INSTALL) cwebmac.tex $(MACROSDIR)
  131.     $(INSTALL) cweb.el $(EMACSDIR)
  132.  
  133. bundle: $(ALL)
  134.     sed -n '1,1500 p' cweave.w > cweave.w.1
  135.     sed -n '1501,$$ p' cweave.w > cweave.w.2
  136.     /n/fine/usr/local/bin/shar -m100000 -c -v -f cweb $(ALMOSTALL) cweave.w.[12]
  137.  
  138.