home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 3 / goldfish_volume_3.bin / files / dev / c / cweb / makefile.unix < prev    next >
Encoding:
Makefile  |  1994-12-03  |  8.8 KB  |  279 lines

  1. # This file, makefile.unix, is part of CWEB (Version 3.3 [p11]).
  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 (scherer@genesis.informatik.rwth-aachen.de)
  6. # August 12, 1994.  Other UNIX compilers like c89 or gcc can work with this
  7. # file as well.  Last updated by Andreas Scherer, December 3, 1994.
  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 and (X|d|i)cwebmac.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. # Set EXTENSION to either `c' if you want to treat CWEB as a system
  63. # of ordinary ANSI-C programs, or to `cc', `cxx', `cpp' or similar
  64. # if you want to treat CWEB as a system of C++ programs.  Your
  65. # compiler should be able to distinguish between the two forms
  66. # according to the source file extension.  Even with ANSI-C programs
  67. # it is strongly recommended to use C++ compilers, because of the
  68. # much stricter checking of type conversions and module interfaces.
  69. # For highest portability, all of the extra features of C++ are
  70. # avoided in the CWEB system.
  71. EXTENSION=cc
  72.  
  73. # We keep debugging info around, for fun, but most users don't need it.
  74. # These lists of arguments are specific for CC.  Change, add or delete
  75. # things here to suit your personal conditions.
  76. # The following set of options work for CC 8.00 on HP-UX 8.00.
  77. # The script cpp.sh is a local workaround for HP-UX 8.00 to unprotorize
  78. # the patched source code, i.e., to remove all ANSI-prototypes.
  79. # If you encounter any problems with the prototypes, look for it at
  80. #    ftp.th-darmstadt.de:/pub/programming/languages/c/unproto-1.2.tar.Z
  81. # If your version of HP-UX 8.00 acknowledges the `-Aa' option, delete
  82. # the reference to cpp.sh.
  83. #CFLAGS = -g -tp,/usr/local/bin/cpp.sh -I$(CATINCLUDE) \
  84. #    -DCWEBINPUTS=\"$(CWEBINPUTS)\"
  85.  
  86. # The following set of options work for CC 9.30 on HP-UX 9.01.
  87. #CFLAGS = -g -Aa -I$(CATINCLUDE) -DCWEBINPUTS=\"$(CWEBINPUTS)\"
  88.  
  89. # The following set of options work for CC and GCC on SunOS 4 and SGI's
  90. # IRIX 4.0.5 and DEC's Ultrix 4.2.
  91. # They are standard for many other UNIX-C compilers.
  92. CFLAGS = -O2 -I$(CATINCLUDE) -DCWEBINPUTS=\"$(CWEBINPUTS)\"
  93.  
  94. # All linkers tested worked fine with this option.
  95. #LINKFLAGS = -g
  96. LINKFLAGS = -s # for smaller (stripped) executables on many UNIX systems
  97.  
  98. # The `f' flag is turned off to save paper
  99. # The `lX' flag includes Xcwebmac.tex
  100. # The `s' flag displays some statistics
  101. WFLAGS=-f +lX +s
  102. TFLAGS=+s
  103.  
  104. # What C compiler are you using?
  105. CC = gcc # cc
  106. MAKE = make
  107.  
  108. # RM and CP are used below in case rm and cp are aliased
  109. RM= /bin/rm
  110. CP= /bin/cp
  111.  
  112. ##########  You shouldn't have to change anything after this point #######
  113.  
  114. CWEAVE = ./cweave
  115. CTANGLE = ./ctangle
  116. WMERGE=./wmerge
  117. SOURCES = cweave.w common.w ctangle.w
  118. ALMOSTALL = common.w ctangle.w wmerge.w makefile readme common.h \
  119.     common.$(EXTENSION) ctangle.$(EXTENSION) wmerge.$(EXTENSION) \
  120.     cwebman.tex cwebmana.ch cweb.1 cweb.man cweb.el prod.w \
  121.     $(CCHANGES) $(CHCHANGES) $(TCHANGES) $(WCHANGES) $(PCHANGES) \
  122.     comm-vms.ch ctang-vms.ch cweav-vms.ch \
  123.     comm-man.ch ctang-man.ch cweav-man.ch \
  124.     makefile.amiga makefile.pc makefile.unix \
  125.     $(MACROSDIR)cwebmac.tex $(MACROSDIR)Xcwebmac.tex \
  126.     $(MACROSDIR)dcwebmac.tex $(MACROSDIR)icwebmac.tex \
  127.     $(CATINCLUDE)cweb.h $(CATINCLUDE)dcweb.h $(CATINCLUDE)icweb.h \
  128.     examples
  129. ALL =  $(ALMOSTALL) cweave.w
  130.  
  131. .SUFFIXES: .dvi .tex .w
  132.  
  133. .w.tex:
  134.     $(CWEAVE) $(WFLAGS) $* $*
  135.  
  136. .tex.dvi:    
  137.     tex $<
  138.  
  139. .w.dvi:
  140.     $(MAKE) $*.tex
  141.     $(MAKE) $*.dvi
  142.  
  143. .$(EXTENSION).o:
  144.     $(CC) $(CFLAGS) -c $*.$(EXTENSION)
  145.  
  146. .w.o:
  147.     $(MAKE) $*.$(EXTENSION)
  148.     $(MAKE) $*.o
  149.  
  150. # When you say `make' without any arguments, `make' will jump to this item
  151. default: ctangle cweave
  152.  
  153. # The complete set of files contains the two programs `ctangle' and
  154. # `cweave' plus the program `wmerge', the manuals `cwebman' and `cwebmana'
  155. # and the source documentations.
  156. all: progs docs
  157.  
  158. # The objects of desire
  159. progs: ctangle cweave wmerge
  160.  
  161. cautiously: ctangle
  162.     $(CP) common.$(EXTENSION) SAVEcommon.$(EXTENSION)
  163.     $(CTANGLE) $(TFLAGS) common $(CCHANGES) common.$(EXTENSION)
  164.     diff common.$(EXTENSION) SAVEcommon.$(EXTENSION)
  165.     $(RM) SAVEcommon.$(EXTENSION)
  166.     $(CP) ctangle.$(EXTENSION) SAVEctangle.$(EXTENSION)
  167.     $(CTANGLE) $(TFLAGS) ctangle $(TCHANGES) ctangle.$(EXTENSION)
  168.     diff ctangle.$(EXTENSION) SAVEctangle.$(EXTENSION)
  169.     $(RM) SAVEctangle.$(EXTENSION)
  170.  
  171. SAVEctangle.$(EXTENSION):
  172.     $(CP) ctangle.$(EXTENSION) SAVEctangle.$(EXTENSION)
  173.  
  174. SAVEcommon.$(EXTENSION):
  175.     $(CP) common.$(EXTENSION) SAVEcommon.$(EXTENSION)
  176.  
  177. common.$(EXTENSION): common.w $(CCHANGES)
  178.     $(CTANGLE) $(TFLAGS) common $(CCHANGES) common.$(EXTENSION)
  179.  
  180. common.o: common.$(EXTENSION) $(CATINCLUDE)cweb.h
  181.  
  182. ctangle: ctangle.o common.o
  183.     $(CC) $(LINKFLAGS) -o ctangle ctangle.o common.o 
  184.  
  185. ctangle.$(EXTENSION): ctangle.w $(TCHANGES) common.h
  186.     $(CTANGLE) $(TFLAGS) ctangle $(TCHANGES) ctangle.$(EXTENSION)
  187.  
  188. ctangle.o: ctangle.$(EXTENSION) $(CATINCLUDE)cweb.h common.h
  189.  
  190. cweave: cweave.o common.o
  191.     $(CC) $(LINKFLAGS) -o cweave cweave.o common.o
  192.  
  193. cweave.$(EXTENSION): cweave.w $(WCHANGES) common.h
  194.     $(CTANGLE) $(TFLAGS) cweave $(WCHANGES) cweave.$(EXTENSION)
  195.  
  196. cweave.o: cweave.$(EXTENSION) $(CATINCLUDE)cweb.h common.h
  197.  
  198. wmerge: wmerge.$(EXTENSION)
  199.     $(CC) $(CFLAGS) -o wmerge wmerge.$(EXTENSION) $(LINKFLAGS)
  200.  
  201. wmerge.$(EXTENSION): wmerge.w $(MCHANGES)
  202.     $(CTANGLE) $(TFLAGS) wmerge $(MCHANGES) wmerge.$(EXTENSION)
  203.  
  204. # Take a good lecture for bedtime reading
  205. doc: $(SOURCES:.w=.dvi)
  206.  
  207. docs: cwebman.dvi cwebmana.dvi common.dvi ctangle.dvi cweave.dvi wmerge.dvi
  208.  
  209. cwebman.dvi: cwebman.tex
  210. cwebmana.dvi: cwebmana.tex
  211. common.dvi: common.tex
  212. ctangle.dvi: ctangle.tex
  213. cweave.dvi: cweave.tex
  214. wmerge.dvi: wmerge.tex
  215.  
  216. usermanual: cwebmana.dvi
  217.  
  218. fullmanual: usermanual $(SOURCES) comm-man.ch ctang-man.ch cweav-man.ch
  219.     $(MAKE) cweave
  220.     $(CWEAVE) common.w comm-man.ch
  221.     $(MAKE) common.dvi
  222.     $(CWEAVE) ctangle.w ctang-man.ch
  223.     $(MAKE) ctangle.dvi
  224.     $(CWEAVE) cweave.w cweav-man.ch
  225.     $(MAKE) cweave.dvi
  226.  
  227. cwebmana.tex: cwebman.tex cwebmana.ch
  228.     $(WMERGE) cwebman.tex cwebmana.ch cwebmana.tex
  229.  
  230. # for making the documentation we will have to include the change files
  231. ctangle.tex: ctangle.w common.h $(TCHANGES)
  232.     $(CWEAVE) $(WFLAGS) ctangle $(TCHANGES)
  233.  
  234. cweave.tex: cweave.w common.h $(WCHANGES)
  235.     $(CWEAVE) $(WFLAGS) cweave $(WCHANGES)
  236.  
  237. common.tex: common.w $(CCHANGES)
  238.     $(CWEAVE) $(WFLAGS) common $(CCHANGES)
  239.  
  240. wmerge.tex: wmerge.w $(MCHANGES)
  241.     $(CWEAVE) $(WFLAGS) wmerge $(MCHANGES)
  242.  
  243. # be sure to leave ctangle.$(EXTENSION) and common.$(EXTENSION)
  244. # and common.h for bootstrapping
  245. clean:
  246.     $(RM) -f -r *~ *.o common.tex cweave.tex cweave.$(EXTENSION) \
  247.     ctangle.tex *.log *.dvi *.toc *.idx *.scn core cweave.w.[12] \
  248.     cweave ctangle cwebmana.tex wmerge.tex wmerge
  249.  
  250. # Install the new program versions where they can be found
  251. install: all
  252.     $(CP) cweave $(DESTDIR)$(DESTPREF)weave
  253.     chmod 755 $(DESTDIR)$(DESTPREF)weave
  254.     $(CP) ctangle $(DESTDIR)$(DESTPREF)tangle
  255.     chmod 755 $(DESTDIR)$(DESTPREF)tangle
  256.     $(CP) cweb.1 $(MANDIR)/cweb.$(MANEXT)
  257.     chmod 644 $(MANDIR)/cweb.$(MANEXT)
  258.     $(CP) cwebmac.tex $(MACROSDIR)
  259.     chmod 644 $(MACROSDIR)/cwebmac.tex
  260.     $(CP) cweb.el $(EMACSDIR)
  261.     chmod 644 $(EMACSDIR)/cweb.el
  262.  
  263. bundle: $(ALL)
  264.     sed -n '1,2200 p' cweave.w > cweave.w.1
  265.     sed -n '2201,$$ p' cweave.w > cweave.w.2
  266.     /usr/local/bin/shar -m100000 -c -v -f cweb $(ALMOSTALL) cweave.w.[12]
  267.  
  268. tags: $(ALL)
  269.     etags -z $(ALL)
  270.  
  271. cweb.tar: $(ALL)
  272.     tar cvhf cweb.tar $(ALL)
  273.  
  274. floppy: $(ALL)
  275.     bar cvhf /dev/rfd0 $(ALL)
  276.     bar tvf /dev/rfd0
  277.     eject
  278.