# # 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. # PROJECT = epsimg CTANGLE = ctangle CC = gcc CCOPTS = -O2 -Wall -ansi -pedantic LNOPTS = -lm CWEAVE = cweave TEX = tex DVIPS = dvips DVIPSOPT = -ta4 -D1200 METAPOST = mp PS2PDF = ps2pdf FIGDIRS = matfig pagelayt pixbb examples all: $(PROJECT) figures examples $(PROJECT).pdf $(PROJECT): $(PROJECT).o # generate the executable file $(CC) $(CCOPTS) -o $(PROJECT) $(PROJECT).o $(LNOPTS) $(PROJECT).o: $(PROJECT).c # generate the object file $(CC) $(CCOPTS) -c $(PROJECT).c $(PROJECT).c: $(PROJECT).w # generate C code from the CWEB source $(CTANGLE) $(PROJECT) $(PROJECT).pdf: $(PROJECT).ps # generate the PDF documentation $(PS2PDF) $(PROJECT).ps $(PROJECT).pdf $(PROJECT).ps: $(PROJECT).dvi # generate the PostScript documentation $(DVIPS) $(DVIPSOPT) $(PROJECT).dvi -o $(PROJECT).ps $(PROJECT).dvi: $(PROJECT).tex # generate the device-independent documentation $(TEX) $(PROJECT).tex $(PROJECT).tex: $(PROJECT).w # generate plain TeX code from the CWEB source $(CWEAVE) $(PROJECT) figures: for k in $(FIGDIRS); do make -ik -C $$k/; done clean: -rm -Rf *~ *.o $(PROJECT) *.exe *.aux *.log *.toc *.idx \ *.tex *.c *.scn *.dvi *.ps *.pdf *.dat for k in $(FIGDIRS); do make clean -ik -C $$k/; done archive: make -ik clean tar --gzip --directory=../ -cf ../$(PROJECT).tar.gz $(PROJECT)