home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 2 / FFMCD02.bin / new / dev / misc / cweb / makefile.pc < prev    next >
Makefile  |  1993-12-21  |  4KB  |  171 lines

  1.                                 #-*-Fun-*-
  2. #This file, Makefile, is part of CWEB-p.
  3. #It is intended for Turbo Make 3.6.
  4. #Last updated 24 Jun 1993 (H2B).
  5.  
  6. #Read the README file, then edit this file to reflect local conditions.
  7.  
  8. #Say `make all' to create all executables and the macro package, say
  9. #`make doc' to generate the DVI files. To delete all intermediate files
  10. #created in the make processes say `make clean', to delete even the DVI files
  11. #say `make veryclean'.
  12.  
  13. ROOT=.
  14. SOURCES=$(ROOT)/sources
  15. EXAMPLES=$(ROOT)/examples
  16.  
  17. .path.w=$(SOURCES)
  18.  
  19. .path.ch=$(ROOT)/changes
  20. .path.fix=$(ROOT)/fixes
  21. .path.prv=$(ROOT)/private
  22.  
  23. CC=tcc
  24. !ifdef _priv
  25. CFLAGS=-mh -AT $(CFLAGS)
  26. !else
  27. CFLAGS=-mh -AT
  28. !endif
  29. TEX=tex
  30. TIE=tie
  31. CP=cp
  32. RM=rm -f
  33.  
  34. all:        tangle weave webmac wmerge
  35. tangle:        ctangle.exe
  36. weave:        cweave.exe
  37. common:        common.obj
  38. webmac:        cwebmac.tex
  39. wmerge:        wmerge.exe
  40.  
  41. doc:        man tdoc wdoc cdoc
  42. man:        cwebman.dvi
  43. tdoc:        ctangle.dvi
  44. wdoc:        cweave.dvi
  45. cdoc:        common.dvi
  46.  
  47. # *** Make executables:
  48.  
  49. ctangle.exe:    ctangle.obj common.obj
  50. cweave.exe:    cweave.obj common.obj
  51. ctangle.c:    $(SOURCES)/ctangle.w common.h ctangle.chg
  52. cweave.c:    $(SOURCES)/cweave.w common.h $(ROOT)/prod.w cweave.chg
  53. common.c:    $(SOURCES)/common.w common.chg
  54.  
  55. wmerge.exe:    wmerge.obj
  56.     $(CC) $(CFLAGS) wmerge.obj            #exception
  57. wmerge.c:    $(EXAMPLES)/wmerge.w wmerge.chg
  58.     ctangle $(EXAMPLES)/wmerge.w $&.chg $&.c    #exception
  59.  
  60. .w.c:
  61.     ctangle $< $&.chg $&.c
  62.  
  63. .c.obj:
  64.     $(CC) $(CFLAGS) -c $<
  65.  
  66. .obj.exe:
  67.     $(CC) $(CFLAGS) $< common.obj
  68.  
  69. .c.exe:
  70.     $(CC) $(CFLAGS) $< common.obj
  71.  
  72. # *** Make documentation:
  73.  
  74. ctangle.tex:    $(SOURCES)/ctangle.w common.h ctangle.chg
  75. cweave.tex:    $(SOURCES)/cweave.w common.h $(ROOT)/prod.w cweave.chg
  76. common.tex:    $(SOURCES)/common.w common.chg
  77.  
  78. cwebman.dvi:    $(SOURCES)/cwebman.tex
  79.     $(TEX) $**
  80.  
  81. cweb.man:    $(SOURCES)/cweb.1
  82.       cawf -dNONE -man $** > $<
  83.  
  84. .w.tex:
  85.     cweave $< $&.chg $&.tex
  86.  
  87. .tex.dvi:
  88.     $(TEX) $<
  89.  
  90. # *** Make change and include files:
  91.  
  92. #The files from the changes directory are always included. The files from the
  93. #fixes and private directories are in included when the symbols _fix or
  94. #_priv are defined (the latter implies the former). Note that the fixes and
  95. #private directories are not part of the public distribution, but you may want
  96. #to create them for your own change files.
  97.  
  98. DEP=
  99. !ifdef _priv
  100. DEP=$(.path.prv)/xxx.prv
  101. _fix=1
  102. !endif
  103. !ifdef _fix
  104. DEP=$(.path.fix)/xxx.fix $(DEP)
  105. !endif
  106. DEP=$(.path.ch)/xxx.ch $(DEP)
  107.  
  108. aux:        changes includes
  109. changes:    common.chg ctangle.chg cweave.chg wmerge.chg
  110. includes:    common.h $(ROOT)/prod.w cwebmac.tex
  111.  
  112. common.chg:    $(SOURCES)/common.w $(DEP:xxx=common)
  113. !ifdef _fix
  114.     $(TIE) -c $< $(SOURCES)/common.w $(DEP:xxx=common)
  115. !else
  116.     $(CP) $(DEP:xxx=common) $<
  117. !endif
  118.  
  119. ctangle.chg:    $(SOURCES)/ctangle.w $(DEP:xxx=ctangle)
  120. !ifdef _fix
  121.     $(TIE) -c $< $(SOURCES)/ctangle.w $(DEP:xxx=ctangle)
  122. !else
  123.     $(CP) $(DEP:xxx=ctangle) $<
  124. !endif
  125.  
  126. cweave.chg:    $(SOURCES)/cweave.w $(DEP:xxx=cweave)
  127. !ifdef _fix
  128.     $(TIE) -c $< $(SOURCES)/cweave.w $(DEP:xxx=cweave)
  129. !else
  130.     $(CP) $(DEP:xxx=cweave) $<
  131. !endif
  132.  
  133. wmerge.chg:    $(EXAMPLES)/wmerge.w $(DEP:xxx=wmerge)
  134. !ifdef _fix
  135.     $(TIE) -c $< $(EXAMPLES)/wmerge.w $(DEP:xxx=wmerge)
  136. !else
  137.     $(CP) $(DEP:xxx=wmerge) $<
  138. !endif
  139.  
  140. common.h:    $(SOURCES)/common.h $(DEP:xxx=common-h)
  141. !ifdef _fix
  142.     $(TIE) -m $< $(SOURCES)/common.h $(DEP:xxx=common-h)
  143. !else
  144.     wmerge $(SOURCES)/common.h $(DEP:xxx=common-h) > $<
  145. !endif
  146.  
  147. $(ROOT)/prod.w:    $(SOURCES)/prod.w $(DEP:xxx=prod)
  148. !ifdef _fix
  149.     $(TIE) -m $< $(SOURCES)/prod.w $(DEP:xxx=prod)
  150. !else
  151.     wmerge $(SOURCES)/prod.w $(DEP:xxx=prod) > $<
  152. !endif
  153.  
  154. cwebmac.tex:    $(SOURCES)/cwebmac.tex $(DEP:xxx=cwebmac)
  155. !ifdef _fix
  156.     $(TIE) -m $< $(SOURCES)/cwebmac.tex $(DEP:xxx=cwebmac)
  157. !else
  158.     wmerge $(SOURCES)/cwebmac.tex $(DEP:xxx=cwebmac) > $<
  159. !endif
  160.  
  161. # *** Delete intermediate files:
  162.  
  163. clean:
  164.     $(RM) *.~
  165.     $(RM) common.h common.chg ctangle.chg cweave.chg prod.w wmerge.chg
  166.     $(RM) cweave.c *.obj
  167.     $(RM) common.tex ctangle.tex cweave.tex *.log *.toc *.idx *.scn
  168.  
  169. veryclean: clean
  170.     $(RM) *.dvi
  171.