home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / dev / c / cweb / makefile.unix < prev    next >
Makefile  |  1994-08-12  |  8KB  |  261 lines

  1. # This file, makefile.unix, is part of CWEB.
  2. # It is distributed WITHOUT ANY WARRANTY, express or implied.
  3.  
  4. # Modified for the CC compiler under HP-UX on a HP Apollo 400 at Bayreuth
  5. # University by Andreas Scherer (sorry, no e-mail; Abt-Wolf-Straße 17,
  6. # 96215 Lichtenfels, Federal Republic of Germany), August 12, 1994.
  7. # Other UNIX compilers like c89 or gcc can work with this file as well.
  8.  
  9. # Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
  10. # Copyright (C) 1994 Andreas Scherer
  11.  
  12. # Permission is granted to make and distribute verbatim copies of this
  13. # document provided that the copyright notice and this permission notice
  14. # are preserved on all copies.
  15.  
  16. # Permission is granted to copy and distribute modified versions of this
  17. # document under the conditions for verbatim copying, provided that the
  18. # entire resulting derived work is given a different name and distributed
  19. # under the terms of a permission notice identical to this one.
  20.  
  21. # Read the README file, then edit this file to reflect local conditions
  22. #
  23.  
  24. # directory for TeX inputs (cwebmac.tex, ccwebmac.tex, or gcwebmac.tex go here)
  25. MACROSDIR= /usr/local/lib/tex/inputs
  26.  
  27. # directory for CWEB inputs in @i files
  28. CWEBINPUTS=/usr/local/lib/cweb
  29.  
  30. # extension for manual pages ("l" distinguishes local from system stuff)
  31. MANEXT= l
  32. #MANEXT= 1
  33.  
  34. # directory for manual pages (cweb.1 goes here)
  35. MANDIR= /usr/man/man$(MANEXT)
  36.  
  37. # destination directory for executables; must end in /
  38. DESTDIR= /usr/local/bin/
  39.  
  40. # directory for GNU EMACS Lisp code (cweb.el goes here)
  41. EMACSDIR= /usr/local/emacs/lisp
  42.  
  43. # directory for the language header file "cweb.h"
  44. CATINCLUDE=./bin/catalogs/
  45.  
  46. # Set DESTPREF to null if you want to call the executables "tangle" and "weave"
  47. # (probably NOT a good idea; we recommend leaving DESTPREF=c)
  48. DESTPREF=c
  49.  
  50. # Set CCHANGES to comm-foo.ch if you need changes to common.w
  51. CCHANGES=common.ch
  52.  
  53. # Set TCHANGES to ctang-foo.ch if you need changes to ctangle.w
  54. TCHANGES=ctangle.ch
  55.  
  56. # Set WCHANGES to cweav-foo.ch if you need changes to cweave.w
  57. WCHANGES=cweave.ch
  58.  
  59. # Set MCHANGES to wmerge-foo.ch if you need changes to wmerge.w
  60. MCHANGES=wmerge.ch
  61.  
  62. # We keep debugging info around, for fun, but most users don't need it.
  63. # These lists of arguments are specific for CC.  Change, add or delete
  64. # things here to suit your personal conditions.
  65. # The following set of options work for CC 8.00 on HP-UX 8.00.
  66. # The script cpp.sh is a local workaround for HP-UX 8.00 to unprotorize
  67. # the patched source code, i.e., to remove all ANSI-prototypes.
  68. # If you encounter any problems with the prototypes, look for it at
  69. #    ftp.th-darmstadt.de:/pub/programming/languages/c/unproto-1.2.tar.Z
  70. # If your version of HP-UX 8.00 acknowledges the `-Aa' option, delete
  71. # the reference to cpp.sh.
  72. CFLAGS = -g -tp,/usr/local/bin/cpp.sh -I$(CATINCLUDE) \
  73.     -DCWEBINPUTS=\"$(CWEBINPUTS)\"
  74.  
  75. # The following set of options work for CC 9.30 on HP-UX 9.01.
  76. #CFLAGS = -g -Aa -I$(CATINCLUDE) -DCWEBINPUTS=\"$(CWEBINPUTS)\"
  77.  
  78. # The following set of options work for CC and GCC on SunOS 4 and SGI's
  79. # IRIX 4.0.5.  They are standard for many other UNIX-C compilers.
  80. #CFLAGS = -g -I$(CATINCLUDE) -DCWEBINPUTS=\"$(CWEBINPUTS)\"
  81.  
  82. # All linkers tested worked fine with this option.
  83. LINKFLAGS = -g
  84. #LINKFLAGS = -s # for smaller (stripped) executables on many UNIX systems
  85.  
  86. # What C compiler are you using?
  87. CC = cc
  88. MAKE = make
  89.  
  90. # RM and CP are used below in case rm and cp are aliased
  91. RM= /bin/rm
  92. CP= /bin/cp
  93.  
  94. ##########  You shouldn't have to change anything after this point #######
  95.  
  96. CWEAVE = ./cweave
  97. CTANGLE = ./ctangle
  98. WMERGE=./wmerge
  99. SOURCES = cweave.w common.w ctangle.w
  100. ALMOSTALL = common.w ctangle.w wmerge.w makefile readme \
  101.     common.c common.h ctangle.c wmerge.c \
  102.     cwebman.tex cwebmang.ch cweb.1 cweb.man cweb.el prod.w \
  103.     $(CCHANGES) $(CHCHANGES) $(TCHANGES) $(WCHANGES) $(PCHANGES) \
  104.     comm-vms.ch ctang-vms.ch cweav-vms.ch \
  105.     comm-man.ch ctang-man.ch cweav-man.ch \
  106.     makefile.amiga makefile.pc makefile.unix \
  107.     $(MACROSDIR)cwebmac.tex $(MACROSDIR)ccwebmac.tex $(MACROSDIR)gcwebmac.tex \
  108.     $(CATINCLUDE)cweb.h examples
  109. ALL =  $(ALMOSTALL) cweave.w
  110.  
  111. .SUFFIXES: .dvi .tex .w
  112.  
  113. .w.tex:
  114.     $(CWEAVE) $(WFLAGS) $* $*
  115.  
  116. .tex.dvi:    
  117.     tex $<
  118.  
  119. .w.dvi:
  120.     $(MAKE) $*.tex
  121.     $(MAKE) $*.dvi
  122.  
  123. .c.o:
  124.     $(CC) $(CFLAGS) -c $*.c
  125.  
  126. .w.c:
  127.     $(CTANGLE) $* $*
  128.  
  129. .w.o:
  130.     $(MAKE) $*.c
  131.     $(MAKE) $*.o
  132.  
  133. # When you say `make' without any arguments, `make' will jump to this item
  134. default: ctangle cweave
  135.  
  136. # The complete set of files contains the two programs `ctangle' and
  137. # `cweave' plus the program `wmerge', the manuals `cwebman' and `cwebmang'
  138. # and the source documentations.
  139. all: progs docs
  140.  
  141. # The objects of desire
  142. progs: ctangle cweave wmerge
  143.  
  144. cautiously: ctangle
  145.     $(CP) common.c SAVEcommon.c
  146.     $(CTANGLE) common $(CCHANGES)
  147.     diff common.c SAVEcommon.c
  148.     $(RM) SAVEcommon.c
  149.     $(CP) ctangle.c SAVEctangle.c
  150.     $(CTANGLE) ctangle $(TCHANGES)
  151.     diff ctangle.c SAVEctangle.c
  152.     $(RM) SAVEctangle.c
  153.  
  154. SAVEctangle.c:
  155.     $(CP) ctangle.c SAVEctangle.c
  156.  
  157. SAVEcommon.c:
  158.     $(CP) common.c SAVEcommon.c
  159.  
  160. common.c: common.w $(CCHANGES)
  161.     $(CTANGLE) common $(CCHANGES)
  162.  
  163. common.o: common.c $(CATINCLUDE)cweb.h
  164.  
  165. ctangle: ctangle.o common.o
  166.     $(CC) $(LINKFLAGS) -o ctangle ctangle.o common.o 
  167.  
  168. ctangle.c: ctangle.w $(TCHANGES) common.h
  169.     $(CTANGLE) ctangle $(TCHANGES)
  170.  
  171. ctangle.o: ctangle.c $(CATINCLUDE)cweb.h common.h
  172.  
  173. cweave: cweave.o common.o
  174.     $(CC) $(LINKFLAGS) -o cweave cweave.o common.o
  175.  
  176. cweave.c: cweave.w $(WCHANGES) common.h
  177.     $(CTANGLE) cweave $(WCHANGES)
  178.  
  179. cweave.o: cweave.c $(CATINCLUDE)cweb.h common.h
  180.  
  181. wmerge: wmerge.c
  182.     $(CC) $(CFLAGS) -o wmerge wmerge.c $(LINKFLAGS)
  183.  
  184. wmerge.c: wmerge.w $(MCHANGES)
  185.     $(CTANGLE) wmerge $(MCHANGES)
  186.  
  187. # Take a good lecture for bedtime reading
  188. doc: $(SOURCES:.w=.dvi)
  189.  
  190. docs: cwebman.dvi cwebmang.dvi common.dvi ctangle.dvi cweave.dvi wmerge.dvi
  191.  
  192. cwebman.dvi: cwebman.tex
  193. cwebmang.dvi: cwebmang.tex
  194. common.dvi: common.tex
  195. ctangle.dvi: ctangle.tex
  196. cweave.dvi: cweave.tex
  197. wmerge.dvi: wmerge.tex
  198.  
  199. usermanual: cwebmang.dvi
  200.  
  201. fullmanual: usermanual $(SOURCES) comm-man.ch ctang-man.ch cweav-man.ch
  202.     $(MAKE) cweave
  203.     $(CWEAVE) common.w comm-man.ch
  204.     $(MAKE) common.dvi
  205.     $(CWEAVE) ctangle.w ctang-man.ch
  206.     $(MAKE) ctangle.dvi
  207.     $(CWEAVE) cweave.w cweav-man.ch
  208.     $(MAKE) cweave.dvi
  209.  
  210. cwebmang.tex: cwebman.tex cwebmang.ch
  211.     $(WMERGE) cwebman.tex cwebmang.ch cwebmang.tex
  212.  
  213. # for making the documentation we will have to include the change files
  214. ctangle.tex: ctangle.w common.h $(TCHANGES)
  215.     $(CWEAVE) $(WFLAGS) ctangle $(TCHANGES)
  216.  
  217. cweave.tex: cweave.w common.h $(WCHANGES)
  218.     $(CWEAVE) $(WFLAGS) cweave $(WCHANGES)
  219.  
  220. common.tex: common.w $(CCHANGES)
  221.     $(CWEAVE) $(WFLAGS) common $(CCHANGES)
  222.  
  223. wmerge.tex: wmerge.w $(MCHANGES)
  224.     $(CWEAVE) $(WFLAGS) wmerge $(MCHANGES)
  225.  
  226. # be sure to leave ctangle.c and common.c and common.h for bootstrapping
  227. clean:
  228.     $(RM) -f -r *~ *.o common.tex cweave.tex cweave.c ctangle.tex \
  229.     *.log *.dvi *.toc *.idx *.scn core cweave.w.[12] cweave ctangle \
  230.     cwebmang.tex wmerge.tex wmerge
  231.  
  232. # Install the new program versions where they can be found
  233. install: all
  234.     $(CP) cweave $(DESTDIR)$(DESTPREF)weave
  235.     chmod 755 $(DESTDIR)$(DESTPREF)weave
  236.     $(CP) ctangle $(DESTDIR)$(DESTPREF)tangle
  237.     chmod 755 $(DESTDIR)$(DESTPREF)tangle
  238.     $(CP) cweb.1 $(MANDIR)/cweb.$(MANEXT)
  239.     chmod 644 $(MANDIR)/cweb.$(MANEXT)
  240.     $(CP) cwebmac.tex $(MACROSDIR)
  241.     chmod 644 $(MACROSDIR)/cwebmac.tex
  242.     $(CP) cweb.el $(EMACSDIR)
  243.     chmod 644 $(EMACSDIR)/cweb.el
  244.  
  245. bundle: $(ALL)
  246.     sed -n '1,2200 p' cweave.w > cweave.w.1
  247.     sed -n '2201,$$ p' cweave.w > cweave.w.2
  248.     /usr/local/bin/shar -m100000 -c -v -f cweb $(ALMOSTALL) cweave.w.[12]
  249.  
  250. tags: $(ALL)
  251.     etags -z $(ALL)
  252.  
  253. cweb.tar: $(ALL)
  254.     tar cvhf cweb.tar $(ALL)
  255.  
  256. floppy: $(ALL)
  257.     bar cvhf /dev/rfd0 $(ALL)
  258.     bar tvf /dev/rfd0
  259.     eject
  260.