home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cweb28.zip / Makefile < prev    next >
Makefile  |  1992-12-21  |  5KB  |  176 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 = gcc
  57. # You need this under EMX
  58. EMXBIND = emxbind
  59.  
  60. # RM and CP are used below in case rm and cp are aliased
  61. RM= /bin/rm
  62. CP= /bin/cp
  63.  
  64. ##########  You shouldn't have to change anything after this point #######
  65.  
  66. CWEAVE = .\cweave.exe
  67. CTANGLE = .\ctangle.exe
  68. SOURCES = cweave.w common.w ctangle.w
  69. ALMOSTALL =  common.w ctangle.w Makefile README common.c common.h ctangle.c \
  70.     cwebman.tex cwebmac.tex examples common-vms.ch ctangle-vms.ch \
  71.     cweave-vms.ch common-man.ch ctangle-man.ch cweave-man.ch \
  72.     cweb.1 cweb.el prod.w
  73. ALL =  $(ALMOSTALL) cweave.w
  74.  
  75. .SUFFIXES: .tex .dvi .w
  76.  
  77. .w.tex:
  78.     $(CWEAVE) $*
  79.  
  80. .tex.dvi:    
  81.     tex $<
  82.  
  83. .w.dvi:
  84.     make $*.tex
  85.     make $*.dvi
  86.  
  87. .w.c:
  88.     $(CTANGLE) $*
  89.  
  90. .w.o:
  91.     make $*.c
  92.     make $*.o
  93.  
  94. all: ctangle.exe cweave.exe
  95.  
  96. cautiously: ctangle.exe
  97.     $(CP) common.c SAVEcommon.c
  98.     .\ctangle.exe common $(CCHANGES)
  99.     diff common.c SAVEcommon.c
  100.     $(RM) SAVEcommon.c
  101.     $(CP) ctangle.c SAVEctangle.c
  102.     .\ctangle.exe ctangle $(TCHANGES)
  103.     diff ctangle.c SAVEctangle.c
  104.     $(RM) SAVEctangle.c
  105.  
  106. SAVEctangle.c:
  107.     $(CP) ctangle.c SAVEctangle.c
  108.  
  109. SAVEcommon.c:
  110.     $(CP) common.c SAVEcommon.c
  111.  
  112. common.c: common.w $(CCHANGES)
  113.     $(CTANGLE) common $(CCHANGES)
  114.  
  115. common.o: common.c
  116.     $(CC) $(CFLAGS) -DINCLUDEDIR="$(INCLUDEDIR)/" -c common.c
  117.  
  118. ctangle.exe: ctangle.o common.o
  119.     $(CC) $(CFLAGS) -o ctangle ctangle.o common.o
  120.     $(EMXBIND) ctangle
  121.  
  122. ctangle.c: ctangle.w $(TCHANGES)
  123.     $(CTANGLE) ctangle $(TCHANGES)
  124.  
  125. cweave.exe: cweave.o common.o
  126.     $(CC) $(CFLAGS) -o cweave cweave.o common.o
  127.     $(EMXBIND) cweave
  128.  
  129. cweave.c: cweave.w $(WCHANGES)
  130.     $(CTANGLE) cweave $(WCHANGES)
  131.  
  132. doc: $(SOURCES:.w=.dvi)
  133.  
  134. usermanual: cwebman.tex cwebmac.tex
  135.     tex cwebman
  136.  
  137. fullmanual: usermanual $(SOURCES) common-man.ch ctangle-man.ch cweave-man.ch
  138.     make cweave
  139.     .\cweave.exe common.w common-man.ch
  140.     tex common.tex
  141.     .\cweave.exe ctangle.w ctangle-man.ch
  142.     tex ctangle.tex
  143.     .\cweave.exe cweave.w cweave-man.ch
  144.     tex cweave.tex
  145.  
  146. # be sure to leave ctangle.c and common.c for bootstrapping
  147. clean:
  148.     $(RM) -f -r *~ *.o common.tex cweave.tex cweave.c ctangle.tex \
  149.       *.log *.dvi *.toc core cweave.w.[12] cweave.exe ctangle.exe
  150.  
  151. install: all
  152.     $(CP) cweave.exe $(DESTDIR)$(DESTPREF)weave
  153.     chmod 755 $(DESTDIR)$(DESTPREF)weave
  154.     $(CP) ctangle.exe $(DESTDIR)$(DESTPREF)tangle
  155.     chmod 755 $(DESTDIR)$(DESTPREF)tangle
  156.     $(CP) cweb.1 $(MANDIR)/cweb.$(MANEXT)
  157.     chmod 644 $(MANDIR)/cweb.$(MANEXT)
  158.     $(CP) cwebmac.tex $(MACROSDIR)
  159.     chmod 644 $(MACROSDIR)/cwebmac.tex
  160.     $(CP) cweb.el $(EMACSDIR)
  161.     chmod 644 $(EMACSDIR)/cweb.el
  162.  
  163. bundle: $(ALL)
  164.     sed -n '1,1500 p' cweave.w > cweave.w.1
  165.     sed -n '1501,$$ p' cweave.w > cweave.w.2
  166.     /usr/local/bin/shar -m100000 -c -v -f cweb $(ALMOSTALL) cweave.w.[12]
  167.  
  168. tarfile: $(ALL)
  169.     tar cvhf cweb.tar $(ALL)
  170.  
  171. floppy: $(ALL)
  172.     bar cvhf /dev/rfd0 $(ALL)
  173.     bar tvf /dev/rfd0
  174.     eject
  175.