Contents of file 'dvlabel/Makefile':
1 #
2 # Makefile designed for use with ctangle, cweave, gcc, and plain TeX.
3 #
4 # Copyright (C) 2003-2006, Fredrik Jonsson <fj@phys.soton.ac.uk>
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 = dvlabel
22 CTANGLE = ctangle
23 CC = gcc
24 CCOPTS = -O2 -Wall -ansi -std=iso9899:1999 -pedantic
25 LNOPTS = -lm
26 CWEAVE = cweave
27 TEX = tex
28 DVIPS = dvips
29 DVIPSOPT = -ta4 -D1200
30 METAPOST = mp
31 PS2PDF = ps2pdf
32
33 all: $(PROJECT) fig $(PROJECT).pdf sample
34
35 $(PROJECT): $(PROJECT).o # generate the executable file
36 $(CC) $(CCOPTS) -o $(PROJECT) $(PROJECT).o $(LNOPTS)
37
38 $(PROJECT).o: $(PROJECT).c # generate the object file
39 $(CC) $(CCOPTS) -c $(PROJECT).c
40
41 $(PROJECT).c: $(PROJECT).w # generate C code from the CWEB source
42 $(CTANGLE) $(PROJECT)
43
44 $(PROJECT).pdf: $(PROJECT).ps # generate the PDF documentation
45 $(PS2PDF) $(PROJECT).ps $(PROJECT).pdf
46
47 $(PROJECT).ps: $(PROJECT).dvi # generate the PostScript documentation
48 $(DVIPS) $(DVIPSOPT) $(PROJECT).dvi -o $(PROJECT).ps
49
50 $(PROJECT).dvi: $(PROJECT).tex # generate the device-independent documentation
51 $(TEX) $(PROJECT).tex
52
53 $(PROJECT).tex: $(PROJECT).w # generate plain TeX code from the CWEB source
54 $(CWEAVE) $(PROJECT)
55
56 fig:
57 @echo "n" > fig.dvl
58 @echo "Table of contents" >> fig.dvl
59 @echo "This is line number one" >> fig.dvl
60 @echo "This is line number two" >> fig.dvl
61 @echo "This is line number three" >> fig.dvl
62 @echo "." >> fig.dvl
63 @echo "Monday 29/12/2003" >> fig.dvl
64 @echo "Beavis and Butthead" >> fig.dvl
65 @echo "Fredrik Jonsson" >> fig.dvl
66 @echo "Storgatan 77" >> fig.dvl
67 @echo "SE-47111 Sunne, Sweden" >> fig.dvl
68 @echo "." >> fig.dvl
69 @echo "hmv@hotmail.com" >> fig.dvl
70 @echo "q" >> fig.dvl
71 @./$(PROJECT) -d "-D1200" -c -i fig -o fig -v --eps -H -C
72
73 sample:
74 make $(PROJECT)
75 @echo "n" > sample.dvl
76 @echo "DV1: Table of contents" >> sample.dvl
77 @echo "DV1: This is line number one" >> sample.dvl
78 @echo "DV1: This is line number two" >> sample.dvl
79 @echo "DV1: This is line number three" >> sample.dvl
80 @echo "." >> sample.dvl
81 @echo "DV1: Monday 26/11/2004 [Tape 001 SP]" >> sample.dvl
82 @echo "DV1: Beavis and Butthead" >> sample.dvl
83 @echo "Fredrik Jonsson" >> sample.dvl
84 @echo "Storgatan 77" >> sample.dvl
85 @echo "SE-471\\thinspace11 Sunne, Sweden" >> sample.dvl
86 @echo "." >> sample.dvl
87 @echo "hmv@hotmail.com" >> sample.dvl
88 @echo "n" >> sample.dvl
89 @echo "DV2: Table of contents" >> sample.dvl
90 @echo "DV2: This is line number one" >> sample.dvl
91 @echo "DV2: This is line number two" >> sample.dvl
92 @echo "DV2: This is line number three" >> sample.dvl
93 @echo "." >> sample.dvl
94 @echo "DV2: Monday 26/11/2004 [Tape 002 SP]" >> sample.dvl
95 @echo "DV2: Beavis and Butthead" >> sample.dvl
96 @echo "Fredrik Jonsson" >> sample.dvl
97 @echo "Storgatan 77" >> sample.dvl
98 @echo "SE-471\\thinspace11 Sunne, Sweden" >> sample.dvl
99 @echo "." >> sample.dvl
100 @echo "hmv@hotmail.com" >> sample.dvl
101 @echo "n" >> sample.dvl
102 @echo "DV3: Table of contents" >> sample.dvl
103 @echo "DV3: This is line number one" >> sample.dvl
104 @echo "DV3: This is line number two" >> sample.dvl
105 @echo "DV3: This is line number three" >> sample.dvl
106 @echo "." >> sample.dvl
107 @echo "DV3: Monday 26/11/2004 [Tape 003 SP]" >> sample.dvl
108 @echo "DV3: Beavis and Butthead" >> sample.dvl
109 @echo "Fredrik Jonsson" >> sample.dvl
110 @echo "Storgatan 77" >> sample.dvl
111 @echo "SE-471\\thinspace11 Sunne, Sweden" >> sample.dvl
112 @echo "." >> sample.dvl
113 @echo "hmv@hotmail.com" >> sample.dvl
114 @echo "n" >> sample.dvl
115 @echo "DV4: Table of contents" >> sample.dvl
116 @echo "DV4: This is line number one" >> sample.dvl
117 @echo "DV4: This is line number two" >> sample.dvl
118 @echo "DV4: This is line number three" >> sample.dvl
119 @echo "." >> sample.dvl
120 @echo "DV4: Monday 26/11/2004 [Tape 004 SP]" >> sample.dvl
121 @echo "DV4: Beavis and Butthead" >> sample.dvl
122 @echo "Fredrik Jonsson" >> sample.dvl
123 @echo "Storgatan 77" >> sample.dvl
124 @echo "SE-471\\thinspace11 Sunne, Sweden" >> sample.dvl
125 @echo "." >> sample.dvl
126 @echo "hmv@hotmail.com" >> sample.dvl
127 @echo "n" >> sample.dvl
128 @echo "DV5: Table of contents" >> sample.dvl
129 @echo "DV5: This is line number one" >> sample.dvl
130 @echo "DV5: This is line number two" >> sample.dvl
131 @echo "DV5: This is line number three" >> sample.dvl
132 @echo "." >> sample.dvl
133 @echo "DV5: Monday 26/11/2004 [Tape 004 SP]" >> sample.dvl
134 @echo "DV5: Beavis and Butthead" >> sample.dvl
135 @echo "Fredrik Jonsson" >> sample.dvl
136 @echo "Storgatan 77" >> sample.dvl
137 @echo "SE-471\\thinspace11 Sunne, Sweden" >> sample.dvl
138 @echo "." >> sample.dvl
139 @echo "hmv@hotmail.com" >> sample.dvl
140 @echo "n" >> sample.dvl
141 @echo "DV6: Table of contents" >> sample.dvl
142 @echo "DV6: This is line number one" >> sample.dvl
143 @echo "DV6: This is line number two" >> sample.dvl
144 @echo "DV6: This is line number three" >> sample.dvl
145 @echo "." >> sample.dvl
146 @echo "DV6: Monday 26/11/2004 [Tape 004 SP]" >> sample.dvl
147 @echo "DV6: Beavis and Butthead" >> sample.dvl
148 @echo "Fredrik Jonsson" >> sample.dvl
149 @echo "Storgatan 77" >> sample.dvl
150 @echo "SE-471\\thinspace11 Sunne, Sweden" >> sample.dvl
151 @echo "." >> sample.dvl
152 @echo "hmv@hotmail.com" >> sample.dvl
153 @echo "n" >> sample.dvl
154 @echo "DV7: Table of contents" >> sample.dvl
155 @echo "DV7: This is line number one" >> sample.dvl
156 @echo "DV7: This is line number two" >> sample.dvl
157 @echo "DV7: This is line number three" >> sample.dvl
158 @echo "." >> sample.dvl
159 @echo "DV7: Monday 26/11/2004 [Tape 004 SP]" >> sample.dvl
160 @echo "DV7: Beavis and Butthead" >> sample.dvl
161 @echo "Fredrik Jonsson" >> sample.dvl
162 @echo "Storgatan 77" >> sample.dvl
163 @echo "SE-471\\thinspace11 Sunne, Sweden" >> sample.dvl
164 @echo "." >> sample.dvl
165 @echo "hmv@hotmail.com" >> sample.dvl
166 @echo "q" >> sample.dvl
167 @./$(PROJECT) -d "-D1200 -ta4" -c -i sample -o sample -v
168
169 clean:
170 -rm -Rf *~ *.o *.exe *.aux *.log *.toc *.idx $(PROJECT) \
171 *.tex *.c *.scn *.dvi *.ps *.eps *.pdf *.dat *.dvl
172
173 archive:
174 make -ik clean
175 tar --gzip --directory=../ -cf ../$(PROJECT).tar.gz $(PROJECT)
176
Generated by ::viewsrc::