# # Makefile designed for use with ctangle, cweave, gcc, and plain TeX. # # Copyright (C) 2002-2006, Fredrik Jonsson # # The CTANGLE program converts a CWEB source document into a C program which # 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 CWEAVE = cweave CC = gcc CCOPTS = -O2 -Wall -ansi -std=iso9899:1990 -pedantic LNOPTS = -lm TEX = tex DVIPS = dvips DVIPSOPT = -ta4 -D1200 METAPOST = mp all: magbragg magbragg.ps magbragg: magbragg.o $(CC) $(CCOPTS) -o magbragg magbragg.o $(LNOPTS) magbragg.o: magbragg.w $(CTANGLE) magbragg $(CC) $(CCOPTS) -c magbragg.c magbragg.ps: magbragg.dvi $(DVIPS) $(DVIPSOPT) magbragg.dvi -o magbragg.ps magbragg.dvi: magbragg.w make -C figures/ $(CWEAVE) magbragg $(TEX) magbragg.tex clean: # make clean -ik -C figures/ -rm -Rf magbragg *~ *.c *.o *.exe *.dat *.tgz *.pdf -rm -Rf *.tex *.aux *.log *.toc *.idx *.scn *.dvi *.ps archive: make -ik clean tar --gzip --directory=../ -cf magbragg.tgz magbragg