# # Makefile designed for use with ctangle, cweave, gcc, and plain TeX. # # Copyright (C) 2004, Fredrik Jonsson # # The CTANGLE program converts a CWEB source document into a C program that # may be compiled in the usual way. The output file includes #line specifica- # tions so that debugging can be done in terms of the CWEB source file. # # The CWEAVE program converts the same CWEB file into a TeX file that may be # formatted and printed in the usual way. It takes appropriate care of typo- # graphic details like page layout and the use of indentation, italics, # boldface, etc., and it supplies extensive cross-index information that it # gathers automatically. # # CWEB allows you to prepare a single document containing all the information # that is needed both to produce a compilable C program and to produce a well- # formatted document describing the program in as much detail as the writer # may desire. The user of CWEB ought to be familiar with TeX as well as C. # CTANGLE = ctangle CC = gcc CCOPTS = -O2 -Wall -ansi -pedantic LNOPTS = -lm CWEAVE = cweave TEX = tex DVIPS = dvips DVIPSOPT = -ta4 -D1200 METAPOST = mp FIGDIRS = matfig pagelayt pixbb examples all: epsimg.exe figures examples epsimg.ps epsimg.exe: epsimg.o # generate the executable file $(CC) $(CCOPTS) -o epsimg epsimg.o $(LNOPTS) epsimg.o: epsimg.c # generate the object file $(CC) $(CCOPTS) -c epsimg.c epsimg.c: epsimg.w # generate C code from the CWEB source $(CTANGLE) epsimg epsimg.ps: epsimg.dvi # generate the PostScript documentation $(DVIPS) $(DVIPSOPT) epsimg.dvi -o epsimg.ps epsimg.dvi: epsimg.tex # generate the device-independent documentation $(TEX) epsimg.tex epsimg.tex: epsimg.w # generate plain TeX code from the CWEB source $(CWEAVE) epsimg figures: for k in $(FIGDIRS); do make -ik -C $$k/; done clean: -rm -Rf *~ *.o epsimg *.exe *.aux *.log *.toc *.idx \ *.tex *.c *.scn *.dvi *.ps *.pdf *.dat for k in $(FIGDIRS); do make clean -ik -C $$k/; done