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

  1. # This file, makefile.bcc, is part of CWEBBIN (Version 3.4 [p13].
  2. # It is distributed WITHOUT ANY WARRANTY, express or implied.
  3. #
  4. # Modified for the Borland Turbo C/C++ 3.1 compiler under MS/DOS by
  5. # Andreas Scherer (scherer@genesis.informatik.rwth-aachen.de), July 1994
  6. # Last updated by Andreas Scherer, September 19, 1995
  7.  
  8. # Copyright (C) 1987,1990,1993 Silvio Levy and Donald E. Knuth
  9. #
  10. # The following copyright notice extends to this PC Makefile only,
  11. # not to any part of the original CWEB distribution.
  12. #
  13. # Copyright (C) 1994 Andreas Scherer
  14.  
  15. # Permission is granted to make and distribute verbatim copies of this
  16. # document provided that the copyright notice and this permission notice
  17. # are preserved on all copies.
  18.  
  19. # Permission is granted to copy and distribute modified versions of this
  20. # document under the conditions for verbatim copying, provided that the
  21. # entire resulting derived work is distributed under the terms of a
  22. # permission notice identical to this one.
  23.  
  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 = ./texinputs/
  30.  
  31. # directory for CWEB inputs in @i files
  32. CWEBINPUTS = ./cwebinputs/
  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 = 
  40.  
  41. # destination directory for executables; must end in /
  42. DESTDIR = ./bin/
  43.  
  44. # directory for GNU EMACS Lips code (cweb.el goes here)
  45. EMACSDIR = 
  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. # Compile with symbols.  That way you'll be able to use the debugger if
  85. # you run into trouble.  You can always use tdstrip later, to remove the
  86. # symbols.
  87. DEBUG = -v
  88.  
  89. # Redundant Load Suppression (-Z) is turned off, because it seems to
  90. # break the code.  Likewise for Copy Propagation (-Op).  (These
  91. # optimizations don't seem to cause any problems in common.w, but
  92. # better safe than sorry--compile everything with them turned off.)
  93. OPT = -O2-p -Z- -mc -Ff=5000 -d -w-pro $(DEBUG)
  94.  
  95. # These lists of arguments are specific for BCC.
  96. # Change, add or delete things here to suit your personal conditions.
  97. # Simulate these when setting up `projects'.
  98. CFLAGS = -I$(CATINCLUDE) $(OPT) \
  99.     -DCWEBINPUTS="$(CWEBINPUTS)" -D_DEV_NULL="NUL" -DSEPARATORS=";\\:"
  100. LINKFLAGS = $(CFLAGS)
  101.  
  102. # The `f' flag is turned off to save paper
  103. # The `lX' flag includes Xcwebmac.tex
  104. # The `s' flag displays some statistics
  105. WFLAGS = -f +lX +s
  106. TFLAGS = +s
  107.  
  108. # What C compiler are you using?
  109. CC = bcc
  110. LINK = bcc
  111. MAKE = make
  112.  
  113. # RM and CP are used below in case rm and cp are aliased
  114. RM = del
  115. RMDIR = deltree
  116. CP = copy
  117. INSTALL = copy
  118.  
  119. ##########  You shouldn't have to change anything after this point #######
  120.  
  121. CWEAVE = ./cweave
  122. CTANGLE = ./ctangle
  123. WMERGE = ./wmerge
  124.  
  125. # The following files come from the original CWEB distribution and
  126. # are left completely unmodified.
  127.  
  128. SOURCES = common.w common.h ctangle.w cweave.w prod.w examples/wmerge.w
  129.  
  130. ORIGINAL = $(SOURCES) comm-amiga.ch comm-bs.ch comm-man.ch comm-pc.ch \
  131.     comm-vms.ch common.c ctang-bs.ch ctang-man.ch ctang-pc.ch \
  132.     ctang-vms.ch ctangle.c cweav-bs.ch cweav-man.ch cweav-pc.ch \
  133.     cweav-vms.ch cweb.1 cweb.el cwebmac.tex cwebman.tex Makefile \
  134.     Makefile.bs README comm-os2.ch \
  135.         examples/extex.w examples/kspell.el examples/Makefile \
  136.     examples/oemacs.el examples/oemacs.w examples/README \
  137.     examples/treeprint.w examples/wc.w examples/wc-dos.ch \
  138.     examples/wmerg-pc.ch examples/wmerge.w~ examples/wordtest.w \
  139.     examples/xlib_types.w examples/xview_types.w
  140.  
  141. # The following files make the body of this patched distribution
  142. # of CWEB.
  143.  
  144. PATCH = $(CCHANGES) $(HCHANGES) $(HPATCH) $(TCHANGES) $(WCHANGES) \
  145.     $(MCHANGES) common.$(EXTENSION) ctangle.$(EXTENSION) \
  146.     wmerge.$(EXTENSION) cwebmana.ch README.p13 \
  147.     Makefile.bcc Makefile.sas Makefile.unix
  148.  
  149. AREXX = arexx/*
  150.  
  151. BIN = bin/*
  152.  
  153. EXAMPLES = examples/cct.w examples/commonwords.w examples/extex.ch \
  154.     examples/Makefile.sas examples/matrix.wxx examples/primes.ch \
  155.     examples/primes.w examples/README.p11 examples/sample.w \
  156.     examples/treeprint.ch examples/wc.ch examples/wordtest.ch
  157.  
  158. INCLUDE = cwebinputs/*
  159.  
  160. MACROS = texinputs/*
  161.  
  162. ALL = $(ORIGINAL) $(PATCH) $(AREXX) $(BIN) $(EXAMPLES) $(INCLUDE) $(MACROS)
  163.  
  164. .SUFFIXES: .dvi .tex .w
  165.  
  166. .w.tex:
  167.     $(CWEAVE) $(WFLAGS) $* $*
  168.  
  169. .tex.dvi:       
  170.     tex $<
  171.  
  172. .w.dvi:
  173.     $(MAKE) $*.tex
  174.     $(MAKE) $*.dvi
  175.  
  176. .$(EXTENSION).obj:
  177.     $(CC) $(CFLAGS) -c $*.$(EXTENSION)
  178.  
  179. # When you say `make' without any arguments, `make' will jump to this item
  180. default: ctangle.exe cweave.exe
  181.  
  182. # The complete set of files contains the two programs `ctangle' and
  183. # `cweave' plus the program `wmerge', the manuals `cwebman' and `cwebmana'
  184. # and the source documentations.
  185. all: progs docs
  186.  
  187. # The objects of desire
  188. progs: ctangle.exe cweave.exe wmerge.exe
  189.  
  190. cautiously: $(CTANGLE)
  191.     $(CP) common.$(EXTENSION) SAVEcommon.$(EXTENSION)
  192.     $(CTANGLE) $(TFLAGS) common $(CCHANGES) common.$(EXTENSION)
  193.     diff common.$(EXTENSION) SAVEcommon.$(EXTENSION)
  194.     $(RM) SAVEcommon.$(EXTENSION)
  195.     $(CP) ctangle.$(EXTENSION) SAVEctangle.$(EXTENSION)
  196.     $(CTANGLE) $(TFLAGS) ctangle $(TCHANGES) ctangle.$(EXTENSION)
  197.     diff ctangle.$(EXTENSION) SAVEctangle.$(EXTENSION)
  198.     $(RM) SAVEctangle.$(EXTENSION)
  199.  
  200. SAVEctangle.$(EXTENSION):
  201.     $(CP) ctangle.$(EXTENSION) SAVEctangle.$(EXTENSION)
  202.  
  203. SAVEcommon.$(EXTENSION):
  204.     $(CP) common.$(EXTENSION) SAVEcommon.$(EXTENSION)
  205.  
  206. common.$(EXTENSION): common.w $(CCHANGES)
  207.     $(CTANGLE) $(TFLAGS) common $(CCHANGES) common.$(EXTENSION)
  208.  
  209. common.obj: common.$(EXTENSION) $(CATINCLUDE)cweb.h
  210.  
  211. ctangle.exe: ctangle.obj common.obj
  212.     $(LINK) $(LINKFLAGS) ctangle.obj common.obj
  213.  
  214. ctangle.$(EXTENSION): ctangle.w $(TCHANGES) $(HPATCH)
  215.     $(CTANGLE) $(TFLAGS) ctangle $(TCHANGES) ctangle.$(EXTENSION)
  216.  
  217. ctangle.obj: ctangle.$(EXTENSION) $(CATINCLUDE)cweb.h $(HPATCH)
  218.  
  219. cweave.exe: cweave.obj common.obj
  220.     $(LINK) $(LINKFLAGS) cweave.obj common.obj
  221.  
  222. cweave.$(EXTENSION): cweave.w $(WCHANGES) $(HPATCH)
  223.     $(CTANGLE) $(TFLAGS) cweave $(WCHANGES) cweave.$(EXTENSION)
  224.  
  225. cweave.obj: cweave.$(EXTENSION) $(CATINCLUDE)cweb.h $(HPATCH)
  226.  
  227. wmerge.exe: wmerge.$(EXTENSION)
  228.     $(CC) $(CFLAGS) wmerge.$(EXTENSION)
  229.  
  230. wmerge.$(EXTENSION): examples/wmerge.w $(MCHANGES)
  231.     $(CTANGLE) $(TFLAGS) examples/wmerge $(MCHANGES) wmerge.$(EXTENSION)
  232.  
  233. # Take a good lecture for bedtime reading
  234. docs: cwebman.dvi cwebmana.dvi common.dvi ctangle.dvi cweave.dvi wmerge.dvi
  235.  
  236. cwebman.dvi: cwebman.tex
  237. cwebmana.dvi: cwebmana.tex
  238. common.dvi: common.tex
  239. ctangle.dvi: ctangle.tex
  240. cweave.dvi: cweave.tex
  241. wmerge.dvi: wmerge.tex
  242.  
  243. usermanual: cwebmana.dvi
  244.  
  245. fullmanual: usermanual $(SOURCES) comm-man.ch ctang-man.ch cweav-man.ch
  246.     $(MAKE) cweave
  247.     $(CWEAVE) common.w comm-man.ch
  248.     $(MAKE) common.dvi
  249.     $(CWEAVE) ctangle.w ctang-man.ch
  250.     $(MAKE) ctangle.dvi
  251.     $(CWEAVE) cweave.w cweav-man.ch
  252.     $(MAKE) cweave.dvi
  253.  
  254. cwebmana.tex: cwebman.tex cwebmana.ch
  255.     $(WMERGE) cwebman.tex cwebmana.ch cwebmana.tex
  256.  
  257. # for making the documentation we will have to include the change files
  258. ctangle.tex: ctangle.w $(HPATCH) $(TCHANGES)
  259.     $(CWEAVE) $(WFLAGS) ctangle $(TCHANGES)
  260.  
  261. cweave.tex: cweave.w $(HPATCH) $(WCHANGES)
  262.     $(CWEAVE) $(WFLAGS) cweave $(WCHANGES)
  263.  
  264. common.tex: common.w $(CCHANGES)
  265.     $(CWEAVE) $(WFLAGS) common $(CCHANGES)
  266.  
  267. wmerge.tex: examples/wmerge.w $(MCHANGES)
  268.     $(CWEAVE) $(WFLAGS) examples/wmerge $(MCHANGES)
  269.  
  270. # be sure to leave ctangle.$(EXTENSION) and common.$(EXTENSION)
  271. # and $(HPATCH) for bootstrapping
  272. clean:
  273.     $(RM) *.obj
  274.     $(RM) *.bak
  275.     $(RM) *.log
  276.     $(RM) *.dvi
  277.     $(RM) *.toc
  278.     $(RM) *.idx
  279.     $(RM) *.scn
  280.     $(RM) common.tex 
  281.     $(RM) cweave.tex 
  282.     $(RM) cweave.$(EXTENSION) 
  283.     $(RM) ctangle.tex 
  284.     $(RM) ctangle.exe
  285.     $(RM) cweave.exe
  286.     $(RM) wmerge.exe
  287.     $(RM) cwebmana.tex 
  288.     $(RM) wmerge.tex 
  289.  
  290. # Install the new program versions where they can be found
  291. install: progs
  292.     $(INSTALL) cweave.exe $(DESTDIR)$(DESTPREF)weave.exe
  293.     $(INSTALL) ctangle.exe $(DESTDIR)$(DESTPREF)tangle.exe
  294.     $(INSTALL) wmerge.exe $(DESTDIR)wmerge.exe
  295.  
  296. # Make a shipable archive
  297. cweb.lha:
  298.     lha -x -r u $@ $(ALL)
  299. cwebpatch.lha:
  300.     lha -x -r u $@ $(PATCH)
  301.     lha -x -r u $@ $(AREXX)
  302.     lha -x -r u $@ $(BIN)
  303.     lha -x -r u $@ $(EXAMPLES)
  304.     lha -x -r u $@ $(INCLUDE)
  305.     lha -x -r u $@ $(MACROS)
  306. cweborig.lha:
  307.     lha -x -r u $@ $(ORIGINAL)
  308.  
  309. cweb.tar.gz:
  310.     tar cvf cweb.tar $(ALL)
  311.     gzip cweb.tar
  312.  
  313. # Remove the patch completely
  314. remove: clean
  315.     $(RM) $(CCHANGES)
  316.     $(RM) $(HCHANGES)
  317.     $(RM) $(HPATCH)
  318.     $(RM) $(TCHANGES)
  319.     $(RM) $(WCHANGES)
  320.     $(RM) $(MCHANGES)
  321.     $(RM) common.$(EXTENSION)
  322.     $(RM) ctangle.$(EXTENSION)
  323.     $(RM) wmerge.$(EXTENSION)
  324.     $(RM) cwebmana.ch
  325.     $(RM) README.p13
  326.     $(RM) Makefile.bcc
  327.     $(RM) Makefile.sas
  328.     $(RM) Makefile.unix
  329.     $(RMDIR) arexx
  330.     $(RMDIR) bin
  331.     $(RM) examples/cct.w
  332.     $(RM) examples/commonwords.w
  333.     $(RM) examples/extex.ch
  334.     $(RM) examples/Makefile.sas
  335.     $(RM) examples/matrix.wxx
  336.     $(RM) examples/primes.ch
  337.     $(RM) examples/primes.w
  338.     $(RM) examples/README.p11
  339.     $(RM) examples/sample.w
  340.     $(RM) examples/treeprint.ch
  341.     $(RM) examples/wc.ch
  342.     $(RM) examples/wordtest.ch
  343.     $(RMDIR) cwebinputs
  344.     $(RMDIR) texinputs
  345.  
  346. # End of Makefile.bcc
  347.