Debian Codegraph @

texk/web2c/cwebdir/Makefile

raw symbols SCIP
1 # This file is part of CWEB.
2 # It is distributed WITHOUT ANY WARRANTY, express or implied.
3 # Version 4.12.2 --- July 2025
4
5 # Copyright (C) 1987,1990,1993,2000 Silvio Levy and Donald E. Knuth
6
7 # Permission is granted to make and distribute verbatim copies of this
8 # document provided that the copyright notice and this permission notice
9 # are preserved on all copies.
10
11 # Permission is granted to copy and distribute modified versions of this
12 # document under the conditions for verbatim copying, provided that the
13 # entire resulting derived work is given a different name and distributed
14 # under the terms of a permission notice identical to this one.
15
16 #
17 # Read the README file, then edit this file to reflect local conditions
18 #
19
20 # directory for TeX inputs (cwebmac.tex goes here)
21 MACROSDIR= /usr/share/texmf/tex/generic
22
23 # directory for CWEB inputs in @i files
24 CWEBINPUTS= /usr/local/lib/cweb
25
26 # extension for manual pages ("l" distinguishes local from system stuff)
27 MANEXT= l
28 #MANEXT= 1
29
30 # directory for manual pages (cweb.1 goes here)
31 MANDIR= /usr/share/man/man$(MANEXT)
32
33 # destination directory for executables; must end in /
34 DESTDIR= /usr/local/bin/
35
36 # directory for GNU EMACS Lisp code (cweb.el goes here)
37 EMACSDIR= /usr/share/emacs/site-lisp
38
39 # Set DESTPREF to null if you want to call the executables "tangle" and "weave"
40 # (probably NOT a good idea; we recommend leaving DESTPREF=c)
41 DESTPREF=c
42
43 # Set CCHANGES to comm-foo.ch if you need changes to common.w
44 CCHANGES=
45
46 # Set TCHANGES to ctang-foo.ch if you need changes to ctangle.w
47 TCHANGES=
48
49 # Set WCHANGES to cweav-foo.ch if you need changes to cweave.w
50 WCHANGES=
51
52 # We keep debugging info around, for fun, but most users don't need it
53 CFLAGS = -g # -Wall -Wextra -Wimplicit-fallthrough=2 # check compiler warnings
54 #CFLAGS = -O
55 LINKFLAGS = -g
56 #LINKFLAGS = -s # for smaller (stripped) executables on many UNIX systems
57
58 # What C compiler are you using?
59 #CC = cc
60
61 # RM and CP are used below in case rm and cp are aliased
62 RM= /bin/rm
63 CP= /bin/cp
64
65 # uncomment the second line if you use pdftex to bypass .dvi files
66 # uncomment the third line if you use xetex to bypass .dvi files
67 # uncomment the forth line if you use hitex for HINT output
68 PDFTEX = dvipdfm
69 #PDFTEX = pdftex
70 #PDFTEX = xetex
71 #PDFTEX = hitex
72 #PDFTEX = luatex
73
74 ########## You shouldn't have to change anything after this point #######
75
76 CWEAVE = ./cweave
77 CTANGLE = ./ctangle
78 SOURCES = cweave.w common.w ctangle.w
79 ALL = common.w ctangle.w cweave.w prod.w \
80 Makefile README common.c common.h ctangle.c \
81 cwebman.tex cwebacromac.tex cwebmac.tex \
82 cweb.1 cweb.el c++lib.w iso_types.w \
83 comm-man.ch ctang-man.ch cweav-man.ch \
84 comm-bs.ch ctang-bs.ch cweav-bs.ch makefile.bs \
85 comm-pc.ch ctang-pc.ch cweav-pc.ch comm-amiga.ch \
86 comm-ql.ch ctang-ql.ch cweav-ql.ch readme.ql \
87 comm-vms.ch ctang-vms.ch cweav-vms.ch \
88 comm-w32.ch ctang-w32.ch cweav-w32.ch \
89 comm-os2.ch comm-mac.ch
90
91 .SUFFIXES: .dvi .tex .w .pdf .hnt
92
93 .w.tex:
94 $(CWEAVE) $*
95
96 .tex.dvi:
97 tex $<
98
99 .w.dvi:
100 make $*.tex
101 make $*.dvi
102
103 .w.c:
104 $(CTANGLE) $*
105
106 .w.o:
107 make $*.c
108 make $*.o
109
110 .w.pdf:
111 make $*.tex
112 case "$(PDFTEX)" in \
113 dvipdfm ) tex "\let\pdf+ \input $*"; dvipdfm $* ;; \
114 pdftex ) pdftex $* ;; \
115 xetex ) xetex $* ;; \
116 luatex ) luatex $* ;; \
117 esac
118
119 .w.hnt:
120 make $*.tex
121 case "$(PDFTEX)" in \
122 hitex ) hitex $* ;; \
123 esac
124
125 all: ctangle cweave
126
127 cautiously: ctangle
128 $(CP) common.c SAVEcommon.c
129 ./ctangle common $(CCHANGES)
130 diff common.c SAVEcommon.c
131 $(RM) SAVEcommon.c
132 $(CP) ctangle.c SAVEctangle.c
133 ./ctangle ctangle $(TCHANGES)
134 diff ctangle.c SAVEctangle.c
135 $(RM) SAVEctangle.c
136
137 SAVEctangle.c:
138 $(CP) ctangle.c SAVEctangle.c
139
140 SAVEcommon.c:
141 $(CP) common.c SAVEcommon.c
142
143 common.c: common.w $(CCHANGES) common.h
144 $(CTANGLE) common $(CCHANGES)
145
146 common.o: common.c
147 $(CC) $(CFLAGS) -DCWEBINPUTS=\"$(CWEBINPUTS)\" -c common.c
148
149 ctangle: ctangle.o common.o
150 $(CC) $(LINKFLAGS) -o ctangle ctangle.o common.o
151
152 ctangle.c: ctangle.w $(TCHANGES) common.h
153 $(CTANGLE) ctangle $(TCHANGES)
154
155 cweave: cweave.o common.o
156 $(CC) $(LINKFLAGS) -o cweave cweave.o common.o
157
158 cweave.c: cweave.w $(WCHANGES) common.h prod.w
159 $(CTANGLE) cweave $(WCHANGES)
160
161 doc: $(SOURCES:.w=.dvi)
162
163 usermanual: cwebman.tex cwebmac.tex
164 $(PDF)tex cwebman
165
166 fullmanual: usermanual $(SOURCES) comm-man.ch ctang-man.ch cweav-man.ch
167 make cweave
168 ./cweave common.w comm-man.ch
169 $(PDF)tex common.tex
170 ./cweave ctangle.w ctang-man.ch
171 $(PDF)tex ctangle.tex
172 ./cweave cweave.w cweav-man.ch
173 $(PDF)tex cweave.tex
174
175 # be sure to leave ctangle.c and common.c for bootstrapping
176 clean:
177 $(RM) -f -r *~ *.o common.tex cweave.tex cweave.c ctangle.tex \
178 *.log *.dvi *.toc *.idx *.scn *.pdf *.hnt core cweave ctangle
179
180 install: all
181 - mkdir $(DESTDIR)
182 $(CP) cweave $(DESTDIR)$(DESTPREF)weave
183 chmod 755 $(DESTDIR)$(DESTPREF)weave
184 $(CP) ctangle $(DESTDIR)$(DESTPREF)tangle
185 chmod 755 $(DESTDIR)$(DESTPREF)tangle
186 - mkdir $(MANDIR)
187 $(CP) cweb.1 $(MANDIR)/cweb.$(MANEXT)
188 chmod 644 $(MANDIR)/cweb.$(MANEXT)
189 - mkdir $(MACROSDIR)
190 $(CP) cwebacromac.tex $(MACROSDIR)
191 chmod 644 $(MACROSDIR)/cwebacromac.tex
192 $(CP) cwebmac.tex $(MACROSDIR)
193 chmod 644 $(MACROSDIR)/cwebmac.tex
194 - mkdir $(EMACSDIR)
195 $(CP) cweb.el $(EMACSDIR)
196 chmod 644 $(EMACSDIR)/cweb.el
197 - mkdir $(CWEBINPUTS)
198 $(CP) c++lib.w $(CWEBINPUTS)
199 chmod 644 $(CWEBINPUTS)/c++lib.w
200 $(CP) iso_types.w $(CWEBINPUTS)
201 chmod 644 $(CWEBINPUTS)/iso_types.w
202
203 floppy: $(ALL) examples
204 bar cvhf /dev/rfd0 $(ALL) examples
205 bar tvf /dev/rfd0
206 eject
207
208 tags: $(ALL)
209 etags -lnone $(ALL)
210
211 tarfile: $(ALL) examples
212 tar cvhf /tmp/cweb.tar $(ALL) examples
213 gzip -9 /tmp/cweb.tar
214
215 tarball:
216 tar zcvhf /tmp/cweb.tgz $(ALL) examples
217
218 ctan:
219 git archive -o ~/cweb-4.12.2.zip --prefix=cweb/ cweb-4.12.2
220 make PDF=pdf usermanual
221 cd ..; zip -r ~/cweb-4.12.2.zip cweb/cwebman.pdf