Search:

Return to previous page

Contents of file 'epsimg/Makefile':



    1   #
    2   # Makefile designed for use with ctangle, cweave, gcc, and plain TeX.
    3   #
    4   # Copyright (C) 2004, Fredrik Jonsson <jonsson@uni-wuppertal.de>
    5   #
    6   # The CTANGLE program converts a CWEB source document into a C program that
    7   # may be compiled in the usual way. The output file includes #line specifica-
    8   # tions so that debugging can be done in terms of the CWEB source file.
    9   #
   10   # The CWEAVE program converts the same CWEB file into a TeX file that may be
   11   # formatted and printed in the usual way. It takes appropriate care of typo-
   12   # graphic details like page layout and the use of indentation, italics,
   13   # boldface, etc., and it supplies extensive cross-index information that it
   14   # gathers automatically.
   15   #
   16   # CWEB allows you to prepare a single document containing all the information
   17   # that is needed both to produce a compilable C program and to produce a well-
   18   # formatted document describing the program in as much detail as the writer
   19   # may desire.  The user of CWEB ought to be familiar with TeX as well as C.
   20   #
   21   PROJECT  = epsimg
   22   CTANGLE  = ctangle
   23   CC       = gcc
   24   CCOPTS   = -O2 -Wall -ansi -pedantic
   25   LNOPTS   = -lm
   26   CWEAVE   = cweave
   27   TEX      = tex
   28   DVIPS    = dvips
   29   DVIPSOPT = -ta4 -D1200
   30   METAPOST = mp
   31   PS2PDF   = ps2pdf
   32   FIGDIRS  = matfig pagelayt pixbb examples
   33   
   34   all: $(PROJECT) figures examples $(PROJECT).pdf
   35   
   36   $(PROJECT): $(PROJECT).o # generate the executable file
   37   	$(CC) $(CCOPTS) -o $(PROJECT) $(PROJECT).o $(LNOPTS)
   38   
   39   $(PROJECT).o: $(PROJECT).c # generate the object file
   40   	$(CC) $(CCOPTS) -c $(PROJECT).c
   41   
   42   $(PROJECT).c: $(PROJECT).w # generate C code from the CWEB source
   43   	$(CTANGLE) $(PROJECT)
   44   
   45   $(PROJECT).pdf: $(PROJECT).ps # generate the PDF documentation
   46   	$(PS2PDF) $(PROJECT).ps $(PROJECT).pdf
   47   
   48   $(PROJECT).ps: $(PROJECT).dvi # generate the PostScript documentation
   49   	$(DVIPS) $(DVIPSOPT) $(PROJECT).dvi -o $(PROJECT).ps
   50   
   51   $(PROJECT).dvi: $(PROJECT).tex # generate the device-independent documentation
   52   	$(TEX) $(PROJECT).tex
   53   
   54   $(PROJECT).tex: $(PROJECT).w # generate plain TeX code from the CWEB source
   55   	$(CWEAVE) $(PROJECT)
   56   
   57   figures:
   58   	for k in $(FIGDIRS); do make -ik -C $$k/; done
   59   
   60   clean:
   61   	-rm -Rf *~ *.o $(PROJECT) *.exe *.aux *.log *.toc *.idx \
   62   	*.tex *.c *.scn *.dvi *.ps *.pdf *.dat
   63   	for k in $(FIGDIRS); do make clean -ik -C $$k/; done
   64   
   65   archive:
   66   	make -ik clean
   67   	tar --gzip --directory=../ -cf ../$(PROJECT).tar.gz $(PROJECT)
   68   

Return to previous page

Generated by ::viewsrc::

Last modified Wednesday 15 Feb 2023