home *** CD-ROM | disk | FTP | other *** search
Makefile | 1993-12-21 | 3.8 KB | 171 lines |
- #-*-Fun-*-
- #This file, Makefile, is part of CWEB-p.
- #It is intended for Turbo Make 3.6.
- #Last updated 24 Jun 1993 (H2B).
-
- #Read the README file, then edit this file to reflect local conditions.
-
- #Say `make all' to create all executables and the macro package, say
- #`make doc' to generate the DVI files. To delete all intermediate files
- #created in the make processes say `make clean', to delete even the DVI files
- #say `make veryclean'.
-
- ROOT=.
- SOURCES=$(ROOT)/sources
- EXAMPLES=$(ROOT)/examples
-
- .path.w=$(SOURCES)
-
- .path.ch=$(ROOT)/changes
- .path.fix=$(ROOT)/fixes
- .path.prv=$(ROOT)/private
-
- CC=tcc
- !ifdef _priv
- CFLAGS=-mh -AT $(CFLAGS)
- !else
- CFLAGS=-mh -AT
- !endif
- TEX=tex
- TIE=tie
- CP=cp
- RM=rm -f
-
- all: tangle weave webmac wmerge
- tangle: ctangle.exe
- weave: cweave.exe
- common: common.obj
- webmac: cwebmac.tex
- wmerge: wmerge.exe
-
- doc: man tdoc wdoc cdoc
- man: cwebman.dvi
- tdoc: ctangle.dvi
- wdoc: cweave.dvi
- cdoc: common.dvi
-
- # *** Make executables:
-
- ctangle.exe: ctangle.obj common.obj
- cweave.exe: cweave.obj common.obj
- ctangle.c: $(SOURCES)/ctangle.w common.h ctangle.chg
- cweave.c: $(SOURCES)/cweave.w common.h $(ROOT)/prod.w cweave.chg
- common.c: $(SOURCES)/common.w common.chg
-
- wmerge.exe: wmerge.obj
- $(CC) $(CFLAGS) wmerge.obj #exception
- wmerge.c: $(EXAMPLES)/wmerge.w wmerge.chg
- ctangle $(EXAMPLES)/wmerge.w $&.chg $&.c #exception
-
- .w.c:
- ctangle $< $&.chg $&.c
-
- .c.obj:
- $(CC) $(CFLAGS) -c $<
-
- .obj.exe:
- $(CC) $(CFLAGS) $< common.obj
-
- .c.exe:
- $(CC) $(CFLAGS) $< common.obj
-
- # *** Make documentation:
-
- ctangle.tex: $(SOURCES)/ctangle.w common.h ctangle.chg
- cweave.tex: $(SOURCES)/cweave.w common.h $(ROOT)/prod.w cweave.chg
- common.tex: $(SOURCES)/common.w common.chg
-
- cwebman.dvi: $(SOURCES)/cwebman.tex
- $(TEX) $**
-
- cweb.man: $(SOURCES)/cweb.1
- cawf -dNONE -man $** > $<
-
- .w.tex:
- cweave $< $&.chg $&.tex
-
- .tex.dvi:
- $(TEX) $<
-
- # *** Make change and include files:
-
- #The files from the changes directory are always included. The files from the
- #fixes and private directories are in included when the symbols _fix or
- #_priv are defined (the latter implies the former). Note that the fixes and
- #private directories are not part of the public distribution, but you may want
- #to create them for your own change files.
-
- DEP=
- !ifdef _priv
- DEP=$(.path.prv)/xxx.prv
- _fix=1
- !endif
- !ifdef _fix
- DEP=$(.path.fix)/xxx.fix $(DEP)
- !endif
- DEP=$(.path.ch)/xxx.ch $(DEP)
-
- aux: changes includes
- changes: common.chg ctangle.chg cweave.chg wmerge.chg
- includes: common.h $(ROOT)/prod.w cwebmac.tex
-
- common.chg: $(SOURCES)/common.w $(DEP:xxx=common)
- !ifdef _fix
- $(TIE) -c $< $(SOURCES)/common.w $(DEP:xxx=common)
- !else
- $(CP) $(DEP:xxx=common) $<
- !endif
-
- ctangle.chg: $(SOURCES)/ctangle.w $(DEP:xxx=ctangle)
- !ifdef _fix
- $(TIE) -c $< $(SOURCES)/ctangle.w $(DEP:xxx=ctangle)
- !else
- $(CP) $(DEP:xxx=ctangle) $<
- !endif
-
- cweave.chg: $(SOURCES)/cweave.w $(DEP:xxx=cweave)
- !ifdef _fix
- $(TIE) -c $< $(SOURCES)/cweave.w $(DEP:xxx=cweave)
- !else
- $(CP) $(DEP:xxx=cweave) $<
- !endif
-
- wmerge.chg: $(EXAMPLES)/wmerge.w $(DEP:xxx=wmerge)
- !ifdef _fix
- $(TIE) -c $< $(EXAMPLES)/wmerge.w $(DEP:xxx=wmerge)
- !else
- $(CP) $(DEP:xxx=wmerge) $<
- !endif
-
- common.h: $(SOURCES)/common.h $(DEP:xxx=common-h)
- !ifdef _fix
- $(TIE) -m $< $(SOURCES)/common.h $(DEP:xxx=common-h)
- !else
- wmerge $(SOURCES)/common.h $(DEP:xxx=common-h) > $<
- !endif
-
- $(ROOT)/prod.w: $(SOURCES)/prod.w $(DEP:xxx=prod)
- !ifdef _fix
- $(TIE) -m $< $(SOURCES)/prod.w $(DEP:xxx=prod)
- !else
- wmerge $(SOURCES)/prod.w $(DEP:xxx=prod) > $<
- !endif
-
- cwebmac.tex: $(SOURCES)/cwebmac.tex $(DEP:xxx=cwebmac)
- !ifdef _fix
- $(TIE) -m $< $(SOURCES)/cwebmac.tex $(DEP:xxx=cwebmac)
- !else
- wmerge $(SOURCES)/cwebmac.tex $(DEP:xxx=cwebmac) > $<
- !endif
-
- # *** Delete intermediate files:
-
- clean:
- $(RM) *.~
- $(RM) common.h common.chg ctangle.chg cweave.chg prod.w wmerge.chg
- $(RM) cweave.c *.obj
- $(RM) common.tex ctangle.tex cweave.tex *.log *.toc *.idx *.scn
-
- veryclean: clean
- $(RM) *.dvi
-