Search:

Return to previous page

Contents of file 'Makefile':



#
# Makefile designed for use with ctangle, cweave, gcc, and plain TeX.
#
# Copyright (C) 2002-2006, Fredrik Jonsson <fj@phys.soton.ac.uk>
#
# 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: boxcount boxcount.ps
	@echo "==============================================================="
	@echo " To verify the execution performance of the BOXCOUNT program"
	@echo " on the Koch snowflake fractal, run 'make verification'."
	@echo "==============================================================="

boxcount: boxcount.o
	$(CC) $(CCOPTS) -o boxcount boxcount.o $(LNOPTS)

boxcount.o: boxcount.w
	$(CTANGLE) boxcount
	$(CC) $(CCOPTS) -c boxcount.c

boxcount.ps: boxcount.dvi
	$(DVIPS) $(DVIPSOPT) boxcount.dvi -o boxcount.ps

boxcount.dvi: boxcount.w
	@make -C figures/
	@make -C kochxmpl/
	@make verification
	$(CWEAVE) boxcount
	$(TEX) boxcount.tex

verification:
	@echo "==============================================================="
	@echo " Verifying the performance of the BOXCOUNT program on the Koch"
	@echo " snowflake fractal of iteration order 11."
	@echo "==============================================================="
	make koch -C koch/
	make kochgraphs -C koch/
	make fractaldimension -C koch/

clean:
	make -ik clean -C figures/
	make -ik clean -C koch/
	make -ik clean -C kochxmpl/
	-rm -Rf boxcount *˜ *.c *.o *.exe *.dat *.tgz *.pdf *.mp *.trj
	-rm -Rf *.tex *.aux *.log *.toc *.idx *.scn *.dvi *.ps

archive:
	make -ik clean
	tar --gzip --directory=../ -cf boxcount.tgz boxcount


Return to previous page

Last modified 28 Feb 2010