home *** CD-ROM | disk | FTP | other *** search
/ Dream 57 / Amiga_Dream_57.iso / Amiga / Programmation / c / Docs / cwebbin-p13.lha / cwebbin-p13 / Makefile.unix < prev    next >
Encoding:
Makefile  |  1995-09-19  |  10.5 KB  |  333 lines

  1. # This file, makefile.unix, is part of CWEBBIN (Version 3.4 [p13]).
  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, September 19, 1995.
  8.  
  9. # Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
  10. #
  11. # The following copyright notice extends to the changes in this Makefile
  12. # only, not to any part of the original CWEB distribution.
  13. #
  14. # Copyright (C) 1994 Andreas Scherer
  15.  
  16. # Permission is granted to make and distribute verbatim copies of this
  17. # document provided that the copyright notice and this permission notice
  18. # are preserved on all copies.
  19.  
  20. # Permission is granted to copy and distribute modified versions of this
  21. # document under the conditions for verbatim copying, provided that the
  22. # entire resulting derived work is distributed under the terms of a
  23. # permission notice identical to this one.
  24.  
  25. # Read the README file, then edit this file to reflect local conditions
  26. #
  27.  
  28. # directory for TeX inputs (cwebmac.tex and (X|d|i)cwebmac.tex go here)
  29. MACROSDIR = /usr/local/lib/tex/inputs
  30.  
  31. # directory for CWEB inputs in @i files
  32. CWEBINPUTS = /usr/local/lib/cweb
  33.  
  34. # extension for manual pages ("l" distinguishes local from system stuff)
  35. MANEXT = l
  36. #MANEXT = 1
  37.  
  38. # directory for manual pages (cweb.1 goes here)
  39. MANDIR = /usr/man/man$(MANEXT)
  40.  
  41. # destination directory for executables; must end in /
  42. DESTDIR = /usr/local/bin/
  43.  
  44. # directory for GNU EMACS Lisp code (cweb.el goes here)
  45. EMACSDIR = /usr/local/emacs/lisp
  46.  
  47. # directory for the language header file "cweb.h"
  48. CATINCLUDE = ./bin/catalogs/
  49.  
  50. # Set DESTPREF to null if you want to call the executables "tangle" and "weave"
  51. # (probably NOT a good idea; we recommend leaving DESTPREF = c)
  52. DESTPREF = c
  53.  
  54. # Set CCHANGES to comm-foo.ch if you need changes to common.w
  55. CCHANGES = comm-p13.ch
  56.  
  57. # Set HCHANGES to comm-foo.hch if you need changes to common.h
  58. HCHANGES = comm-p13.hch
  59.  
  60. # Set HPATCH to comm-foo.h if you apply changes to common.h
  61. # default should be common.h
  62. HPATCH = comm-p13.h
  63.  
  64. # Set TCHANGES to ctang-foo.ch if you need changes to ctangle.w
  65. TCHANGES = ctang-p13.ch
  66.  
  67. # Set WCHANGES to cweav-foo.ch if you need changes to cweave.w
  68. WCHANGES = cweav-p13.ch
  69.  
  70. # Set MCHANGES to wmerge-foo.ch if you need changes to wmerge.w
  71. MCHANGES = wmerg-p13.ch
  72.  
  73. # Set EXTENSION to either `c' if you want to treat CWEB as a system
  74. # of ordinary ANSI-C programs, or to `cc', `cxx', `cpp' or similar
  75. # if you want to treat CWEB as a system of C++ programs.  Your
  76. # compiler should be able to distinguish between the two forms
  77. # according to the source file extension.  Even with ANSI-C programs
  78. # it is strongly recommended to use C++ compilers, because of the
  79. # much stricter checking of type conversions and module interfaces.
  80. # For highest portability, all of the extra features of C++ are
  81. # avoided in the CWEB system, thus using something like C--.
  82. EXTENSION = cxx
  83.  
  84. # We keep debugging info around, for fun, but most users don't need it.
  85. # These lists of arguments are specific for CC and GCC.  Change, add or
  86. # delete things here to suit your personal conditions.
  87.  
  88. # This list of options works for all UNIX compilers tested.
  89. OPT = -g -I$(CATINCLUDE) -DCWEBINPUTS=\"$(CWEBINPUTS)\"
  90.  
  91. # The following set of options work for CC 8.00 on HP-UX 8.00.
  92. # The script cpp.sh is a local workaround for HP-UX 8.00 to unprotorize
  93. # the patched source code, i.e., to remove all ANSI-prototypes.
  94. # If you encounter any problems with the prototypes, look for it at
  95. #    ftp.th-darmstadt.de:/pub/programming/languages/c/unproto-1.2.tar.Z
  96. # If your version of HP-UX 8.00 acknowledges the `-Aa' option, delete
  97. # the reference to cpp.sh.
  98. #CFLAGS = $(OPT) -tp,/usr/local/bin/cpp.sh
  99.  
  100. # The following set of options work for CC 9.30 on HP-UX 9.01.
  101. #CFLAGS = $(OPT) -Aa
  102.  
  103. # SunOS 4 has no `EXIT_FAILURE' or `EXIT_SUCCESS' in <stdlib.h>.
  104. #CFLAGS = $(OPT) -DEXIT_FAILURE=20L
  105.  
  106. # SGI's IRIX 4.0.5 and DEC's Ultrix 4.4 don't need special treatment.
  107. CFLAGS = $(OPT)
  108.  
  109. # All linkers tested worked fine with this option.
  110. LINKFLAGS = -g
  111. #LINKFLAGS = -s # for smaller (stripped) executables on many UNIX systems
  112.  
  113. # The `f' flag is turned off to save paper
  114. # The `lX' flag includes Xcwebmac.tex
  115. # The `s' flag displays some statistics
  116. WFLAGS = -f +lX +s
  117. TFLAGS = +s
  118.  
  119. # What C compiler are you using?
  120. CC = cc # gcc
  121. MAKE = make
  122.  
  123. # RM and CP are used below in case rm and cp are aliased
  124. RM = /bin/rm
  125. CP = /bin/cp
  126.  
  127. ##########  You shouldn't have to change anything after this point #######
  128.  
  129. CWEAVE = ./cweave
  130. CTANGLE = ./ctangle
  131. WMERGE = ./wmerge
  132.  
  133. # The following files come from the original CWEB distribution and
  134. # are completely unmodified.
  135.  
  136. SOURCES = common.w common.h ctangle.w cweave.w prod.w examples/wmerge.w
  137.  
  138. ORIGINAL = $(SOURCES) comm-amiga.ch comm-bs.ch comm-man.ch comm-pc.ch \
  139.     comm-vms.ch common.c ctang-bs.ch ctang-man.ch ctang-pc.ch \
  140.     ctang-vms.ch ctangle.c cweav-bs.ch cweav-man.ch cweav-pc.ch \
  141.     cweav-vms.ch cweb.1 cweb.el cwebmac.tex cwebman.tex Makefile \
  142.     Makefile.bs README comm-os2.ch \
  143.         examples/extex.w examples/kspell.el examples/Makefile \
  144.     examples/oemacs.el examples/oemacs.w examples/README \
  145.     examples/treeprint.w examples/wc.w examples/wc-dos.ch \
  146.     examples/wmerg-pc.ch examples/wmerge.w~ examples/wordtest.w \
  147.     examples/xlib_types.w examples/xview_types.w
  148.  
  149. # The following files make the body of this patched distribution
  150. # of CWEB.
  151.  
  152. PATCH = $(CCHANGES) $(HCHANGES) $(HPATCH) $(TCHANGES) $(WCHANGES) \
  153.     $(MCHANGES) common.$(EXTENSION) ctangle.$(EXTENSION) \
  154.     wmerge.$(EXTENSION) cwebmana.ch README.p13 \
  155.     Makefile.bcc Makefile.sas Makefile.unix
  156.  
  157. AREXX = arexx/*
  158.  
  159. BIN = bin/*
  160.  
  161. EXAMPLES = examples/cct.w examples/commonwords.w examples/extex.ch \
  162.     examples/Makefile.sas examples/matrix.wxx examples/primes.ch \
  163.     examples/primes.w examples/README.p11 examples/sample.w \
  164.     examples/treeprint.ch examples/wc.ch examples/wordtest.ch
  165.  
  166. INCLUDE = cwebinputs/*
  167.  
  168. MACROS = texinputs/*
  169.  
  170. ALL = $(ORIGINAL) $(PATCH) $(AREXX) $(BIN) $(EXAMPLES) $(INCLUDE) $(MACROS)
  171.  
  172. .SUFFIXES: .dvi .tex .w
  173.  
  174. .w.tex:
  175.     $(CWEAVE) $(WFLAGS) $* $*
  176.  
  177. .tex.dvi:    
  178.     tex $<
  179.  
  180. .w.dvi:
  181.     $(MAKE) $*.tex
  182.     $(MAKE) $*.dvi
  183.  
  184. .$(EXTENSION).o:
  185.     $(CC) $(CFLAGS) -c $*.$(EXTENSION)
  186.  
  187. .w.o:
  188.     $(MAKE) $*.$(EXTENSION)
  189.     $(MAKE) $*.o
  190.  
  191. # When you say `make' without any arguments, `make' will jump to this item
  192. default: ctangle cweave
  193.  
  194. # The complete set of files contains the two programs `ctangle' and
  195. # `cweave' plus the program `wmerge', the manuals `cwebman' and `cwebmana'
  196. # and the source documentations.
  197. all: progs docs
  198.  
  199. # The objects of desire
  200. progs: ctangle cweave wmerge
  201.  
  202. cautiously: ctangle
  203.     $(CP) common.$(EXTENSION) SAVEcommon.$(EXTENSION)
  204.     $(CTANGLE) $(TFLAGS) common $(CCHANGES) common.$(EXTENSION)
  205.     diff common.$(EXTENSION) SAVEcommon.$(EXTENSION)
  206.     $(RM) SAVEcommon.$(EXTENSION)
  207.     $(CP) ctangle.$(EXTENSION) SAVEctangle.$(EXTENSION)
  208.     $(CTANGLE) $(TFLAGS) ctangle $(TCHANGES) ctangle.$(EXTENSION)
  209.     diff ctangle.$(EXTENSION) SAVEctangle.$(EXTENSION)
  210.     $(RM) SAVEctangle.$(EXTENSION)
  211.  
  212. SAVEctangle.$(EXTENSION):
  213.     $(CP) ctangle.$(EXTENSION) SAVEctangle.$(EXTENSION)
  214.  
  215. SAVEcommon.$(EXTENSION):
  216.     $(CP) common.$(EXTENSION) SAVEcommon.$(EXTENSION)
  217.  
  218. common.$(EXTENSION): common.w $(CCHANGES)
  219.     $(CTANGLE) $(TFLAGS) common $(CCHANGES) common.$(EXTENSION)
  220.  
  221. common.o: common.$(EXTENSION) $(CATINCLUDE)cweb.h
  222.  
  223. ctangle: ctangle.o common.o
  224.     $(CC) $(LINKFLAGS) -o ctangle ctangle.o common.o 
  225.  
  226. ctangle.$(EXTENSION): ctangle.w $(TCHANGES) $(HPATCH)
  227.     $(CTANGLE) $(TFLAGS) ctangle $(TCHANGES) ctangle.$(EXTENSION)
  228.  
  229. ctangle.o: ctangle.$(EXTENSION) $(CATINCLUDE)cweb.h $(HPATCH)
  230.  
  231. cweave: cweave.o common.o
  232.     $(CC) $(LINKFLAGS) -o cweave cweave.o common.o
  233.  
  234. cweave.$(EXTENSION): cweave.w $(WCHANGES) $(HPATCH)
  235.     $(CTANGLE) $(TFLAGS) cweave $(WCHANGES) cweave.$(EXTENSION)
  236.  
  237. cweave.o: cweave.$(EXTENSION) $(CATINCLUDE)cweb.h $(HPATCH)
  238.  
  239. wmerge: wmerge.$(EXTENSION)
  240.     $(CC) $(CFLAGS) -o wmerge wmerge.$(EXTENSION) $(LINKFLAGS)
  241.  
  242. wmerge.$(EXTENSION): examples/wmerge.w $(MCHANGES)
  243.     $(CTANGLE) $(TFLAGS) examples/wmerge $(MCHANGES) wmerge.$(EXTENSION)
  244.  
  245. # Take a good lecture for bedtime reading
  246. doc: $(SOURCES:.w=.dvi)
  247.  
  248. docs: cwebman.dvi cwebmana.dvi common.dvi ctangle.dvi cweave.dvi wmerge.dvi
  249.  
  250. cwebman.dvi: cwebman.tex
  251. cwebmana.dvi: cwebmana.tex
  252. common.dvi: common.tex
  253. ctangle.dvi: ctangle.tex
  254. cweave.dvi: cweave.tex
  255. wmerge.dvi: wmerge.tex
  256.  
  257. usermanual: cwebmana.dvi
  258.  
  259. fullmanual: usermanual $(SOURCES) comm-man.ch ctang-man.ch cweav-man.ch
  260.     $(MAKE) cweave
  261.     $(CWEAVE) common.w comm-man.ch
  262.     $(MAKE) common.dvi
  263.     $(CWEAVE) ctangle.w ctang-man.ch
  264.     $(MAKE) ctangle.dvi
  265.     $(CWEAVE) cweave.w cweav-man.ch
  266.     $(MAKE) cweave.dvi
  267.  
  268. cwebmana.tex: cwebman.tex cwebmana.ch
  269.     $(WMERGE) cwebman.tex cwebmana.ch cwebmana.tex
  270.  
  271. # for making the documentation we will have to include the change files
  272. ctangle.tex: ctangle.w $(HPATCH) $(TCHANGES)
  273.     $(CWEAVE) $(WFLAGS) ctangle $(TCHANGES)
  274.  
  275. cweave.tex: cweave.w $(HPATCH) $(WCHANGES)
  276.     $(CWEAVE) $(WFLAGS) cweave $(WCHANGES)
  277.  
  278. common.tex: common.w $(CCHANGES)
  279.     $(CWEAVE) $(WFLAGS) common $(CCHANGES)
  280.  
  281. wmerge.tex: examples/wmerge.w $(MCHANGES)
  282.     $(CWEAVE) $(WFLAGS) examples/wmerge $(MCHANGES)
  283.  
  284. # be sure to leave ctangle.$(EXTENSION) and common.$(EXTENSION)
  285. # and $(HPATCH) for bootstrapping
  286. clean:
  287.     $(RM) -f -r *~ *.o common.tex cweave.tex cweave.$(EXTENSION) \
  288.     ctangle.tex *.log *.dvi *.toc *.idx *.scn core cweave.w.[12] \
  289.     cweave ctangle cwebmana.tex wmerge.tex wmerge
  290.  
  291. # Install the new program versions where they can be found
  292. install: all
  293.     $(CP) cweave $(DESTDIR)$(DESTPREF)weave
  294.     chmod 755 $(DESTDIR)$(DESTPREF)weave
  295.     $(CP) ctangle $(DESTDIR)$(DESTPREF)tangle
  296.     chmod 755 $(DESTDIR)$(DESTPREF)tangle
  297.     $(CP) cweb.1 $(MANDIR)/cweb.$(MANEXT)
  298.     chmod 644 $(MANDIR)/cweb.$(MANEXT)
  299.     $(CP) cwebmac.tex $(MACROSDIR)
  300.     chmod 644 $(MACROSDIR)/cwebmac.tex
  301.     $(CP) cweb.el $(EMACSDIR)
  302.     chmod 644 $(EMACSDIR)/cweb.el
  303.  
  304. bundle: $(ALL)
  305.     /usr/local/bin/shar -m100000 -c -v -f cweb $(ALL)
  306.  
  307. tags: $(ALL)
  308.     etags -z $(ALL)
  309.  
  310. cweb.tar: $(ALL)
  311.     tar cvhf cweb.tar $(ALL)
  312.  
  313. floppy: $(ALL)
  314.     bar cvhf /dev/rfd0 $(ALL)
  315.     bar tvf /dev/rfd0
  316.     eject
  317.  
  318. # Remove the patch completely
  319. remove: clean
  320.     $(RM) $(CCHANGES) $(HCHANGES) $(HPATCH) $(TCHANGES) $(WCHANGES) $(MCHANGES)
  321.     $(RM) common.$(EXTENSION) ctangle.$(EXTENSION) wmerge.$(EXTENSION)
  322.     $(RM) cwebmana.ch README.p13
  323.     $(RM) Makefile.bcc Makefile.sas Makefile.unix
  324.     $(RM) -r arexx bin
  325.     $(RM) examples/cct.w examples/commonwords.w examples/extex.ch
  326.     $(RM) examples/Makefile.sas examples/matrix.wxx examples/primes.ch
  327.     $(RM) examples/primes.w examples/README.p11 examples/sample.w
  328.     $(RM) examples/treeprint.ch examples/wc.ch examples/wordtest.ch
  329.     $(RM) -r cwebinputs texinputs
  330.  
  331. # End of Makefile.unix
  332.