Imported Debian patch 2.14.3-1
Frank B. Brokken authored 15 years ago
tony mancill committed 11 years ago
0 | // Uncomment the following #define if you want to use the following exensive | |
1 | // set of compilation options: | |
2 | // -O0 -g3 -ansi -pedantic -fno-common -pipe -W -Wall -Wcast-align | |
3 | // -Wcast-qual -Wconversion -Wformat=2 -Winline -Wnested-externs | |
4 | // -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef | |
5 | // -Wno-unused-parameter -Waggregate-return -Wnested-externs | |
6 | // | |
7 | //#define EXTENSIVE_OPTIONS | |
8 | ||
9 | // Alternatively, uncomment the following #define to compile the programs with | |
10 | // the -pg option, so that gprof can be used for profiling purposes. | |
11 | // If neither is defined, COPT is used (see build). | |
12 | // EXTENSIVE_OPTIONS takes priority over PROFILING. | |
13 | // | |
14 | //#define PROFILING | |
15 | ||
16 | ||
17 | string BASE; | |
18 | ||
19 | // BASE is the directory below which ALL yodl files will be stored. | |
20 | ||
21 | // For an operational non-Debian installation, you probably must be | |
22 | // `root', and BASE "/usr" or BASE "/usr/local" is suggested (see | |
23 | // below). `BASE' itself is not used outside of this file, so feel free to | |
24 | // define BIN, SKEL, MAN and DOC (below) in any which way you like. | |
25 | ||
26 | string BIN; | |
27 | // the directory in which yodl will be stored | |
28 | ||
29 | string SKEL; | |
30 | // SKEL is the directory below BASE in which the skeleton files will be | |
31 | // stored | |
32 | ||
33 | string MAN; | |
34 | // MAN is the directory in which the manual page will be stored | |
35 | ||
36 | string DOC; | |
37 | // DOC is the directory in which all other documentation except for the | |
38 | // manual and examples will be stored | |
39 | ||
40 | string DOCDOC; | |
41 | // DOCDOC is the directory in which the manual and examples will be stored | |
42 | ||
43 | string COMPILER; | |
44 | // COMPILER specifies the compiler to use. yodl is coined as | |
45 | // belonging to the Debian `unstable' distribution, which may use a | |
46 | // different version of the compiler you currently have in your | |
47 | // system. E.g., in july 2006 the Debian `testing' version of the compiler | |
48 | // was 4.0.4, but the `unstable' version's compiler was 4.1.2. By defining | |
49 | // COMPILER with a specific version (e.g., COMPILER=g++-4.1) that | |
50 | // particular version can be used. The distributed definition uses the | |
51 | // `default' compiler version. | |
52 | ||
53 | //#define PROFILE "-pg" | |
54 | // Uncomment the above #define to construct a binary program that can be | |
55 | // used with the gprof profiler. When specified, no stripping is performed | |
56 | // at ./build program strip (see INSTALL) | |
57 | ||
58 | void setLocations() | |
59 | { | |
60 | BASE = "/usr"; | |
61 | ||
62 | BIN = BASE + "/bin"; | |
63 | SKEL = BASE + "/share/yodl"; | |
64 | MAN = BASE + "/share/man"; | |
65 | DOC = BASE + "/share/doc/yodl"; | |
66 | DOCDOC = BASE + "/share/doc/yodl-doc"; | |
67 | ||
68 | COMPILER = "gcc"; | |
69 | } | |
70 |
0 | 0 | |
1 | 1 | Installing Yodl |
2 | 2 | |
3 | Below the original contents of the file INSTALL.txt follows. As of Yodl 2.00, | |
4 | yodl is available from ftp.rug.nl/contrib/frank/software/linux/yodl, or as a | |
5 | Debian package. | |
3 | Below the original contents of the file INSTALL.txt follows. As of Yodl | |
4 | 2.01.00, Yodl is available from http://yodl.sourceforge.net, or as a Debian | |
5 | linux package. | |
6 | 6 | |
7 | 7 | To install Yodl as a binary package, the `dpkg' Debian package installer is |
8 | 8 | the preferred program to use to install Yodl. If you want to install Yodl from |
9 | 9 | its sources, download the source archive (yodl*.tar.gz), unpack it. |
10 | 10 | |
11 | Determine in ../yodl/yodl/src/config.h where you want the program and macros | |
12 | to be installed (i,e, optionally modify STD_INCLUDE and YODL_BIN), then run | |
11 | If you want to compile Yodl yourself, you'll probably need Icmake. Icmake is | |
12 | available from http://icmake.sourceforge.net or as a Debian linux package. | |
13 | 13 | |
14 | ./build package | |
14 | To install Yodl using icmake proceed as follows: | |
15 | 15 | |
16 | and (probably as root): | |
16 | 1. Define the appropriate locations in setLocations() (at the bottom) of | |
17 | INSTALL.im | |
17 | 18 | |
18 | ./build install | |
19 | 2. then run: | |
19 | 20 | |
20 | To use the build script, icmake is required (available from | |
21 | ftp.rug.nl/contrib/frank/software/linux/icmake, or as a Debian package. | |
21 | ./build programs | |
22 | ./build man | |
23 | ./build manual | |
24 | ./build macros | |
22 | 25 | |
23 | Alternatively, Karel Kubat (karel@e-tunity.com) wrote the script | |
24 | `contrib/build.pl' which is a Perl-script. Run this script (from this | |
25 | directory) without arguments to see what it can do for you. | |
26 | NOTE: ./build programs must be first, ./build macros must be last, the other | |
27 | two are optional | |
28 | ||
29 | 3. then do (probably as root) | |
30 | ||
31 | (NOTE: `WHERE' (below) indicates the base directory under which you want | |
32 | to install the software. The paths in INSTALL.im refer to locations | |
33 | below WHERE. So, specifying WHERE as / will install under the | |
34 | system's root directory. All WHERE specifications must be | |
35 | identical). | |
36 | ||
37 | ./install programs WHERE - e.g., ./install programs / | |
38 | ./install man WHERE ./install man / | |
39 | ./install manual WHERE ./install manual / | |
40 | ./install macros WHERE ./install macros / | |
41 | ./install docs WHERE ./install docs / | |
42 | ||
43 | For `./install' there are no ordering requirements but at the very least | |
44 | do | |
45 | ./install programs WHERE - e.g., ./install programs / | |
46 | ./install macros WHERE ./install macros / | |
47 | ||
26 | 48 | |
27 | 49 | |
28 | 50 | Frank B. Brokken |
0 | ||
1 | GNU GENERAL PUBLIC LICENSE | |
2 | Version 3, 29 June 2007 | |
3 | ||
4 | Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | Preamble | |
9 | ||
10 | The GNU General Public License is a free, copyleft license for | |
11 | software and other kinds of works. | |
12 | ||
13 | The licenses for most software and other practical works are designed | |
14 | to take away your freedom to share and change the works. By contrast, | |
15 | the GNU General Public License is intended to guarantee your freedom to | |
16 | share and change all versions of a program--to make sure it remains free | |
17 | software for all its users. We, the Free Software Foundation, use the | |
18 | GNU General Public License for most of our software; it applies also to | |
19 | any other work released this way by its authors. You can apply it to | |
20 | your programs, too. | |
21 | ||
22 | When we speak of free software, we are referring to freedom, not | |
23 | price. Our General Public Licenses are designed to make sure that you | |
24 | have the freedom to distribute copies of free software (and charge for | |
25 | them if you wish), that you receive source code or can get it if you | |
26 | want it, that you can change the software or use pieces of it in new | |
27 | free programs, and that you know you can do these things. | |
28 | ||
29 | To protect your rights, we need to prevent others from denying you | |
30 | these rights or asking you to surrender the rights. Therefore, you have | |
31 | certain responsibilities if you distribute copies of the software, or if | |
32 | you modify it: responsibilities to respect the freedom of others. | |
33 | ||
34 | For example, if you distribute copies of such a program, whether | |
35 | gratis or for a fee, you must pass on to the recipients the same | |
36 | freedoms that you received. You must make sure that they, too, receive | |
37 | or can get the source code. And you must show them these terms so they | |
38 | know their rights. | |
39 | ||
40 | Developers that use the GNU GPL protect your rights with two steps: | |
41 | (1) assert copyright on the software, and (2) offer you this License | |
42 | giving you legal permission to copy, distribute and/or modify it. | |
43 | ||
44 | For the developers' and authors' protection, the GPL clearly explains | |
45 | that there is no warranty for this free software. For both users' and | |
46 | authors' sake, the GPL requires that modified versions be marked as | |
47 | changed, so that their problems will not be attributed erroneously to | |
48 | authors of previous versions. | |
49 | ||
50 | Some devices are designed to deny users access to install or run | |
51 | modified versions of the software inside them, although the manufacturer | |
52 | can do so. This is fundamentally incompatible with the aim of | |
53 | protecting users' freedom to change the software. The systematic | |
54 | pattern of such abuse occurs in the area of products for individuals to | |
55 | use, which is precisely where it is most unacceptable. Therefore, we | |
56 | have designed this version of the GPL to prohibit the practice for those | |
57 | products. If such problems arise substantially in other domains, we | |
58 | stand ready to extend this provision to those domains in future versions | |
59 | of the GPL, as needed to protect the freedom of users. | |
60 | ||
61 | Finally, every program is threatened constantly by software patents. | |
62 | States should not allow patents to restrict development and use of | |
63 | software on general-purpose computers, but in those that do, we wish to | |
64 | avoid the special danger that patents applied to a free program could | |
65 | make it effectively proprietary. To prevent this, the GPL assures that | |
66 | patents cannot be used to render the program non-free. | |
67 | ||
68 | The precise terms and conditions for copying, distribution and | |
69 | modification follow. | |
70 | ||
71 | TERMS AND CONDITIONS | |
72 | ||
73 | 0. Definitions. | |
74 | ||
75 | "This License" refers to version 3 of the GNU General Public License. | |
76 | ||
77 | "Copyright" also means copyright-like laws that apply to other kinds of | |
78 | works, such as semiconductor masks. | |
79 | ||
80 | "The Program" refers to any copyrightable work licensed under this | |
81 | License. Each licensee is addressed as "you". "Licensees" and | |
82 | "recipients" may be individuals or organizations. | |
83 | ||
84 | To "modify" a work means to copy from or adapt all or part of the work | |
85 | in a fashion requiring copyright permission, other than the making of an | |
86 | exact copy. The resulting work is called a "modified version" of the | |
87 | earlier work or a work "based on" the earlier work. | |
88 | ||
89 | A "covered work" means either the unmodified Program or a work based | |
90 | on the Program. | |
91 | ||
92 | To "propagate" a work means to do anything with it that, without | |
93 | permission, would make you directly or secondarily liable for | |
94 | infringement under applicable copyright law, except executing it on a | |
95 | computer or modifying a private copy. Propagation includes copying, | |
96 | distribution (with or without modification), making available to the | |
97 | public, and in some countries other activities as well. | |
98 | ||
99 | To "convey" a work means any kind of propagation that enables other | |
100 | parties to make or receive copies. Mere interaction with a user through | |
101 | a computer network, with no transfer of a copy, is not conveying. | |
102 | ||
103 | An interactive user interface displays "Appropriate Legal Notices" | |
104 | to the extent that it includes a convenient and prominently visible | |
105 | feature that (1) displays an appropriate copyright notice, and (2) | |
106 | tells the user that there is no warranty for the work (except to the | |
107 | extent that warranties are provided), that licensees may convey the | |
108 | work under this License, and how to view a copy of this License. If | |
109 | the interface presents a list of user commands or options, such as a | |
110 | menu, a prominent item in the list meets this criterion. | |
111 | ||
112 | 1. Source Code. | |
113 | ||
114 | The "source code" for a work means the preferred form of the work | |
115 | for making modifications to it. "Object code" means any non-source | |
116 | form of a work. | |
117 | ||
118 | A "Standard Interface" means an interface that either is an official | |
119 | standard defined by a recognized standards body, or, in the case of | |
120 | interfaces specified for a particular programming language, one that | |
121 | is widely used among developers working in that language. | |
122 | ||
123 | The "System Libraries" of an executable work include anything, other | |
124 | than the work as a whole, that (a) is included in the normal form of | |
125 | packaging a Major Component, but which is not part of that Major | |
126 | Component, and (b) serves only to enable use of the work with that | |
127 | Major Component, or to implement a Standard Interface for which an | |
128 | implementation is available to the public in source code form. A | |
129 | "Major Component", in this context, means a major essential component | |
130 | (kernel, window system, and so on) of the specific operating system | |
131 | (if any) on which the executable work runs, or a compiler used to | |
132 | produce the work, or an object code interpreter used to run it. | |
133 | ||
134 | The "Corresponding Source" for a work in object code form means all | |
135 | the source code needed to generate, install, and (for an executable | |
136 | work) run the object code and to modify the work, including scripts to | |
137 | control those activities. However, it does not include the work's | |
138 | System Libraries, or general-purpose tools or generally available free | |
139 | programs which are used unmodified in performing those activities but | |
140 | which are not part of the work. For example, Corresponding Source | |
141 | includes interface definition files associated with source files for | |
142 | the work, and the source code for shared libraries and dynamically | |
143 | linked subprograms that the work is specifically designed to require, | |
144 | such as by intimate data communication or control flow between those | |
145 | subprograms and other parts of the work. | |
146 | ||
147 | The Corresponding Source need not include anything that users | |
148 | can regenerate automatically from other parts of the Corresponding | |
149 | Source. | |
150 | ||
151 | The Corresponding Source for a work in source code form is that | |
152 | same work. | |
153 | ||
154 | 2. Basic Permissions. | |
155 | ||
156 | All rights granted under this License are granted for the term of | |
157 | copyright on the Program, and are irrevocable provided the stated | |
158 | conditions are met. This License explicitly affirms your unlimited | |
159 | permission to run the unmodified Program. The output from running a | |
160 | covered work is covered by this License only if the output, given its | |
161 | content, constitutes a covered work. This License acknowledges your | |
162 | rights of fair use or other equivalent, as provided by copyright law. | |
163 | ||
164 | You may make, run and propagate covered works that you do not | |
165 | convey, without conditions so long as your license otherwise remains | |
166 | in force. You may convey covered works to others for the sole purpose | |
167 | of having them make modifications exclusively for you, or provide you | |
168 | with facilities for running those works, provided that you comply with | |
169 | the terms of this License in conveying all material for which you do | |
170 | not control copyright. Those thus making or running the covered works | |
171 | for you must do so exclusively on your behalf, under your direction | |
172 | and control, on terms that prohibit them from making any copies of | |
173 | your copyrighted material outside their relationship with you. | |
174 | ||
175 | Conveying under any other circumstances is permitted solely under | |
176 | the conditions stated below. Sublicensing is not allowed; section 10 | |
177 | makes it unnecessary. | |
178 | ||
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. | |
180 | ||
181 | No covered work shall be deemed part of an effective technological | |
182 | measure under any applicable law fulfilling obligations under article | |
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or | |
184 | similar laws prohibiting or restricting circumvention of such | |
185 | measures. | |
186 | ||
187 | When you convey a covered work, you waive any legal power to forbid | |
188 | circumvention of technological measures to the extent such circumvention | |
189 | is effected by exercising rights under this License with respect to | |
190 | the covered work, and you disclaim any intention to limit operation or | |
191 | modification of the work as a means of enforcing, against the work's | |
192 | users, your or third parties' legal rights to forbid circumvention of | |
193 | technological measures. | |
194 | ||
195 | 4. Conveying Verbatim Copies. | |
196 | ||
197 | You may convey verbatim copies of the Program's source code as you | |
198 | receive it, in any medium, provided that you conspicuously and | |
199 | appropriately publish on each copy an appropriate copyright notice; | |
200 | keep intact all notices stating that this License and any | |
201 | non-permissive terms added in accord with section 7 apply to the code; | |
202 | keep intact all notices of the absence of any warranty; and give all | |
203 | recipients a copy of this License along with the Program. | |
204 | ||
205 | You may charge any price or no price for each copy that you convey, | |
206 | and you may offer support or warranty protection for a fee. | |
207 | ||
208 | 5. Conveying Modified Source Versions. | |
209 | ||
210 | You may convey a work based on the Program, or the modifications to | |
211 | produce it from the Program, in the form of source code under the | |
212 | terms of section 4, provided that you also meet all of these conditions: | |
213 | ||
214 | a) The work must carry prominent notices stating that you modified | |
215 | it, and giving a relevant date. | |
216 | ||
217 | b) The work must carry prominent notices stating that it is | |
218 | released under this License and any conditions added under section | |
219 | 7. This requirement modifies the requirement in section 4 to | |
220 | "keep intact all notices". | |
221 | ||
222 | c) You must license the entire work, as a whole, under this | |
223 | License to anyone who comes into possession of a copy. This | |
224 | License will therefore apply, along with any applicable section 7 | |
225 | additional terms, to the whole of the work, and all its parts, | |
226 | regardless of how they are packaged. This License gives no | |
227 | permission to license the work in any other way, but it does not | |
228 | invalidate such permission if you have separately received it. | |
229 | ||
230 | d) If the work has interactive user interfaces, each must display | |
231 | Appropriate Legal Notices; however, if the Program has interactive | |
232 | interfaces that do not display Appropriate Legal Notices, your | |
233 | work need not make them do so. | |
234 | ||
235 | A compilation of a covered work with other separate and independent | |
236 | works, which are not by their nature extensions of the covered work, | |
237 | and which are not combined with it such as to form a larger program, | |
238 | in or on a volume of a storage or distribution medium, is called an | |
239 | "aggregate" if the compilation and its resulting copyright are not | |
240 | used to limit the access or legal rights of the compilation's users | |
241 | beyond what the individual works permit. Inclusion of a covered work | |
242 | in an aggregate does not cause this License to apply to the other | |
243 | parts of the aggregate. | |
244 | ||
245 | 6. Conveying Non-Source Forms. | |
246 | ||
247 | You may convey a covered work in object code form under the terms | |
248 | of sections 4 and 5, provided that you also convey the | |
249 | machine-readable Corresponding Source under the terms of this License, | |
250 | in one of these ways: | |
251 | ||
252 | a) Convey the object code in, or embodied in, a physical product | |
253 | (including a physical distribution medium), accompanied by the | |
254 | Corresponding Source fixed on a durable physical medium | |
255 | customarily used for software interchange. | |
256 | ||
257 | b) Convey the object code in, or embodied in, a physical product | |
258 | (including a physical distribution medium), accompanied by a | |
259 | written offer, valid for at least three years and valid for as | |
260 | long as you offer spare parts or customer support for that product | |
261 | model, to give anyone who possesses the object code either (1) a | |
262 | copy of the Corresponding Source for all the software in the | |
263 | product that is covered by this License, on a durable physical | |
264 | medium customarily used for software interchange, for a price no | |
265 | more than your reasonable cost of physically performing this | |
266 | conveying of source, or (2) access to copy the | |
267 | Corresponding Source from a network server at no charge. | |
268 | ||
269 | c) Convey individual copies of the object code with a copy of the | |
270 | written offer to provide the Corresponding Source. This | |
271 | alternative is allowed only occasionally and noncommercially, and | |
272 | only if you received the object code with such an offer, in accord | |
273 | with subsection 6b. | |
274 | ||
275 | d) Convey the object code by offering access from a designated | |
276 | place (gratis or for a charge), and offer equivalent access to the | |
277 | Corresponding Source in the same way through the same place at no | |
278 | further charge. You need not require recipients to copy the | |
279 | Corresponding Source along with the object code. If the place to | |
280 | copy the object code is a network server, the Corresponding Source | |
281 | may be on a different server (operated by you or a third party) | |
282 | that supports equivalent copying facilities, provided you maintain | |
283 | clear directions next to the object code saying where to find the | |
284 | Corresponding Source. Regardless of what server hosts the | |
285 | Corresponding Source, you remain obligated to ensure that it is | |
286 | available for as long as needed to satisfy these requirements. | |
287 | ||
288 | e) Convey the object code using peer-to-peer transmission, provided | |
289 | you inform other peers where the object code and Corresponding | |
290 | Source of the work are being offered to the general public at no | |
291 | charge under subsection 6d. | |
292 | ||
293 | A separable portion of the object code, whose source code is excluded | |
294 | from the Corresponding Source as a System Library, need not be | |
295 | included in conveying the object code work. | |
296 | ||
297 | A "User Product" is either (1) a "consumer product", which means any | |
298 | tangible personal property which is normally used for personal, family, | |
299 | or household purposes, or (2) anything designed or sold for incorporation | |
300 | into a dwelling. In determining whether a product is a consumer product, | |
301 | doubtful cases shall be resolved in favor of coverage. For a particular | |
302 | product received by a particular user, "normally used" refers to a | |
303 | typical or common use of that class of product, regardless of the status | |
304 | of the particular user or of the way in which the particular user | |
305 | actually uses, or expects or is expected to use, the product. A product | |
306 | is a consumer product regardless of whether the product has substantial | |
307 | commercial, industrial or non-consumer uses, unless such uses represent | |
308 | the only significant mode of use of the product. | |
309 | ||
310 | "Installation Information" for a User Product means any methods, | |
311 | procedures, authorization keys, or other information required to install | |
312 | and execute modified versions of a covered work in that User Product from | |
313 | a modified version of its Corresponding Source. The information must | |
314 | suffice to ensure that the continued functioning of the modified object | |
315 | code is in no case prevented or interfered with solely because | |
316 | modification has been made. | |
317 | ||
318 | If you convey an object code work under this section in, or with, or | |
319 | specifically for use in, a User Product, and the conveying occurs as | |
320 | part of a transaction in which the right of possession and use of the | |
321 | User Product is transferred to the recipient in perpetuity or for a | |
322 | fixed term (regardless of how the transaction is characterized), the | |
323 | Corresponding Source conveyed under this section must be accompanied | |
324 | by the Installation Information. But this requirement does not apply | |
325 | if neither you nor any third party retains the ability to install | |
326 | modified object code on the User Product (for example, the work has | |
327 | been installed in ROM). | |
328 | ||
329 | The requirement to provide Installation Information does not include a | |
330 | requirement to continue to provide support service, warranty, or updates | |
331 | for a work that has been modified or installed by the recipient, or for | |
332 | the User Product in which it has been modified or installed. Access to a | |
333 | network may be denied when the modification itself materially and | |
334 | adversely affects the operation of the network or violates the rules and | |
335 | protocols for communication across the network. | |
336 | ||
337 | Corresponding Source conveyed, and Installation Information provided, | |
338 | in accord with this section must be in a format that is publicly | |
339 | documented (and with an implementation available to the public in | |
340 | source code form), and must require no special password or key for | |
341 | unpacking, reading or copying. | |
342 | ||
343 | 7. Additional Terms. | |
344 | ||
345 | "Additional permissions" are terms that supplement the terms of this | |
346 | License by making exceptions from one or more of its conditions. | |
347 | Additional permissions that are applicable to the entire Program shall | |
348 | be treated as though they were included in this License, to the extent | |
349 | that they are valid under applicable law. If additional permissions | |
350 | apply only to part of the Program, that part may be used separately | |
351 | under those permissions, but the entire Program remains governed by | |
352 | this License without regard to the additional permissions. | |
353 | ||
354 | When you convey a copy of a covered work, you may at your option | |
355 | remove any additional permissions from that copy, or from any part of | |
356 | it. (Additional permissions may be written to require their own | |
357 | removal in certain cases when you modify the work.) You may place | |
358 | additional permissions on material, added by you to a covered work, | |
359 | for which you have or can give appropriate copyright permission. | |
360 | ||
361 | Notwithstanding any other provision of this License, for material you | |
362 | add to a covered work, you may (if authorized by the copyright holders of | |
363 | that material) supplement the terms of this License with terms: | |
364 | ||
365 | a) Disclaiming warranty or limiting liability differently from the | |
366 | terms of sections 15 and 16 of this License; or | |
367 | ||
368 | b) Requiring preservation of specified reasonable legal notices or | |
369 | author attributions in that material or in the Appropriate Legal | |
370 | Notices displayed by works containing it; or | |
371 | ||
372 | c) Prohibiting misrepresentation of the origin of that material, or | |
373 | requiring that modified versions of such material be marked in | |
374 | reasonable ways as different from the original version; or | |
375 | ||
376 | d) Limiting the use for publicity purposes of names of licensors or | |
377 | authors of the material; or | |
378 | ||
379 | e) Declining to grant rights under trademark law for use of some | |
380 | trade names, trademarks, or service marks; or | |
381 | ||
382 | f) Requiring indemnification of licensors and authors of that | |
383 | material by anyone who conveys the material (or modified versions of | |
384 | it) with contractual assumptions of liability to the recipient, for | |
385 | any liability that these contractual assumptions directly impose on | |
386 | those licensors and authors. | |
387 | ||
388 | All other non-permissive additional terms are considered "further | |
389 | restrictions" within the meaning of section 10. If the Program as you | |
390 | received it, or any part of it, contains a notice stating that it is | |
391 | governed by this License along with a term that is a further | |
392 | restriction, you may remove that term. If a license document contains | |
393 | a further restriction but permits relicensing or conveying under this | |
394 | License, you may add to a covered work material governed by the terms | |
395 | of that license document, provided that the further restriction does | |
396 | not survive such relicensing or conveying. | |
397 | ||
398 | If you add terms to a covered work in accord with this section, you | |
399 | must place, in the relevant source files, a statement of the | |
400 | additional terms that apply to those files, or a notice indicating | |
401 | where to find the applicable terms. | |
402 | ||
403 | Additional terms, permissive or non-permissive, may be stated in the | |
404 | form of a separately written license, or stated as exceptions; | |
405 | the above requirements apply either way. | |
406 | ||
407 | 8. Termination. | |
408 | ||
409 | You may not propagate or modify a covered work except as expressly | |
410 | provided under this License. Any attempt otherwise to propagate or | |
411 | modify it is void, and will automatically terminate your rights under | |
412 | this License (including any patent licenses granted under the third | |
413 | paragraph of section 11). | |
414 | ||
415 | However, if you cease all violation of this License, then your | |
416 | license from a particular copyright holder is reinstated (a) | |
417 | provisionally, unless and until the copyright holder explicitly and | |
418 | finally terminates your license, and (b) permanently, if the copyright | |
419 | holder fails to notify you of the violation by some reasonable means | |
420 | prior to 60 days after the cessation. | |
421 | ||
422 | Moreover, your license from a particular copyright holder is | |
423 | reinstated permanently if the copyright holder notifies you of the | |
424 | violation by some reasonable means, this is the first time you have | |
425 | received notice of violation of this License (for any work) from that | |
426 | copyright holder, and you cure the violation prior to 30 days after | |
427 | your receipt of the notice. | |
428 | ||
429 | Termination of your rights under this section does not terminate the | |
430 | licenses of parties who have received copies or rights from you under | |
431 | this License. If your rights have been terminated and not permanently | |
432 | reinstated, you do not qualify to receive new licenses for the same | |
433 | material under section 10. | |
434 | ||
435 | 9. Acceptance Not Required for Having Copies. | |
436 | ||
437 | You are not required to accept this License in order to receive or | |
438 | run a copy of the Program. Ancillary propagation of a covered work | |
439 | occurring solely as a consequence of using peer-to-peer transmission | |
440 | to receive a copy likewise does not require acceptance. However, | |
441 | nothing other than this License grants you permission to propagate or | |
442 | modify any covered work. These actions infringe copyright if you do | |
443 | not accept this License. Therefore, by modifying or propagating a | |
444 | covered work, you indicate your acceptance of this License to do so. | |
445 | ||
446 | 10. Automatic Licensing of Downstream Recipients. | |
447 | ||
448 | Each time you convey a covered work, the recipient automatically | |
449 | receives a license from the original licensors, to run, modify and | |
450 | propagate that work, subject to this License. You are not responsible | |
451 | for enforcing compliance by third parties with this License. | |
452 | ||
453 | An "entity transaction" is a transaction transferring control of an | |
454 | organization, or substantially all assets of one, or subdividing an | |
455 | organization, or merging organizations. If propagation of a covered | |
456 | work results from an entity transaction, each party to that | |
457 | transaction who receives a copy of the work also receives whatever | |
458 | licenses to the work the party's predecessor in interest had or could | |
459 | give under the previous paragraph, plus a right to possession of the | |
460 | Corresponding Source of the work from the predecessor in interest, if | |
461 | the predecessor has it or can get it with reasonable efforts. | |
462 | ||
463 | You may not impose any further restrictions on the exercise of the | |
464 | rights granted or affirmed under this License. For example, you may | |
465 | not impose a license fee, royalty, or other charge for exercise of | |
466 | rights granted under this License, and you may not initiate litigation | |
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that | |
468 | any patent claim is infringed by making, using, selling, offering for | |
469 | sale, or importing the Program or any portion of it. | |
470 | ||
471 | 11. Patents. | |
472 | ||
473 | A "contributor" is a copyright holder who authorizes use under this | |
474 | License of the Program or a work on which the Program is based. The | |
475 | work thus licensed is called the contributor's "contributor version". | |
476 | ||
477 | A contributor's "essential patent claims" are all patent claims | |
478 | owned or controlled by the contributor, whether already acquired or | |
479 | hereafter acquired, that would be infringed by some manner, permitted | |
480 | by this License, of making, using, or selling its contributor version, | |
481 | but do not include claims that would be infringed only as a | |
482 | consequence of further modification of the contributor version. For | |
483 | purposes of this definition, "control" includes the right to grant | |
484 | patent sublicenses in a manner consistent with the requirements of | |
485 | this License. | |
486 | ||
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free | |
488 | patent license under the contributor's essential patent claims, to | |
489 | make, use, sell, offer for sale, import and otherwise run, modify and | |
490 | propagate the contents of its contributor version. | |
491 | ||
492 | In the following three paragraphs, a "patent license" is any express | |
493 | agreement or commitment, however denominated, not to enforce a patent | |
494 | (such as an express permission to practice a patent or covenant not to | |
495 | sue for patent infringement). To "grant" such a patent license to a | |
496 | party means to make such an agreement or commitment not to enforce a | |
497 | patent against the party. | |
498 | ||
499 | If you convey a covered work, knowingly relying on a patent license, | |
500 | and the Corresponding Source of the work is not available for anyone | |
501 | to copy, free of charge and under the terms of this License, through a | |
502 | publicly available network server or other readily accessible means, | |
503 | then you must either (1) cause the Corresponding Source to be so | |
504 | available, or (2) arrange to deprive yourself of the benefit of the | |
505 | patent license for this particular work, or (3) arrange, in a manner | |
506 | consistent with the requirements of this License, to extend the patent | |
507 | license to downstream recipients. "Knowingly relying" means you have | |
508 | actual knowledge that, but for the patent license, your conveying the | |
509 | covered work in a country, or your recipient's use of the covered work | |
510 | in a country, would infringe one or more identifiable patents in that | |
511 | country that you have reason to believe are valid. | |
512 | ||
513 | If, pursuant to or in connection with a single transaction or | |
514 | arrangement, you convey, or propagate by procuring conveyance of, a | |
515 | covered work, and grant a patent license to some of the parties | |
516 | receiving the covered work authorizing them to use, propagate, modify | |
517 | or convey a specific copy of the covered work, then the patent license | |
518 | you grant is automatically extended to all recipients of the covered | |
519 | work and works based on it. | |
520 | ||
521 | A patent license is "discriminatory" if it does not include within | |
522 | the scope of its coverage, prohibits the exercise of, or is | |
523 | conditioned on the non-exercise of one or more of the rights that are | |
524 | specifically granted under this License. You may not convey a covered | |
525 | work if you are a party to an arrangement with a third party that is | |
526 | in the business of distributing software, under which you make payment | |
527 | to the third party based on the extent of your activity of conveying | |
528 | the work, and under which the third party grants, to any of the | |
529 | parties who would receive the covered work from you, a discriminatory | |
530 | patent license (a) in connection with copies of the covered work | |
531 | conveyed by you (or copies made from those copies), or (b) primarily | |
532 | for and in connection with specific products or compilations that | |
533 | contain the covered work, unless you entered into that arrangement, | |
534 | or that patent license was granted, prior to 28 March 2007. | |
535 | ||
536 | Nothing in this License shall be construed as excluding or limiting | |
537 | any implied license or other defenses to infringement that may | |
538 | otherwise be available to you under applicable patent law. | |
539 | ||
540 | 12. No Surrender of Others' Freedom. | |
541 | ||
542 | If conditions are imposed on you (whether by court order, agreement or | |
543 | otherwise) that contradict the conditions of this License, they do not | |
544 | excuse you from the conditions of this License. If you cannot convey a | |
545 | covered work so as to satisfy simultaneously your obligations under this | |
546 | License and any other pertinent obligations, then as a consequence you may | |
547 | not convey it at all. For example, if you agree to terms that obligate you | |
548 | to collect a royalty for further conveying from those to whom you convey | |
549 | the Program, the only way you could satisfy both those terms and this | |
550 | License would be to refrain entirely from conveying the Program. | |
551 | ||
552 | 13. Use with the GNU Affero General Public License. | |
553 | ||
554 | Notwithstanding any other provision of this License, you have | |
555 | permission to link or combine any covered work with a work licensed | |
556 | under version 3 of the GNU Affero General Public License into a single | |
557 | combined work, and to convey the resulting work. The terms of this | |
558 | License will continue to apply to the part which is the covered work, | |
559 | but the special requirements of the GNU Affero General Public License, | |
560 | section 13, concerning interaction through a network will apply to the | |
561 | combination as such. | |
562 | ||
563 | 14. Revised Versions of this License. | |
564 | ||
565 | The Free Software Foundation may publish revised and/or new versions of | |
566 | the GNU General Public License from time to time. Such new versions will | |
567 | be similar in spirit to the present version, but may differ in detail to | |
568 | address new problems or concerns. | |
569 | ||
570 | Each version is given a distinguishing version number. If the | |
571 | Program specifies that a certain numbered version of the GNU General | |
572 | Public License "or any later version" applies to it, you have the | |
573 | option of following the terms and conditions either of that numbered | |
574 | version or of any later version published by the Free Software | |
575 | Foundation. If the Program does not specify a version number of the | |
576 | GNU General Public License, you may choose any version ever published | |
577 | by the Free Software Foundation. | |
578 | ||
579 | If the Program specifies that a proxy can decide which future | |
580 | versions of the GNU General Public License can be used, that proxy's | |
581 | public statement of acceptance of a version permanently authorizes you | |
582 | to choose that version for the Program. | |
583 | ||
584 | Later license versions may give you additional or different | |
585 | permissions. However, no additional obligations are imposed on any | |
586 | author or copyright holder as a result of your choosing to follow a | |
587 | later version. | |
588 | ||
589 | 15. Disclaimer of Warranty. | |
590 | ||
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY | |
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT | |
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY | |
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, | |
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM | |
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF | |
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. | |
599 | ||
600 | 16. Limitation of Liability. | |
601 | ||
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS | |
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY | |
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE | |
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF | |
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD | |
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), | |
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | |
610 | SUCH DAMAGES. | |
611 | ||
612 | 17. Interpretation of Sections 15 and 16. | |
613 | ||
614 | If the disclaimer of warranty and limitation of liability provided | |
615 | above cannot be given local legal effect according to their terms, | |
616 | reviewing courts shall apply local law that most closely approximates | |
617 | an absolute waiver of all civil liability in connection with the | |
618 | Program, unless a warranty or assumption of liability accompanies a | |
619 | copy of the Program in return for a fee. | |
620 | ||
621 | END OF TERMS AND CONDITIONS | |
622 | ||
623 | How to Apply These Terms to Your New Programs | |
624 | ||
625 | If you develop a new program, and you want it to be of the greatest | |
626 | possible use to the public, the best way to achieve this is to make it | |
627 | free software which everyone can redistribute and change under these terms. | |
628 | ||
629 | To do so, attach the following notices to the program. It is safest | |
630 | to attach them to the start of each source file to most effectively | |
631 | state the exclusion of warranty; and each file should have at least | |
632 | the "copyright" line and a pointer to where the full notice is found. | |
633 | ||
634 | <one line to give the program's name and a brief idea of what it does.> | |
635 | Copyright (C) <year> <name of author> | |
636 | ||
637 | This program is free software: you can redistribute it and/or modify | |
638 | it under the terms of the GNU General Public License as published by | |
639 | the Free Software Foundation, either version 3 of the License, or | |
640 | (at your option) any later version. | |
641 | ||
642 | This program is distributed in the hope that it will be useful, | |
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
645 | GNU General Public License for more details. | |
646 | ||
647 | You should have received a copy of the GNU General Public License | |
648 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
649 | ||
650 | Also add information on how to contact you by electronic and paper mail. | |
651 | ||
652 | If the program does terminal interaction, make it output a short | |
653 | notice like this when it starts in an interactive mode: | |
654 | ||
655 | <program> Copyright (C) <year> <name of author> | |
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
657 | This is free software, and you are welcome to redistribute it | |
658 | under certain conditions; type `show c' for details. | |
659 | ||
660 | The hypothetical commands `show w' and `show c' should show the appropriate | |
661 | parts of the General Public License. Of course, your program's commands | |
662 | might be different; for a GUI interface, you would use an "about box". | |
663 | ||
664 | You should also get your employer (if you work as a programmer) or school, | |
665 | if any, to sign a "copyright disclaimer" for the program, if necessary. | |
666 | For more information on this, and how to apply and follow the GNU GPL, see | |
667 | <http://www.gnu.org/licenses/>. | |
668 | ||
669 | The GNU General Public License does not permit incorporating your program | |
670 | into proprietary programs. If your program is a subroutine library, you | |
671 | may consider it more useful to permit linking proprietary applications with | |
672 | the library. If this is what you want to do, use the GNU Lesser General | |
673 | Public License instead of this License. But first, please read | |
674 | <http://www.gnu.org/philosophy/why-not-lgpl.html>. | |
675 |
0 | 0 | #!/usr/bin/icmake -qt/tmp/yodl |
1 | 1 | |
2 | #include "src/config.h" | |
2 | #include "VERSION" | |
3 | #include "INSTALL.im" | |
3 | 4 | |
4 | void buildIn(string where, string what, string arg) | |
5 | { | |
6 | string cwd; | |
5 | #define COPT "-O2 -Wall" | |
6 | #define STD_CONVERSIONS "html latex man txt xml" | |
7 | #define ECHO_REQUEST 1 | |
7 | 8 | |
8 | cwd = chdir("."); | |
9 | chdir(where); | |
10 | exec("./build", what, arg); | |
11 | chdir(cwd); | |
12 | } | |
9 | string CLASSES; | |
10 | string g_lopt; | |
11 | string g_copt; | |
12 | string g_cwd; | |
13 | string g_wip = "tmp/wip/"; | |
14 | string g_install = "tmp/install/"; | |
15 | string g_include; | |
16 | int g_compiled; | |
17 | int g_nClasses; | |
18 | list g_classes; | |
13 | 19 | |
14 | void cleanup() | |
15 | { | |
16 | buildIn("src", "clean", ""); | |
17 | buildIn("macros", "clean", ""); | |
18 | buildIn("manual", "clean", ""); | |
19 | buildIn("man", "clean", ""); | |
20 | system("rm -f release.yo"); | |
21 | } | |
22 | 20 | |
23 | void buildProgram() | |
24 | { | |
25 | buildIn("src", "progs", ""); // first, create yodl and yodl-post | |
26 | ||
27 | buildIn("macros", "version", ""); // then create the version file | |
28 | buildIn("macros", "std", ""); // and the std conversions | |
29 | } | |
30 | ||
31 | void buildMacroList(string path) | |
32 | { | |
33 | buildIn("manual", "docmacros", path); | |
34 | } | |
35 | ||
36 | void buildMan() | |
37 | { | |
38 | buildIn("man", "man", ""); | |
39 | } | |
40 | ||
41 | void buildManExit(string path) | |
42 | { | |
43 | buildMacroList(path); | |
44 | buildIn("man", "man", path); | |
45 | exit(0); | |
46 | } | |
47 | ||
48 | void buildManual() | |
49 | { | |
50 | buildIn("manual", "manual", ""); | |
51 | } | |
52 | ||
53 | void buildManualExit(string path) | |
54 | { | |
55 | buildMacroList(path); | |
56 | buildIn("manual", "manual", path); | |
57 | exit(0); | |
58 | } | |
59 | ||
60 | void package() | |
61 | { | |
62 | buildProgram(); | |
63 | ||
64 | buildMacroList(""); | |
65 | buildManual(); | |
66 | buildMan(); | |
67 | } | |
68 | ||
69 | void install(string where, string what) | |
70 | { | |
71 | int all; | |
72 | ||
73 | all = what == ""; | |
74 | ||
75 | system("mkdir -p " + where); | |
76 | ||
77 | if (all || what == "program") | |
78 | { | |
79 | buildIn("src", "install", where + "/bin"); | |
80 | buildIn("macros", "install", where + "/share/yodl"); | |
81 | system("mkdir -p " + where + "/share/doc/yodl"); | |
82 | exec("cp", "-r", | |
83 | "AUTHORS.txt changelog contrib CHANGES PATCHES.txt README.txt", | |
84 | where + "/share/doc/yodl"); | |
85 | } | |
86 | ||
87 | if (all || what == "man") | |
88 | buildIn("man", "install", where); | |
89 | ||
90 | if (all || what == "manual") | |
91 | buildIn("manual", "install", where); | |
92 | } | |
21 | #include "icmake/run" | |
22 | #include "icmake/md" | |
23 | #include "icmake/clean" | |
24 | #include "icmake/stdcompile" | |
25 | #include "icmake/compilerss" | |
26 | #include "icmake/builtins" | |
27 | #include "icmake/program" | |
28 | #include "icmake/manualmacrolist" | |
29 | #include "icmake/macros" | |
30 | #include "icmake/man" | |
31 | #include "icmake/manual" | |
32 | #include "icmake/install" | |
93 | 33 | |
94 | 34 | void main(int argc, list argv) |
95 | 35 | { |
96 | 36 | string arg1; |
97 | 37 | |
98 | if (argc == 1) | |
99 | { | |
100 | printf | |
101 | ( | |
102 | "\n" | |
103 | "Build what? Options are:\n" | |
104 | " clean: clean up\n" | |
105 | " install WHERE: install the products under WHERE " | |
106 | "(following `build package')\n" | |
107 | " The Debian installation process will install " | |
108 | "under debian/tmp\n" | |
109 | " install WHERE program: install the program under WHERE\n" | |
110 | " install WHERE man: install the man-pages under WHERE\n" | |
111 | " install WHERE manual: install the manual under WHERE\n" | |
112 | "\n" | |
113 | "All subsequent after `build clean':\n" | |
114 | " program: build the program\n" | |
115 | " man [path]: build the man-pages (yodl in $PATH if " | |
116 | "`path' is provided)\n" | |
117 | " manual [path]: build the manual (yodl in $PATH if " | |
118 | "`path' is provided)\n" | |
119 | " package: build all parts of the package (using ./.../yodl)\n" | |
120 | "\n" | |
121 | ); | |
122 | exit(1); | |
123 | } | |
38 | echo(ECHO_REQUEST); | |
39 | g_cwd = chdir("."); | |
40 | ||
41 | g_copt = COPT + " -g"; | |
42 | ||
43 | #ifdef PROFILING | |
44 | g_copt = COPT + " -pg"; | |
45 | g_lopt = "-pg"; | |
46 | #endif | |
47 | ||
48 | #ifdef EXTENSIVE_OPTIONS | |
49 | g_copt = "-O0 -g3 -ansi -pedantic -fno-common -pipe -W -Wall -Wcast-align" | |
50 | " -Wcast-qual -Wconversion -Wformat=2 -Winline -Wnested-externs" | |
51 | " -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef " | |
52 | "-Wno-unused-parameter -Waggregate-return -Wnested-externs"; | |
53 | #endif | |
54 | ||
55 | setLocations(); | |
124 | 56 | |
125 | 57 | arg1 = argv[1]; |
126 | 58 | |
127 | 59 | if (arg1 == "clean") |
128 | cleanup(); | |
129 | else if (arg1 == "install") | |
130 | install(argv[2], argv[3]); | |
131 | else if (arg1 == "package") | |
132 | package(); | |
133 | else if (arg1 == "man") | |
134 | buildManExit(argv[2]); | |
135 | else if (arg1 == "program") | |
136 | buildProgram(); | |
137 | else if (arg1 == "manual") | |
138 | buildManualExit(argv[2]); | |
139 | else | |
140 | { | |
141 | printf("request `", arg1, "' not yet available\n"); | |
142 | exit(1); | |
143 | } | |
144 | exit(0); | |
60 | cleanupExit(); | |
61 | ||
62 | md(g_install + " " + g_wip); | |
63 | ||
64 | g_include = " -I.:" + g_install + SKEL + ":" + g_wip; | |
65 | ||
66 | ||
67 | echo(OFF); | |
68 | run("rm -f " + g_wip + "release.yo " + g_wip + "config.h"); | |
69 | echo(ON); | |
70 | ||
71 | fprintf(g_wip + "release.yo", "SUBST(_CurVers_)(", VERSION, ")\n", | |
72 | "SUBST(_CurYrs_)(", YEARS, ")\n"); | |
73 | fprintf(g_wip + "config.h", | |
74 | "#define STD_INCLUDE \"", SKEL, "\"\n" | |
75 | "#define VERSION \"" VERSION "\"\n" | |
76 | "#define YEARS \"" YEARS "\"\n" | |
77 | "#define YODL_BIN \"", BIN, "\"\n" | |
78 | ); | |
79 | ||
80 | if (arg1 == "programs") | |
81 | programsExit(argv[2]); | |
82 | ||
83 | if | |
84 | ( | |
85 | arg1 == "yodl" || arg1 == "yodlpost" || arg1 == "yodlverbinsert" || | |
86 | arg1 == "yodlstriproff" || arg1 == "yodl2whatever" || arg1 == "programs" | |
87 | ) | |
88 | programExit(arg1, argv[2]); | |
89 | ||
90 | if (arg1 == "man") | |
91 | manExit(argv[2]); | |
92 | ||
93 | if (arg1 == "macros") | |
94 | macrosExit(); | |
95 | ||
96 | if (arg1 == "manual") | |
97 | manualExit(argv[2]); | |
98 | ||
99 | if (arg1 == "install") | |
100 | installExit(argv[2], argv[3]); | |
101 | ||
102 | printf("Usage: build action\n" | |
103 | "Where `action' is one of:\n" | |
104 | " clean: clean up\n" | |
105 | " programs [strip]: build the programs\n" | |
106 | " yodl [strip]: only build `yodl'\n" | |
107 | " yodlpost [strip]: only build `yodlpost'\n" | |
108 | " yodlverbinsert [strip]: only build `yodlverbinsert'\n" | |
109 | " yodlstriproff: only build `yodlstriproff\n" | |
110 | " yodl2whatever: only build `yodl2whatever\n" | |
111 | " man [path]: build the man-pages\n" | |
112 | " manual [path]: build the manual\n" | |
113 | " macros: build the standard yodl macros\n" | |
114 | " install programs WHERE: install the programs under WHERE\n" | |
115 | " install yodl WHERE: install yodl under WHERE\n" | |
116 | " install yodlpost WHERE: install yodlpost under WHERE\n" | |
117 | " install yodlverbinsert WHERE: install yodlverbinsert under WHERE\n" | |
118 | " install yodlstriproff WHERE: install yodlstriproff under WHERE\n" | |
119 | " install yodl2whatever WHERE: install yodl2whatever c.s. under " | |
120 | "WHERE\n" | |
121 | " install macros WHERE: install the macros under WHERE\n" | |
122 | " install man WHERE: install the man-pages under WHERE\n" | |
123 | " install manual WHERE: install the manual under WHERE\n" | |
124 | " install docs WHERE: install additional docs under " | |
125 | "WHERE\n" | |
126 | "`strip': the program(s) will be stripped,\n" | |
127 | "`path': yodl is located in $PATH (otherwise just-built programs " | |
128 | "are used).\n" | |
129 | ); | |
130 | exit(1); | |
145 | 131 | } |
146 | 132 |
0 | yodl (2.14.3) | |
1 | ||
2 | * Tony Mancill and George Danchev discovered a flaw in the build script: it | |
3 | used previously installed macro files. Now repaired: Installation should | |
4 | run fine on a system not yet supporting Yodl. | |
5 | ||
6 | -- Frank B. Brokken <f.b.brokken@rug.nl> Mon, 27 Apr 2009 20:56:33 +0200 | |
7 | ||
8 | yodl (2.14.2) | |
9 | ||
10 | * Yodl2whatever uses `eval' to call yodl. Without this --define options | |
11 | are not properly recognized | |
12 | ||
13 | * Build script completely rewritten | |
14 | ||
15 | * Added striproff as the script `yodlstriproff', and renamed the manpage | |
16 | accordingly | |
17 | ||
18 | -- Frank B. Brokken <f.b.brokken@rug.nl> Wed, 15 Apr 2009 19:58:05 +0200 | |
19 | ||
0 | 20 | yodl (2.14.1) |
1 | 21 | |
2 | 22 | * Build script allows separate construction of program, man pages and |
0 | yodl (2.14.3-1) unstable; urgency=low | |
1 | ||
2 | * New upstream release (2.14.2-1 not uploaded to the Debian archives due to | |
3 | a bug in the Yodl build-script) | |
4 | ||
5 | -- Frank B. Brokken <f.b.brokken@rug.nl> Tue, 28 Apr 2009 08:21:53 +0200 | |
6 | ||
7 | yodl (2.14.2-1) unstable; urgency=low | |
8 | ||
9 | * New upstream release. | |
10 | * Depends on icmake 7.12.1 | |
11 | ||
12 | -- Frank B. Brokken <f.b.brokken@rug.nl> Thu, 16 Apr 2009 21:23:40 +0200 | |
13 | ||
14 | yodl (2.14.1-2) unstable; urgency=low | |
15 | ||
16 | * Removed cm-super-minimal from Build-Depends-Indep (covered by cm-super) | |
17 | * Modified capitalization of name in Uploaders | |
18 | ||
19 | -- tony mancill <tmancill@debian.org> Mon, 30 Mar 2009 17:10:01 -0700 | |
20 | ||
0 | 21 | yodl (2.14.1-1) unstable; urgency=low |
1 | 22 | |
2 | 23 | [ George Danchev Sat, 21 Mar 2009 20:19:04 +0200 ] |
3 | 3 | Maintainer: Frank B. Brokken <f.b.brokken@rug.nl> |
4 | 4 | Uploaders: Colin Watson <cjwatson@debian.org>, |
5 | 5 | George Danchev <danchev@spnet.net>, |
6 | Tony Mancill <tmancill@debian.org> | |
6 | tony mancill <tmancill@debian.org> | |
7 | 7 | Standards-Version: 3.8.1 |
8 | Build-Depends: debhelper (>= 5), icmake (>= 7.11), mktemp (>= 1.5-9) | |
8 | Build-Depends: debhelper (>= 5), icmake (>= 7.12.1), mktemp (>= 1.5-9) | |
9 | 9 | Build-Depends-Indep: texlive-latex-base, texlive-generic-recommended, |
10 | 10 | texlive-latex-recommended, texlive-fonts-recommended, |
11 | ghostscript, cm-super-minimal, cm-super | |
11 | ghostscript, cm-super | |
12 | 12 | |
13 | 13 | Package: yodl |
14 | 14 | Architecture: any |
3 | 3 | # |
4 | 4 | # This is free software; see the GNU General Public Licence |
5 | 5 | # version 2 or later for copying conditions. There is NO warranty. |
6 | # | |
7 | # Created for Yodl by co-author Jan Nieuwenhuizen <janneke@gnu.org>, | |
8 | # currently maintained by Anthony Fok <foka@debian.org> for Debian GNU/Linux. | |
9 | 6 | # |
10 | 7 | # Modified to suit yodl-2.00 by Frank B. Brokken <f.b.brokken@rc.rug.nl> |
11 | 8 | |
20 | 17 | configure-stamp: |
21 | 18 | dh_testdir |
22 | 19 | # Add here commands to configure the package. |
23 | ||
24 | 20 | touch configure-stamp |
25 | ||
26 | ||
27 | build: build-stamp | |
28 | ||
29 | build-stamp: configure-stamp | |
30 | dh_testdir | |
31 | ||
32 | # Compile the package: | |
33 | ./build program | |
34 | ./build man | |
35 | ||
36 | touch build-stamp | |
37 | 21 | |
38 | 22 | clean: |
39 | 23 | dh_testdir |
44 | 28 | |
45 | 29 | dh_clean build-stamp install-stamp |
46 | 30 | |
31 | build: build-stamp | |
32 | ||
33 | build-stamp: configure-stamp | |
34 | dh_testdir | |
35 | ||
36 | # Compile the package: | |
37 | ./build programs | |
38 | ./build man | |
39 | # ./build macros MUST be the last step in the build process | |
40 | ./build macros | |
41 | ||
42 | touch build-stamp | |
43 | ||
44 | build-indep: | |
45 | ./build manual | |
46 | ||
47 | 47 | install: install-stamp |
48 | 48 | |
49 | 49 | install-stamp: build-stamp |
53 | 53 | dh_installdirs |
54 | 54 | |
55 | 55 | # Install the package below debian/yodl: |
56 | ./build install `pwd`/debian/yodl/usr program | |
57 | ./build install `pwd`/debian/yodl/usr/share/man man | |
56 | ./build install programs debian/yodl | |
57 | ./build install macros debian/yodl | |
58 | ./build install man debian/yodl | |
59 | ./build install docs debian/yodl | |
58 | 60 | |
59 | 61 | touch $@ |
60 | 62 | |
61 | build-indep: | |
62 | ./build manual | |
63 | ||
64 | 63 | install-indep: |
65 | ./build install `pwd`/debian/yodl-doc/usr/share/doc/yodl-doc manual | |
64 | ./build install manual debian/yodl-doc | |
66 | 65 | |
67 | 66 | # Build architecture-independent files here. |
68 | 67 | binary-indep: build-indep install-indep |
99 | 98 | # Update that sum when new _upstream_ releases occur, this |
100 | 99 | # catches silent file content forges at the upstream server side |
101 | 100 | # Archive downloaded from https://www.icce.rug.nl/debian/yodl |
102 | # file: yodl_x.y.z.tar.gz | |
101 | # file: yodl_x.y.z.tar.gz | |
103 | 102 | |
104 | MD5TRUSTED := 7df7e344f2dabd662afc377f6f168578 | |
103 | MD5TRUSTED := 755b4dc3ffbb56e6249d26555670b3de | |
105 | 104 | |
106 | 105 | DEBVERSION:=$(shell head -n 1 debian/changelog | sed -e 's/^[^(]*(\([^)]*\)).*/\1/') |
107 | 106 | UPVERSION:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//' -e 's/.dfsg$$//') |
0 | void remakebuiltins(list files, string builtinsDef) | |
1 | { | |
2 | string file; | |
3 | string dest; | |
4 | int cid; | |
5 | int idx; | |
6 | string gramH; | |
7 | ||
8 | gramH = g_wip + "gram.h"; | |
9 | ||
10 | printf("rebuilding " + builtinsDef + " and " + gramH + "\n"); | |
11 | ||
12 | run("rm -f " + gramH + " " + builtinsDef); | |
13 | ||
14 | fprintf(gramH, | |
15 | "#ifndef GRAM_H_\n", | |
16 | "#define GRAM_H_\n" | |
17 | "/*\n" | |
18 | " Automatically generated by build\n" | |
19 | " Do not edit\n" | |
20 | "*/\n" | |
21 | ); | |
22 | ||
23 | fprintf(builtinsDef, | |
24 | "/*\n" | |
25 | " Automatically generated by build\n" | |
26 | " Do not edit\n" | |
27 | "*/\n" | |
28 | "#include \"gram.h\"\n" | |
29 | "Builtin builtin_array[] = \n" | |
30 | "{\n" | |
31 | ); | |
32 | ||
33 | for (idx = 0; idx < sizeof(files); idx++) | |
34 | { | |
35 | dest = ""; | |
36 | file = change_ext(files[idx], ""); | |
37 | for (cid = 4; cid < strlen(file); cid++) | |
38 | dest += file[cid]; | |
39 | dest = strupr(dest); | |
40 | ||
41 | fprintf(gramH, " void gram_", dest, "(void);\n"); | |
42 | fprintf(builtinsDef, | |
43 | " {\"", dest, "\", gram_", dest, " },\n"); | |
44 | } | |
45 | ||
46 | fprintf(gramH, "#endif\n"); | |
47 | fprintf(builtinsDef, | |
48 | " { 0, 0 }\n" | |
49 | "};\n"); | |
50 | } | |
51 | ||
52 | void buildBuiltins() | |
53 | { | |
54 | string file; | |
55 | list files; | |
56 | int idx; | |
57 | string builtinsDef; | |
58 | ||
59 | builtinsDef = g_wip + "builtins.def"; | |
60 | ||
61 | chdir("src/yodl"); | |
62 | files = makelist("gram*.c"); | |
63 | chdir(g_cwd); | |
64 | ||
65 | for (idx = 0; idx < sizeof(files); idx++) | |
66 | { | |
67 | file = files[idx]; | |
68 | if ("src/yodl/" + file younger builtinsDef) | |
69 | { | |
70 | remakebuiltins(files, builtinsDef); | |
71 | break; | |
72 | } | |
73 | } | |
74 | } |
0 | void compileRSS() | |
1 | { | |
2 | CLASSES += "args builtin chartab counter file hashitem hashmap " | |
3 | "lexer lines macro media message new ostream parser " | |
4 | "postqueue process queue root stack string subst symbol "; | |
5 | ||
6 | g_classes = strtok(CLASSES, " "); // list of classes | |
7 | g_nClasses = sizeof(g_classes); | |
8 | ||
9 | makeLibrary(g_wip + "rss", g_wip + "libyodl.a"); // in stdcompile | |
10 | } | |
11 |
0 | void installYodl2(string where) | |
1 | { | |
2 | list conversions; | |
3 | int idx; | |
4 | ||
5 | conversions = strtok(STD_CONVERSIONS, " "); | |
6 | ||
7 | for (idx = sizeof(conversions); idx--; ) | |
8 | run("ln -sf yodl2whatever " + where + BIN + "/yodl2" + | |
9 | conversions[idx]); | |
10 | ||
11 | run("chmod +x " + where + BIN + "/yodl2*"); | |
12 | } | |
13 | ||
14 | void installYodlConverters(string where) | |
15 | { | |
16 | list conversions; | |
17 | int idx; | |
18 | ||
19 | conversions = (list)"whatever" + strtok(STD_CONVERSIONS, " "); | |
20 | ||
21 | for (idx = sizeof(conversions); idx--; ) | |
22 | run("ln -sf yodlconverters.1 " + where + MAN + "/man1/yodl2" + | |
23 | conversions[idx] + ".1"); | |
24 | } | |
25 | ||
26 | void installExit(string what, string where) | |
27 | { | |
28 | if (what == "programs") | |
29 | { | |
30 | md(where + BIN); | |
31 | run("cp " + g_install + BIN + "/* " + where + BIN); | |
32 | run("chmod +x " + where + BIN + "/yodlstriproff"); | |
33 | installYodl2(where); | |
34 | ||
35 | exit(0); | |
36 | } | |
37 | ||
38 | if (what == "yodl") | |
39 | { | |
40 | md(where + BIN); | |
41 | run("cp " + g_install + BIN + "/yodl " + where + BIN); | |
42 | exit(0); | |
43 | } | |
44 | ||
45 | if (what == "yodlpost") | |
46 | { | |
47 | md(where + BIN); | |
48 | run("cp " + g_install + BIN + "/yodlpost " + where + BIN); | |
49 | exit(0); | |
50 | } | |
51 | ||
52 | if (what == "yodlverbinsert") | |
53 | { | |
54 | md(where + BIN); | |
55 | run("cp " + g_install + BIN + "/yodlverbinsert " + where + BIN); | |
56 | exit(0); | |
57 | } | |
58 | ||
59 | if (what == "yodlstriproff") | |
60 | { | |
61 | md(where + BIN); | |
62 | run("cp " + g_install + BIN + "/yodlstriproff " + where + BIN); | |
63 | run("chmod +x " + where + BIN + "/yodlstriproff"); | |
64 | exit(0); | |
65 | } | |
66 | ||
67 | if (what == "yodl2whatever") | |
68 | { | |
69 | md(where + BIN); | |
70 | run("cp " + g_install + BIN + "/yodl2whatever " + where + BIN); | |
71 | ||
72 | installYodl2(where); | |
73 | exit(0); | |
74 | } | |
75 | ||
76 | if (what == "man") | |
77 | { | |
78 | md(where + MAN); | |
79 | run("cp -r " + g_install + MAN + "/* " + where + MAN); | |
80 | installYodlConverters(where); | |
81 | exit(0); | |
82 | } | |
83 | ||
84 | if (what == "manual") | |
85 | { | |
86 | md(where + DOCDOC); | |
87 | run("cp -r " + g_install + DOCDOC + "/* " + where + DOCDOC); | |
88 | run("cp AUTHORS.txt CHANGES changelog " + where + DOCDOC); | |
89 | exit(0); | |
90 | } | |
91 | ||
92 | if (what == "macros") | |
93 | { | |
94 | md(where + SKEL); | |
95 | run("cp -r " + g_install + SKEL + "/* " + where + SKEL); | |
96 | exit(0); | |
97 | } | |
98 | ||
99 | if (what == "docs") | |
100 | { | |
101 | md(where + DOC); | |
102 | run("cp AUTHORS.txt CHANGES changelog " + where + DOC); | |
103 | exit(0); | |
104 | } | |
105 | } |
0 | void configReplacements(string source, string local) | |
1 | { | |
2 | string dst; | |
3 | ||
4 | source = change_ext(source, ""); | |
5 | dst = g_install + SKEL + "/" + source + ".yo"; | |
6 | ||
7 | run("scripts/configreplacements " + "macros/in/" + source + ".in " + | |
8 | dst + " " + local); | |
9 | } | |
10 | ||
11 | void stdMacros(string local) | |
12 | { | |
13 | list std; | |
14 | int idx; | |
15 | string conversion; | |
16 | ||
17 | std = strtok(STD_CONVERSIONS, " "); | |
18 | ||
19 | for (idx = sizeof(std); idx--; ) | |
20 | run("scripts/createmacros " + g_wip + " " + | |
21 | g_install + SKEL + " " + std[idx] + | |
22 | " " + local); | |
23 | } | |
24 | ||
25 | void buildMacros(string local) | |
26 | { | |
27 | list in; | |
28 | int idx; | |
29 | ||
30 | if | |
31 | ( | |
32 | local == "" && exists("tmp/macros-stamp") | |
33 | || | |
34 | local != "" && exists("tmp/man-macros-stamp") | |
35 | ) | |
36 | return; | |
37 | ||
38 | system("rm -f tmp/macros-stamp tmp/man-macros-stamp"); | |
39 | ||
40 | md(g_install + SKEL); | |
41 | ||
42 | chdir("macros/in"); | |
43 | in = makelist("*.in"); | |
44 | chdir(g_cwd); | |
45 | ||
46 | for (idx = sizeof(in); idx--; ) | |
47 | configReplacements(in[idx], local); | |
48 | ||
49 | stdMacros(local); | |
50 | ||
51 | run("cp -r macros/yodl/* " + g_install + SKEL); | |
52 | ||
53 | ||
54 | if (local == "") | |
55 | run("touch tmp/macros-stamp"); | |
56 | else | |
57 | run("touch tmp/man-macros-stamp"); | |
58 | } | |
59 | ||
60 | ||
61 | void macrosExit() | |
62 | { | |
63 | buildMacros(""); | |
64 | exit(0); | |
65 | } | |
66 | ||
67 | ||
68 | ||
69 | ||
70 |
0 | void man(string source, string nr, int usePath) | |
1 | { | |
2 | string manDst; | |
3 | string nrs; | |
4 | string install; | |
5 | ||
6 | nrs = (string)nr; | |
7 | ||
8 | manDst = g_install + MAN + "/man" + nrs + "/" + source + "." + nrs; | |
9 | ||
10 | run("scripts/configreplacements " + | |
11 | "man/" + source + ".in " + | |
12 | g_wip + "manyo.yo"); | |
13 | ||
14 | // manYo.yo is the file to convert to a man-page | |
15 | ||
16 | if (usePath) | |
17 | run("yodl2man" + g_include + | |
18 | " -o" + manDst + " " | |
19 | "manyo"); | |
20 | else | |
21 | { | |
22 | run(g_install + BIN + "/yodl" + g_include + | |
23 | " -o" + g_wip + "out " | |
24 | "man manyo"); | |
25 | ||
26 | run(g_install + BIN + "/yodlpost " | |
27 | + g_wip + "out.idx " + g_wip + "out " + | |
28 | manDst); | |
29 | } | |
30 | } | |
31 | ||
32 | void manExit(string path) | |
33 | { | |
34 | int usePath; | |
35 | ||
36 | if (exists("tmp/man-stamp")) | |
37 | exit(0); | |
38 | ||
39 | if (exists("tmp/macros-stamp")) | |
40 | system("rm -f tmp/macros-stamp tmp/man-macros-stamp"); | |
41 | ||
42 | buildMacros("./"); | |
43 | manualMacroList(); | |
44 | ||
45 | md(g_install + MAN + "/man1 " + g_install + MAN + "/man7"); | |
46 | ||
47 | usePath = path == "path"; | |
48 | ||
49 | man("yodl", "1", usePath); | |
50 | man("yodlpost", "1", usePath); | |
51 | man("yodlconverters", "1", usePath); | |
52 | man("yodlverbinsert", "1", usePath); | |
53 | man("yodlstriproff", "1", usePath); | |
54 | ||
55 | ||
56 | man("yodlmanpage", "7", usePath); | |
57 | man("yodlletter", "7", usePath); | |
58 | man("yodlmacros", "7", usePath); | |
59 | ||
60 | run("touch tmp/man-stamp"); | |
61 | ||
62 | exit(0); | |
63 | } | |
64 |
0 | void buildManual(string conversion, int usePath) | |
1 | { | |
2 | string include; | |
3 | string manualDst; | |
4 | ||
5 | if (exists("tmp/" + conversion + "-manual-stamp")) | |
6 | return; | |
7 | ||
8 | include = g_include + ":manual/yo"; | |
9 | ||
10 | manualDst = g_install + DOCDOC + "/yodl." + conversion ; | |
11 | ||
12 | if (usePath) | |
13 | run("yodl2" + conversion + include + | |
14 | " -o" + manualDst + | |
15 | " manual"); | |
16 | else | |
17 | { | |
18 | run(g_install + BIN + "/yodl" + include + | |
19 | " -o" + g_wip + "out " + | |
20 | conversion + " manual"); | |
21 | ||
22 | if (conversion == "latex") | |
23 | run("mv " + g_wip + "out " + g_install + DOCDOC + "/yodl.latex"); | |
24 | else | |
25 | run(g_install + BIN + "/yodlpost " | |
26 | + g_wip + "out.idx " + g_wip + "out " + | |
27 | manualDst); | |
28 | } | |
29 | ||
30 | if (conversion == "latex") | |
31 | { | |
32 | chdir(g_install + DOCDOC); | |
33 | ||
34 | runP(P_NOCHECK, "latex yodl.latex"); | |
35 | runP(P_NOCHECK, "latex yodl.latex"); | |
36 | run("latex yodl.latex"); | |
37 | run("rm yodl.aux yodl.log yodl.toc"); | |
38 | ||
39 | run("dvips -o yodl.ps yodl.dvi"); | |
40 | run("ps2pdf yodl.ps yodl.pdf"); | |
41 | chdir(g_cwd); | |
42 | } | |
43 | run("touch tmp/" + conversion + "-manual-stamp"); | |
44 | } | |
45 | ||
46 | void manualExit(string path) | |
47 | { | |
48 | int idx; | |
49 | int usePath; | |
50 | ||
51 | usePath = path == "path"; | |
52 | ||
53 | manualMacroList(); | |
54 | ||
55 | if (exists("tmp/macros-stamp")) | |
56 | system("rm -f tmp/macros-stamp tmp/man-macros-stamp"); | |
57 | ||
58 | buildMacros("./"); | |
59 | ||
60 | md(g_install + DOCDOC); | |
61 | ||
62 | buildManual("html", usePath); | |
63 | buildManual("txt", usePath); | |
64 | buildManual("latex", usePath); | |
65 | ||
66 | exit(0); | |
67 | } |
0 | void manualMacroList() | |
1 | { | |
2 | list raw; | |
3 | int idx; | |
4 | ||
5 | if (exists("tmp/macrolist-stamp")) | |
6 | return; | |
7 | ||
8 | chdir("macros/rawmacros"); | |
9 | ||
10 | raw = makelist("*.raw"); | |
11 | ||
12 | echo(OFF); | |
13 | for (idx = 0; idx < sizeof(raw); idx++) | |
14 | { | |
15 | system("./startdoc.pl " + raw[idx] + " >> " | |
16 | "../../" + g_wip + "macrolist.yo"); | |
17 | printf("."); | |
18 | } | |
19 | echo(ON); | |
20 | ||
21 | chdir(g_cwd); | |
22 | printf("\n"); | |
23 | run("touch tmp/macrolist-stamp"); | |
24 | } | |
25 |
0 | // md: target should be a series of blank-delimited directories to be created | |
1 | // If an element is a whildcard, the directory will always be created, | |
2 | // using mkdir -p. | |
3 | // | |
4 | // uses: run() | |
5 | ||
6 | void md(string target) | |
7 | { | |
8 | int idx; | |
9 | list paths; | |
10 | string dir; | |
11 | ||
12 | paths = strtok(target, " "); | |
13 | ||
14 | for (idx = sizeof(paths); idx--; ) | |
15 | { | |
16 | dir = element(idx, paths); | |
17 | if (!exists(dir)) | |
18 | run("mkdir -p " + dir); | |
19 | } | |
20 | } |
0 | void buildProgram(string program) | |
1 | { | |
2 | std_cpp(g_wip + program, 0, program, ""); | |
3 | link(program); | |
4 | } | |
5 | ||
6 | void programYodl() | |
7 | { | |
8 | buildBuiltins(); | |
9 | buildProgram("yodl"); | |
10 | } | |
11 | ||
12 | void programYodlpost() | |
13 | { | |
14 | buildProgram("yodlpost"); | |
15 | } | |
16 | ||
17 | void programYodlverbinsert() | |
18 | { | |
19 | run(COMPILER + " -o " + g_install + BIN + "/yodlverbinsert " + g_copt + | |
20 | " src/verbinsert/verbinsert.c " + g_lopt); | |
21 | } | |
22 | ||
23 | void program(string target) | |
24 | { | |
25 | md(g_install + BIN); | |
26 | ||
27 | if (target == "programs" || target == "yodlstriproff") | |
28 | run("cp scripts/yodlstriproff " + g_install + BIN); | |
29 | ||
30 | if (target == "programs" || target == "yodl2whatever") | |
31 | run("scripts/configreplacements " + | |
32 | "scripts/yodl2whatever.in " + | |
33 | g_install + BIN + "/yodl2whatever"); | |
34 | ||
35 | if (target == "yodlstriproff" || target == "yodl2whatever") | |
36 | return; | |
37 | ||
38 | compileRSS(); | |
39 | ||
40 | if (target == "programs" || target == "yodl") | |
41 | programYodl(); | |
42 | ||
43 | if (target == "programs" || target == "yodlpost") | |
44 | programYodlpost(); | |
45 | ||
46 | if (target == "programs" || target == "yodlverbinsert") | |
47 | programYodlverbinsert(); | |
48 | ||
49 | } | |
50 | ||
51 | void programExit(string target, string strip) | |
52 | { | |
53 | #ifndef PROFILING | |
54 | if (strip == "strip") | |
55 | g_lopt = "-s"; | |
56 | #endif | |
57 | ||
58 | program(target); | |
59 | exit(0); | |
60 | } | |
61 | ||
62 | void programsExit(string strip) | |
63 | { | |
64 | #ifndef PROFILING | |
65 | if (strip == "strip") | |
66 | g_lopt = "-s"; | |
67 | #endif | |
68 | ||
69 | program("programs"); | |
70 | exit(0); | |
71 | } |
0 | int g_dryrun; // set to 1 if envvar DRYRUN was set in main() | |
1 | ||
2 | ||
3 | void runP(int testValue, string cmd) | |
4 | { | |
5 | if (g_dryrun) | |
6 | printf(cmd, "\n"); | |
7 | else | |
8 | system(testValue, cmd); | |
9 | } | |
10 | ||
11 | void run(string cmd) | |
12 | { | |
13 | runP(P_CHECK, cmd); | |
14 | } |
0 | void link(string program) | |
1 | { | |
2 | exec(COMPILER, "-o", g_install + BIN + "/" + program, | |
3 | g_wip + program + "/*.o", | |
4 | "-L" + g_wip, "-lyodl", g_lopt); | |
5 | } | |
6 | ||
7 | list inspect(string dstPrefix, list srcList, string library) | |
8 | { | |
9 | int idx; | |
10 | string ofile; | |
11 | string file; | |
12 | ||
13 | for (idx = sizeof(srcList); idx--; ) | |
14 | { | |
15 | file = element(idx, srcList); | |
16 | ofile = dstPrefix + change_ext(file, "o"); // make o-filename | |
17 | ||
18 | // A file s must be recompiled if it's newer than its object | |
19 | // file o or newer than its target library l, or if neither o nor l | |
20 | // exist. | |
21 | // Since `a newer b' is true if a is newer than b, or if a exists and | |
22 | // b doesn't exist s must be compiled if s newer o and s newer l. | |
23 | // So, it doesn't have to be compiled if s older o or s older l. | |
24 | // redo if file has changed | |
25 | if (file older ofile || file older library) | |
26 | srcList -= (list)file; | |
27 | } | |
28 | return srcList; | |
29 | } | |
30 | ||
31 | list inspect2(string dstPrefix, list srcList) | |
32 | { | |
33 | int idx; | |
34 | string ofile; | |
35 | string file; | |
36 | ||
37 | for (idx = sizeof(srcList); idx--; ) | |
38 | { | |
39 | file = element(idx, srcList); | |
40 | ofile = dstPrefix + change_ext(file, "o"); // make o-filename | |
41 | ||
42 | // A file s must be recompiled if it's newer than its object | |
43 | // file o | |
44 | ||
45 | if (file older ofile) | |
46 | srcList -= (list)file; | |
47 | } | |
48 | return srcList; | |
49 | } | |
50 | ||
51 | // c_compile: compile all sources in `{srcDir}/{cfiles}', storing the object | |
52 | // files in {oDst}/filename.o | |
53 | void c_compile(string oDst, list cfiles) | |
54 | { | |
55 | int idx; | |
56 | string compdest; | |
57 | string file; | |
58 | ||
59 | compdest = COMPILER + " -c -o " + oDst; | |
60 | ||
61 | for (idx = sizeof(cfiles); idx--; ) | |
62 | { | |
63 | file = cfiles[idx]; | |
64 | g_compiled = 1; | |
65 | run(compdest + change_ext(file, "o") + " " + g_copt + " -c " + file); | |
66 | } | |
67 | } | |
68 | ||
69 | void std_cpp(string oDstDir, int prefix, string srcDir, string library) | |
70 | { | |
71 | list files; | |
72 | ||
73 | chdir("src/" + srcDir); | |
74 | oDstDir = "../../" + oDstDir; | |
75 | md(oDstDir); | |
76 | oDstDir += "/" + (string)prefix; | |
77 | ||
78 | // make list of all files | |
79 | if (library == "") | |
80 | files = inspect2(oDstDir, makelist("*.c")); | |
81 | else | |
82 | files = inspect(oDstDir, makelist("*.c"), g_cwd + library); | |
83 | ||
84 | if (sizeof(files)) | |
85 | { | |
86 | printf("Compiling sources in `src/" + srcDir + "'\n"); | |
87 | c_compile(oDstDir, files); // compile files | |
88 | } | |
89 | ||
90 | chdir(g_cwd); | |
91 | } | |
92 | ||
93 | ||
94 | void static_library(string ofiles, string library) | |
95 | { | |
96 | if (!exists(library) || g_compiled) | |
97 | { | |
98 | run("ar ru " + library + " " + ofiles); | |
99 | run("ranlib " + library); | |
100 | run("rm " + ofiles); | |
101 | } | |
102 | } | |
103 | ||
104 | void makeLibrary(string oDstDir, string library) | |
105 | { | |
106 | int index; | |
107 | ||
108 | g_compiled = 0; | |
109 | ||
110 | md(oDstDir); | |
111 | // compile all files | |
112 | for (index = g_nClasses; index--; ) | |
113 | std_cpp(oDstDir, index, g_classes[index], library); | |
114 | ||
115 | // make the library | |
116 | static_library(oDstDir + "/*.o", library); | |
117 | } | |
118 | ||
119 | ||
120 | ||
121 | ||
122 | ||
123 |
0 | #!/usr/bin/icmake -qt/tmp/yodl | |
1 | ||
2 | #define STD_CONVERSIONS "html latex man txt xml" | |
3 | ||
4 | string bin; | |
5 | string inc; | |
6 | string scripts; | |
7 | string root; | |
8 | string cwd; | |
9 | string yodl; | |
10 | string yodlpost; | |
11 | string config; | |
12 | ||
13 | void preset(string toYodlRoot) | |
14 | { | |
15 | cwd = chdir("."); | |
16 | root = chdir(toYodlRoot); | |
17 | ||
18 | bin = root + "src/bin/"; | |
19 | scripts = root + "scripts/"; | |
20 | ||
21 | config = root + "src/config.h"; | |
22 | yodl = bin + "yodl"; | |
23 | yodlpost = bin + "yodlpost"; | |
24 | inc = ".:" + root + "macros/yodl"; | |
25 | ||
26 | chdir(cwd); | |
27 | } | |
28 | ||
29 | format(string fmt) | |
30 | { | |
31 | exec(scripts + "configreplacements", config, | |
32 | "in/" + fmt + ".in", | |
33 | "yodl/" + fmt + ".yo"); | |
34 | ||
35 | chdir("rawmacros"); | |
36 | system("./create " + fmt); | |
37 | } | |
38 | ||
39 | stdmacros(string series) | |
40 | { | |
41 | list std; | |
42 | int idx; | |
43 | string conversion; | |
44 | ||
45 | std = strtok(series, " "); | |
46 | ||
47 | for (idx = 0; idx < sizeof(std); idx++) | |
48 | { | |
49 | conversion = element(idx, std); | |
50 | format(conversion); | |
51 | chdir(cwd); | |
52 | } | |
53 | } | |
54 | ||
55 | void cleanup() | |
56 | { | |
57 | system("rm -f yodl/*.yo"); | |
58 | } | |
59 | ||
60 | void version() | |
61 | { | |
62 | system("echo \"DEFINESYMBOL\(XXyodlVersion\)\(@VERSION@\)\"" | |
63 | " > yodlversion.in"); | |
64 | system(scripts + "configreplacements " + config + | |
65 | " yodlversion.in yodl/yodlversion.yo"); | |
66 | system("rm -f yodlversion.in"); | |
67 | } | |
68 | ||
69 | void install(string where) | |
70 | { | |
71 | exec("mkdir", "-p", where); | |
72 | exec("cp", "-r", "yodl/*", where); | |
73 | } | |
74 | ||
75 | void main(int argc, list argv) | |
76 | { | |
77 | string arg1; | |
78 | ||
79 | if (argc == 1) | |
80 | { | |
81 | printf("Build what ? Options are:\n" | |
82 | " clean: cleanup\n" | |
83 | " macros name: build the std.name.yo filec\n" | |
84 | " std: build macros for all standard conversions:\n" | |
85 | " html, latex, man, txt (and (experimental) xml)\n" | |
86 | " version: update the yodlversion.yo file to the\n" | |
87 | " current Yodl version\n" | |
88 | ); | |
89 | exit(1); | |
90 | } | |
91 | ||
92 | preset(".."); | |
93 | ||
94 | arg1 = element(1, argv); | |
95 | ||
96 | if (arg1 == "macros") | |
97 | format(element(2, argv)); | |
98 | else if (arg1 == "clean") | |
99 | cleanup(); | |
100 | else if (arg1 == "install") | |
101 | install(element(2, argv)); | |
102 | else if (arg1 == "std") | |
103 | stdmacros(STD_CONVERSIONS); | |
104 | else if (arg1 == "version") | |
105 | version(); | |
106 | else | |
107 | { | |
108 | printf("request `", arg1, "' not yet available\n"); | |
109 | exit(1); | |
110 | } | |
111 | exit(0); | |
112 | } | |
113 | ||
114 | ||
115 | ||
116 | ||
117 | ||
118 |
0 | DEFINESYMBOL(XXyodlVersion)(@VERSION@) |
0 | 0 | <STARTDOC> |
1 | 1 | macro(latexpackage(options)(name)) |
2 | (Include latex package(s), a useful package is, e.g., | |
2 | (Include latex NOEXPAND(package(s)), a useful package is, e.g., | |
3 | 3 | tt(epsf). This command bf(must) appear before the document type is |
4 | 4 | stated by tt(article), tt(report), etc..) |
5 | 5 | <> |
0 | 0 | <STARTDOC> |
1 | 1 | macro(letterto(element)) |
2 | (Adds `element' as an additional line to the address in LaTex() letters.) | |
2 | (Adds `element' as an additional line to the address in LaTeX() letters.) | |
3 | 3 | <> |
4 | 4 | DEFINEMACRO(letterto)(1)(\ |
5 | 5 | <latex> |
0 | 0 | <STARTDOC> |
1 | 1 | macro(mbox()) |
2 | (Unbreakable box in latex(). Other formats may have different opitions on | |
2 | (Unbreakable box in LaTeX(). Other formats may have different opitions on | |
3 | 3 | our unbreakable boxex.) |
4 | 4 | <> |
5 | 5 |
2 | 2 | (Defines the filename extension for encapsulated PostScript figures in LaTeX, |
3 | 3 | defaults to tt(.ps). The dot must be included in t new extension tt(ext). The |
4 | 4 | new extension takes effect starting with a following usage of the tt(figure) |
5 | macro. It is only active in latex(), but otherwise acts identically as | |
5 | macro. It is only active in LaTeX(), but otherwise acts identically as | |
6 | 6 | NOEXPAND(setfigureext()).) |
7 | 7 | <> |
8 | 8 |
0 | 0 | <STARTDOC> |
1 | 1 | macro(setlatexverbchar(char)) |
2 | (Set the char used to quote latex() code(\verb) sequences) | |
2 | (Set the char used to quote LaTeX() code(\verb) sequences) | |
3 | 3 | <> |
4 | 4 | |
5 | 5 | DEFINEMACRO(setlatexverbchar)(1)(\ |
0 | #!/usr/bin/icmake -qt/tmp/yodl | |
1 | ||
2 | string bin; | |
3 | string inc; | |
4 | string scripts; | |
5 | string root; | |
6 | string cwd; | |
7 | string yodl; | |
8 | string yodlpost; | |
9 | string config; | |
10 | string yodlCmd; | |
11 | ||
12 | #include "../src/config.h" | |
13 | ||
14 | void preset(string toYodlRoot) | |
15 | { | |
16 | cwd = chdir("."); | |
17 | root = chdir(toYodlRoot); | |
18 | ||
19 | bin = root + "src/bin/"; | |
20 | scripts = root + "scripts/"; | |
21 | ||
22 | config = root + "src/config.h"; | |
23 | yodl = bin + "yodl"; | |
24 | yodlpost = bin + "yodlpost"; | |
25 | inc = ".:" + root + "macros/yodl"; | |
26 | ||
27 | if (!exists("release.yo")) | |
28 | fprintf("release.yo", "SUBST(_CurVers_)(", TOPLEVEL_VERSION, ")\n", | |
29 | "SUBST(_CurYrs_)(", YODL_YEARS, ")\n"); | |
30 | chdir(cwd); | |
31 | } | |
32 | ||
33 | void run(string source, string nr, int usePath) | |
34 | { | |
35 | exec(scripts + "configreplacements", config, | |
36 | source + ".in", | |
37 | source + ".yo"); | |
38 | ||
39 | ||
40 | exec("mkdir", "-p", nr); | |
41 | ||
42 | if (usePath) | |
43 | exec("yodl2man", "-o", nr + "/" + source + "." + nr, source); | |
44 | else | |
45 | { | |
46 | exec(yodl, "-D", "XXMACROPATH=.", "-I", inc, "-o", "out", "man", | |
47 | source); | |
48 | exec(yodlpost, "out.idx", "out", nr + "/" + source + "." + nr); | |
49 | } | |
50 | ||
51 | exec("rm", "-f", "out", "out.idx", source + ".yo"); | |
52 | } | |
53 | ||
54 | ||
55 | void manpages(string path) | |
56 | { | |
57 | int usePath; | |
58 | ||
59 | usePath = path == "path"; | |
60 | ||
61 | run("yodl", "1", usePath); | |
62 | run("yodlpost", "1", usePath); | |
63 | run("yodlconverters", "1", usePath); | |
64 | run("yodlverbinsert", "1", usePath); | |
65 | ||
66 | run("yodlmanpage", "7", usePath); | |
67 | run("yodlletter", "7", usePath); | |
68 | run("yodlmacros", "7", usePath); | |
69 | run("yodlbuiltins", "7", usePath); | |
70 | } | |
71 | ||
72 | void install(string where) | |
73 | { | |
74 | list l; | |
75 | int idx; | |
76 | ||
77 | exec("mkdir", "-p", where + "/man1", where + "/man7"); | |
78 | exec("cp", "1/*", where + "/man1"); | |
79 | exec("cp", "7/*", where + "/man7"); | |
80 | ||
81 | chdir(where + "/man1"); | |
82 | ||
83 | l = strtok(STD_CONVERSIONS, " "); | |
84 | ||
85 | for (idx = 0; idx < sizeof(l); idx++) | |
86 | exec("ln", "-sf", "yodlconverters.1.gz", | |
87 | "yodl2" + element(idx, l) + ".1.gz"); | |
88 | exec("ln", "-sf", "yodlconverters.1.gz", | |
89 | "yodl2whatever.1.gz"); | |
90 | } | |
91 | ||
92 | void cleanup() | |
93 | { | |
94 | system("rm -rf 1 7 *.yo"); | |
95 | } | |
96 | ||
97 | void main(int argc, list argv) | |
98 | { | |
99 | string arg1; | |
100 | ||
101 | if (argc == 1) | |
102 | { | |
103 | printf | |
104 | ( | |
105 | "\n" | |
106 | "Build what? Options are:\n" | |
107 | " clean: clean up\n" | |
108 | " install where: install in the directory `where'\n" | |
109 | " man [path]: build the manual pages (after `clean')\n" | |
110 | " (with `path': use yodl found in $PATH\n" | |
111 | "\n" | |
112 | ); | |
113 | exit(1); | |
114 | } | |
115 | ||
116 | preset(".."); | |
117 | ||
118 | arg1 = argv[1]; | |
119 | ||
120 | if (arg1 == "man") | |
121 | manpages(argv[2]); | |
122 | else if (arg1 == "clean") | |
123 | cleanup(); | |
124 | else if (arg1 == "install") | |
125 | install(argv[2]); | |
126 | else | |
127 | { | |
128 | printf("request `", arg1, "' not yet available\n"); | |
129 | exit(1); | |
130 | } | |
131 | exit(0); | |
132 | } |
0 | mailto(f.b.brokken@rug.nl) | |
1 | ||
2 | redef(macro)(2)(dit(tt(ARG1)) ARG2) | |
3 | ||
4 | manpage(striproff) | |
5 | (1) | |
6 | (_CurYrs_) | |
7 | (yodl__CurVers_.tar.gz) | |
8 | (Your Own Document Language) | |
9 | ||
10 | manpagename(striproff)(strip ASCII control characters) | |
11 | ||
12 | manpagesynopsis() | |
13 | ||
14 | em(command |) bf(striproff) em(> outputfile) nl() | |
15 | ||
16 | manpagedescription() | |
17 | ||
18 | The bf(striproff) program is a very simple tool to strip ASCII control | |
19 | characters off a stream, so that only `bare' ASCII is left. The stripped | |
20 | control sequences are ^H (backspace) followed by any character; this | |
21 | mechanism is used to underline or boldface text on terminals that support | |
22 | it. | |
23 | ||
24 | bf(striproff) is typically used with the Yodl converters bf(yodl2msless) | |
25 | and bf(yodl2manless). | |
26 | ||
27 | manpageseealso() | |
28 | ||
29 | bf(yodl)(1), | |
30 | bf(yodlbuiltins)(1), | |
31 | bf(yodlconverters)(1), | |
32 | bf(yodlletter)(7), | |
33 | bf(yodlmacros)(7), | |
34 | bf(yodlmanpage)(7), | |
35 | bf(yodlpost)(1), | |
36 | bf(yodlverbinsert)(1). | |
37 | ||
38 | ||
39 | manpagebugs() | |
40 | ||
41 | - | |
42 | ||
43 | manpageauthor() | |
44 | ||
45 | Frank B. Brokken (f.b.brokken@rug.nl), |
0 | 0 | mailto(f.b.brokken@rug.nl) |
1 | 1 | |
2 | includefile(../release.yo) | |
2 | includefile(release.yo) | |
3 | 3 | |
4 | 4 | manpage(yodl) |
5 | 5 | (1) |
25 | 25 | |
26 | 26 | manpageoptions() |
27 | 27 | |
28 | includefile(../manual/yo/userguide/optionlist) | |
28 | includefile(manual/yo/userguide/optionlist) | |
29 | 29 | |
30 | 30 | manpagefiles() |
31 | 31 | |
37 | 37 | |
38 | 38 | manpageseealso() |
39 | 39 | |
40 | bf(striproff)(1), | |
40 | bf(yodlstriproff)(1), | |
41 | 41 | bf(yodl)(1), |
42 | 42 | bf(yodlbuiltins)(1), |
43 | 43 | bf(yodlconverters)(1), |
0 | 0 | mailto(f.b.brokken@rug.nl) |
1 | 1 | |
2 | includefile(../release.yo) | |
2 | includefile(release.yo) | |
3 | 3 | |
4 | 4 | redef(lsect)(2)(label(ARG1)dit(tt(ARG2))) |
5 | 5 | redef(lsubsect)(2)(label(ARG1)dit(tt(ARG2))) |
8 | 8 | redef(ref)(1)(tt([ARG1])) |
9 | 9 | redef(lref)(2)(ARG1 tt([ARG2])) |
10 | 10 | |
11 | setincludepath(.:../macros/yodl:../manual/yo) | |
11 | setincludepath(.:macros/yodl:manual/yo) | |
12 | 12 | |
13 | 13 | manpage(Yodl builtin functions) |
14 | 14 | (7) |
40 | 40 | |
41 | 41 | manpageseealso() |
42 | 42 | |
43 | bf(striproff)(1), | |
43 | bf(yodlstriproff)(1), | |
44 | 44 | bf(yodl)(1), |
45 | 45 | bf(yodlconverters)(1), |
46 | 46 | bf(yodlletter)(7), |
0 | 0 | mailto(f.b.brokken@rug.nl) |
1 | 1 | |
2 | includefile(../release.yo) | |
2 | includefile(release.yo) | |
3 | 3 | |
4 | 4 | manpage(yodlconverters) |
5 | 5 | (1) |
68 | 68 | |
69 | 69 | manpageseealso() |
70 | 70 | |
71 | bf(striproff)(1), | |
71 | bf(yodlstriproff)(1), | |
72 | 72 | bf(yodl)(1), |
73 | 73 | bf(yodlbuiltins)(1), |
74 | 74 | bf(yodlletter)(7), |
0 | 0 | mailto(f.b.brokken@rug.nl) |
1 | 1 | |
2 | includefile(../release.yo) | |
2 | includefile(release.yo) | |
3 | 3 | |
4 | 4 | manpage(yodlletter) |
5 | 5 | (7) |
71 | 71 | manpageseealso() |
72 | 72 | |
73 | 73 | bf(latex)(1), |
74 | bf(striproff)(1), | |
74 | bf(yodlstriproff)(1), | |
75 | 75 | bf(yodl)(1), |
76 | 76 | bf(yodlbuiltins)(1), |
77 | 77 | bf(yodlconverters)(1), |
0 | 0 | mailto(f.b.brokken@rug.nl) |
1 | 1 | |
2 | includefile(../release.yo) | |
2 | includefile(release.yo) | |
3 | 3 | |
4 | 4 | redef(macro)(2)(dit(tt(ARG1)) ARG2) |
5 | 5 | |
23 | 23 | order. |
24 | 24 | |
25 | 25 | description( |
26 | INCLUDEFILE(../manual/yo/macros/macrolist.yo) | |
26 | INCLUDEFILE(macrolist.yo) | |
27 | 27 | ) |
28 | 28 | |
29 | 29 | manpageoptions() |
36 | 36 | |
37 | 37 | manpageseealso() |
38 | 38 | |
39 | bf(striproff)(1), | |
39 | bf(yodlstriproff)(1), | |
40 | 40 | bf(yodl)(1), |
41 | 41 | bf(yodlbuiltins)(1), |
42 | 42 | bf(yodlconverters)(1), |
0 | 0 | mailto(f.b.brokken@rug.nl) |
1 | 1 | |
2 | includefile(../release.yo) | |
2 | includefile(release.yo) | |
3 | 3 | |
4 | 4 | manpage(yodlmanpage) |
5 | 5 | (7) |
72 | 72 | |
73 | 73 | manpageseealso() |
74 | 74 | |
75 | bf(striproff)(1), | |
75 | bf(yodlstriproff)(1), | |
76 | 76 | bf(yodl)(1), |
77 | 77 | bf(yodlbuiltins)(1), |
78 | 78 | bf(yodlconverters)(1), |
0 | 0 | mailto(f.b.brokken@rug.nl) |
1 | 1 | |
2 | includefile(../release.yo) | |
2 | includefile(release.yo) | |
3 | 3 | manpage(yodlpost) |
4 | 4 | (1) |
5 | 5 | (_CurYrs_) |
36 | 36 | |
37 | 37 | manpageseealso() |
38 | 38 | |
39 | bf(striproff)(1), | |
39 | bf(yodlstriproff)(1), | |
40 | 40 | bf(yodl)(1), |
41 | 41 | bf(yodlbuiltins)(1), |
42 | 42 | bf(yodlconverters)(1), |
0 | mailto(f.b.brokken@rug.nl) | |
1 | ||
2 | redef(macro)(2)(dit(tt(ARG1)) ARG2) | |
3 | ||
4 | manpage(yodlstriproff) | |
5 | (1) | |
6 | (_CurYrs_) | |
7 | (yodl__CurVers_.tar.gz) | |
8 | (Your Own Document Language) | |
9 | ||
10 | manpagename(yodlstriproff)(strip ASCII control characters) | |
11 | ||
12 | manpagesynopsis() | |
13 | ||
14 | em(command |) bf(yodlstriproff) em(> outputfile) nl() | |
15 | ||
16 | manpagedescription() | |
17 | ||
18 | The bf(yodlstriproff) program is a very simple tool to strip ASCII control | |
19 | characters off a stream, so that only `bare' ASCII is left. The stripped | |
20 | control sequences are ^H (backspace) followed by any character; this | |
21 | mechanism is used to underline or boldface text on terminals that support | |
22 | it. | |
23 | ||
24 | bf(yodlstriproff) is typically used with the Yodl converters bf(yodl2msless) | |
25 | and bf(yodl2manless). | |
26 | ||
27 | manpageseealso() | |
28 | ||
29 | bf(yodl)(1), | |
30 | bf(yodlbuiltins)(1), | |
31 | bf(yodlconverters)(1), | |
32 | bf(yodlletter)(7), | |
33 | bf(yodlmacros)(7), | |
34 | bf(yodlmanpage)(7), | |
35 | bf(yodlpost)(1), | |
36 | bf(yodlverbinsert)(1). | |
37 | ||
38 | ||
39 | manpagebugs() | |
40 | ||
41 | - | |
42 | ||
43 | manpageauthor() | |
44 | ||
45 | Frank B. Brokken (f.b.brokken@rug.nl), |
0 | 0 | mailto(f.b.brokken@rug.nl) |
1 | 1 | |
2 | includefile(../release.yo) | |
2 | includefile(release.yo) | |
3 | 3 | |
4 | 4 | DEFINEMACRO(lsoption)(3)(\ |
5 | 5 | bf(--ARG1)=tt(ARG3) (bf(-ARG2))\ |
126 | 126 | |
127 | 127 | manpageseealso() |
128 | 128 | |
129 | bf(striproff)(1), | |
129 | bf(yodlstriproff)(1), | |
130 | 130 | bf(yodl)(1), |
131 | 131 | bf(yodlbuiltins)(1), |
132 | 132 | bf(yodlconverters)(1), |
0 | #!/usr/bin/icmake -qt/tmp/yodl | |
1 | ||
2 | string bin; | |
3 | string inc; | |
4 | string scripts; | |
5 | string root; | |
6 | string cwd; | |
7 | string yodl; | |
8 | string yodlpost; | |
9 | string config; | |
10 | int profile; | |
11 | ||
12 | void preset(string toYodlRoot) | |
13 | { | |
14 | cwd = chdir("."); | |
15 | root = chdir(toYodlRoot); | |
16 | ||
17 | bin = root + "src/bin/"; | |
18 | scripts = root + "scripts/"; | |
19 | ||
20 | config = root + "src/config.h"; | |
21 | yodl = bin + "yodl"; | |
22 | yodlpost = bin + "yodlpost"; | |
23 | inc = ".:" + root + "macros/yodl"; | |
24 | ||
25 | chdir(cwd); | |
26 | } | |
27 | ||
28 | void checkProfile() | |
29 | { | |
30 | if (profile) | |
31 | { | |
32 | printf("Pause for profile inspection.\n" | |
33 | "program: src/bin/yodl; profile: manual/yo/gmon.out\n" | |
34 | "Press any key to continue...\n"); | |
35 | getch(); | |
36 | } | |
37 | } | |
38 | ||
39 | void run(string conversion, string source, string destination, int usePath) | |
40 | { | |
41 | if (usePath) | |
42 | exec("yodl2" + conversion, "-o", destination, source); | |
43 | else | |
44 | { | |
45 | exec(yodl, "-D", "XXMACROPATH=.", | |
46 | "-I", inc, "-o", "out", conversion, source); | |
47 | checkProfile(); | |
48 | if (conversion != "latex") | |
49 | exec(yodlpost, "out.idx", "out", destination); | |
50 | else | |
51 | exec("mv", "out", destination); | |
52 | } | |
53 | ||
54 | exec("rm", "-f", "out", "out.idx"); | |
55 | } | |
56 | ||
57 | void manual(string path) | |
58 | { | |
59 | int usePath; | |
60 | ||
61 | usePath = path == "path"; | |
62 | ||
63 | system("mkdir -p html latex pdf ps txt"); | |
64 | ||
65 | chdir("yo"); | |
66 | ||
67 | run("html", "manual", "yodl.html", usePath); | |
68 | exec("mv", "*.html", "../html"); | |
69 | ||
70 | run("txt", "manual", "../txt/yodl.txt", usePath); | |
71 | run("latex","manual", "../latex/yodl.latex", usePath); | |
72 | ||
73 | chdir("../latex"); | |
74 | exec("latex", "yodl.latex"); | |
75 | exec("latex", "yodl.latex"); | |
76 | exec("latex", "yodl.latex"); | |
77 | ||
78 | chdir(".."); | |
79 | exec("dvips", "-o", "ps/yodl.ps", "latex/yodl.dvi"); | |
80 | exec("ps2pdf", "ps/yodl.ps", "pdf/yodl.pdf"); | |
81 | } | |
82 | ||
83 | void cleanup() | |
84 | { | |
85 | system("rm -rf yo/macros/macrolist.yo html latex txt ps pdf"); | |
86 | ||
87 | // system("rm -rf yo/macros/macrolist.yo html latex txt ps"); | |
88 | // printf("WARNING: manual/pdf temporarily not cleaned\n"); | |
89 | } | |
90 | ||
91 | void install(string where) | |
92 | { | |
93 | exec("mkdir", "-p", where); | |
94 | ||
95 | exec("cp", "html/*", "txt/*", "ps/*", "pdf/*", where); | |
96 | exec("cp", "latex/yodl.latex", where); | |
97 | } | |
98 | ||
99 | docmacros() | |
100 | { | |
101 | list raw; | |
102 | int idx; | |
103 | string dest; | |
104 | ||
105 | dest = cwd + "yo/macros/macrolist.yo"; | |
106 | ||
107 | exec("rm", "-f", dest); | |
108 | chdir(root + "macros/rawmacros"); | |
109 | ||
110 | raw = makelist("*.raw"); | |
111 | echo(OFF); | |
112 | for (idx = 0; idx < sizeof(raw); idx++) | |
113 | { | |
114 | system("./startdoc.pl " + element(idx, raw) + " >> " + dest); | |
115 | printf("."); | |
116 | } | |
117 | printf("\n"); | |
118 | } | |
119 | ||
120 | void main(int argc, list argv) | |
121 | { | |
122 | string arg1; | |
123 | ||
124 | if (argc == 1) | |
125 | { | |
126 | printf | |
127 | ( | |
128 | "\n" | |
129 | "Build what? Options are:\n" | |
130 | " clean: clean up\n" | |
131 | " install where: install in the directory `where'\n" | |
132 | " manual [path]: make the manual, provide `path' to create\n" | |
133 | " the manual using yodl found in $PATH\n" | |
134 | " profile: make the manual, pause following `yodl ...' calls\n" | |
135 | " for profile inspection\n" | |
136 | " docmacros: make the yodlmacros document page\n" | |
137 | "\n" | |
138 | ); | |
139 | exit(1); | |
140 | } | |
141 | ||
142 | preset(".."); | |
143 | ||
144 | profile = element(1, argv) == "-DPROFILE"; | |
145 | ||
146 | arg1 = argv[1 + profile]; | |
147 | ||
148 | if (arg1 == "clean") | |
149 | cleanup(); | |
150 | else if (arg1 == "docmacros") | |
151 | docmacros(); | |
152 | else if (arg1 == "install") | |
153 | install(element(2, argv)); | |
154 | else if (arg1 == "manual") | |
155 | manual(argv[2]); | |
156 | else if (arg1 == "profile") | |
157 | { | |
158 | profile = 1; | |
159 | manual(""); | |
160 | } | |
161 | else | |
162 | { | |
163 | printf("request `", arg1, "' not yet available\n"); | |
164 | exit(1); | |
165 | } | |
166 | exit(0); | |
167 | } |
0 | 0 | latexpackage()(a4,epsf) |
1 | 1 | |
2 | 2 | whenlatex(\ |
3 | SETSYMBOL(XXusexlatin)(NOTRANS(\input{../../macros/yodl/xlatin1.tex})) | |
3 | SETSYMBOL(XXusexlatin)(NOTRANS(\input{../../yodl/xlatin1.tex})) | |
4 | 4 | ) |
5 | 5 | |
6 | 6 | SUBST(YODL)(tt(Yodl)) |
29 | 29 | |
30 | 30 | affiliation(Center for Information Technology, University of Groningen) |
31 | 31 | |
32 | report(Yodl 2.xx.yy) | |
32 | report(Yodl SYMBOLVALUE(XXyodlVersion)) | |
33 | 33 | (Frank B. Brokken (f.b.brokken@rug.nl)nl() |
34 | 34 | initially by Karel Kubat) |
35 | 35 | (1996-NOW) |
37 | 37 | chapter(Introduction) |
38 | 38 | INCLUDEFILE(intro/intro) |
39 | 39 | |
40 | sect(What's new in Yodl 2.00?) | |
40 | sect(From 1.xx to 2.00: what's new?) | |
41 | 41 | INCLUDEFILE(new) |
42 | 42 | |
43 | 43 | sect(Why use Yodl?) |
136 | 136 | lsect(MACROLIST)(Predefined macros) |
137 | 137 | INCLUDEFILE(macros/alphabetical) |
138 | 138 | |
139 | INCLUDEFILE(macros/macrolist) | |
139 | INCLUDEFILE(macrolist) COMMENT(Created by build man(ual) in tmp/macroyo) | |
140 | 140 | |
141 | 141 | sect(Conversion-related topics) |
142 | 142 |
0 | 0 | #!/bin/bash |
1 | 1 | |
2 | [ $# != 3 ] && echo "Usage: $0 config.h-path xxx.in xxx.yo" && exit 1 | |
2 | CONFIG="tmp/wip/config.h" | |
3 | 3 | |
4 | CONFIG=$1 | |
5 | shift | |
4 | case $# in | |
5 | (2) | |
6 | STD_INCLUDE=`grep "#define[[:space:]]\+STD_INCLUDE" $CONFIG | \ | |
7 | sed 's,.*STD_INCLUDE[[:space:]]\+\"\([^"]\+\)".*,\1,'` | |
6 | 8 | |
7 | grep "#define[[:space:]]\+STD_INCLUDE" $CONFIG | |
9 | # keep as is | |
10 | ;; | |
11 | ||
12 | (3) | |
13 | STD_INCLUDE=$3 | |
14 | ;; | |
8 | 15 | |
9 | STD_INCLUDE=`grep "#define[[:space:]]\+STD_INCLUDE" $CONFIG | \ | |
10 | sed 's,.*STD_INCLUDE[[:space:]]\+\"\([^"]\+\)".*,\1,'` | |
11 | ||
12 | VERSION=`grep "#define[[:space:]]\+TOPLEVEL_VERSION" $CONFIG | \ | |
13 | sed 's,.*TOPLEVEL_VERSION[[:space:]]\+\"\([^"]\+\)".*,\1,'` | |
16 | (*) | |
17 | echo "Usage: $0 xxx.in xxx.yo [actual-path-to-macro-files]" | |
18 | exit 1 | |
19 | ;; | |
20 | esac | |
14 | 21 | |
15 | 22 | YODL_BIN=`grep "#define[[:space:]]\+YODL_BIN" $CONFIG | \ |
16 | 23 | sed 's,.*YODL_BIN[[:space:]]\+\"\([^"]\+\)".*,\1,'` |
17 | 24 | |
25 | VERSION=`grep "#define[[:space:]]\+VERSION" $CONFIG | \ | |
26 | sed 's,.*VERSION[[:space:]]\+\"\([^"]\+\)".*,\1,'` | |
27 | ||
18 | 28 | sed ' |
19 | 29 | s,@STD_INCLUDE@,'$STD_INCLUDE',g |
30 | s,@YODL_BIN@,'$YODL_BIN',g | |
20 | 31 | s,@VERSION@,'$VERSION',g |
21 | s,@YODL_BIN@,'$YODL_BIN',g | |
22 | 32 | ' $1 > $2 |
23 | 33 | |
24 | 34 |
0 | #!/bin/bash | |
1 | ||
2 | if [ "$#" == "0" ] ; then | |
3 | echo provide WIP path, destination path and requested format | |
4 | exit 1 | |
5 | fi | |
6 | ||
7 | WIP=$1/macros | |
8 | DST=$2 | |
9 | FMT=$3 | |
10 | ||
11 | echo " | |
12 | INCWSLEVEL() | |
13 | ||
14 | DEFINESYMBOL($FMT)() | |
15 | " > $WIP | |
16 | ||
17 | for x in macros/rawmacros/*.raw | |
18 | do | |
19 | scripts/macroseparator.pl $FMT $x >> $WIP | |
20 | done | |
21 | ||
22 | echo "DECWSLEVEL()" >> $WIP | |
23 | ||
24 | scripts/configreplacements $WIP $DST/std.$FMT.yo ./ | |
25 | ||
26 | ||
27 | ||
28 | ||
29 |
0 | #!/usr/bin/perl | |
1 | ||
2 | $target = $ARGV[0]; | |
3 | $file = $ARGV[1]; | |
4 | $copy = 1; | |
5 | $recognized = 0; | |
6 | $closed = 1; | |
7 | $printed = 0; | |
8 | $wslines = 0; | |
9 | ||
10 | ||
11 | open(FILE, "$file"); | |
12 | ||
13 | sub wslines() | |
14 | { | |
15 | return if !$printed; | |
16 | ||
17 | while ($wslines) | |
18 | { | |
19 | print "\n"; | |
20 | $wslines--; | |
21 | } | |
22 | } | |
23 | ||
24 | while ($line = <FILE>) | |
25 | { | |
26 | chomp $line; | |
27 | ||
28 | if ($line =~ /^<.*$target.*>\s*$/c) | |
29 | { | |
30 | $copy = 1; | |
31 | $closed = 0; | |
32 | $recognized = 1; | |
33 | } | |
34 | elsif ($line =~ /^<>\s*$/c) | |
35 | { | |
36 | $copy = 1; | |
37 | $closed = 1; | |
38 | $recognized = 0; | |
39 | } | |
40 | elsif ($line =~ /^<else>\s*$/c) | |
41 | { | |
42 | $closed = 0; | |
43 | $copy = !$recognized; | |
44 | } | |
45 | elsif ($line =~ /^<[^>]+>\s*$/c) | |
46 | { | |
47 | $closed = 0; | |
48 | $copy = 0; | |
49 | } | |
50 | elsif ($copy) | |
51 | { | |
52 | if ( $line =~ /^\s*$/ ) | |
53 | { | |
54 | if ($printed) | |
55 | { | |
56 | $wslines++; | |
57 | } | |
58 | next; | |
59 | } | |
60 | ||
61 | wslines(); | |
62 | print "$line\n"; | |
63 | $printed = 1; | |
64 | } | |
65 | } | |
66 | ||
67 | print "\n"; | |
68 | ||
69 | if (!$closed) | |
70 | { | |
71 | warn "Maybe no close tag <> in $file\n"; | |
72 | } | |
73 | ||
74 | ||
75 |
69 | 69 | if [ "$verbose" = "yes" ]; then |
70 | 70 | echo running "$*" |
71 | 71 | fi |
72 | $* || error "$1 indicates failure!" | |
72 | eval $* || error "$1 indicates failure!" | |
73 | 73 | } |
74 | 74 | |
75 | 75 | ############################################################# Start of script. |
0 | #!/bin/sh | |
1 | # striproff -- strip ascii control characters and page numbers | |
2 | ||
3 | # uniq is not really what we mean, but it removes all the ugly | |
4 | # empty lines, and i can't get sed to understand: | |
5 | # | |
6 | # sed "s/\n\n\n/\n\n/" | |
7 | # | |
8 | # or something like that. | |
9 | ||
10 | NEWLINE="\ | |
11 | " | |
12 | grotty -b -u -o -f | | |
13 | sed "//,/$NEWLINE*[ ]*-[0-9]*-/d" | uniq |
0 | #!/usr/bin/icmake -qt/tmp/yodl | |
1 | ||
2 | // Uncomment the following #define if you want to use the following exensive | |
3 | // set of compilation options: | |
4 | // -O0 -g3 -ansi -pedantic -fno-common -pipe -W -Wall -Wcast-align | |
5 | // -Wcast-qual -Wconversion -Wformat=2 -Winline -Wnested-externs | |
6 | // -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef | |
7 | // -Wno-unused-parameter -Waggregate-return -Wnested-externs | |
8 | // | |
9 | //#define EXTENSIVE_OPTIONS | |
10 | ||
11 | // Alternatively, uncomment the following #define to compile the programs with | |
12 | // the -pg option, so that gprof can be used for profiling purposes. | |
13 | // If neither is defined, COPT is used (see below). If both are defined | |
14 | // EXTENSIVE_OPTIONS is used. | |
15 | // | |
16 | //#define PROFILING | |
17 | ||
18 | ||
19 | string CLASSES; | |
20 | string bin; | |
21 | string inc; | |
22 | string scripts; | |
23 | string root; | |
24 | string cwd; | |
25 | string yodl; | |
26 | string yodlpost; | |
27 | string config; | |
28 | int compiled; | |
29 | ||
30 | #include "config.h" | |
31 | ||
32 | void preset(string toYodlRoot) | |
33 | { | |
34 | cwd = chdir("."); | |
35 | root = chdir(toYodlRoot); | |
36 | ||
37 | bin = root + "src/bin/"; | |
38 | scripts = root + "scripts/"; | |
39 | ||
40 | config = root + "src/config.h"; | |
41 | yodl = bin + "yodl"; | |
42 | yodlpost = bin + "yodlpost"; | |
43 | ||
44 | inc = ".:" + root + "macros/yodl"; | |
45 | ||
46 | chdir(cwd); | |
47 | } | |
48 | ||
49 | ||
50 | void setClasses() | |
51 | { | |
52 | CLASSES += "args builtin chartab counter file hashitem hashmap " | |
53 | "lexer lines macro media message new ostream parser " | |
54 | "postqueue process queue root stack string subst symbol "; | |
55 | } | |
56 | ||
57 | #define COMPILER "gcc" | |
58 | #define COPT "-O2 -Wall" | |
59 | ||
60 | #define ECHO_REQUEST 1 | |
61 | #define GDB "-g" | |
62 | ||
63 | #define LIBS "" | |
64 | ||
65 | // NO CONFIGURABLE PARTS BELOW THIS LINE | |
66 | ||
67 | /* | |
68 | V A R S . I M | |
69 | */ | |
70 | ||
71 | string // contain options for | |
72 | libs, // extra libs, e.g., "-lrss -licce" | |
73 | copt, // Compiler options | |
74 | lopt, // Linker options | |
75 | libxxx, // full library-path | |
76 | sources, // sources to be used | |
77 | current; // contains name of current dir. | |
78 | int | |
79 | nClasses; // number of classes/subdirectories | |
80 | list | |
81 | classes; // list of classes/directories | |
82 | ||
83 | ||
84 | // md: target should be a series of blank-delimited directories to be created | |
85 | // If an element is a whildcard, the directory will always be created, | |
86 | // using mkdir -p. | |
87 | ||
88 | void md(string target) | |
89 | { | |
90 | int idx; | |
91 | list paths; | |
92 | string dir; | |
93 | ||
94 | paths = strtok(target, " "); | |
95 | ||
96 | for (idx = sizeof(paths); idx--; ) | |
97 | { | |
98 | dir = element(idx, paths); | |
99 | if (!exists(dir)) | |
100 | system("mkdir -p " + dir); | |
101 | } | |
102 | } | |
103 | ||
104 | ||
105 | /* | |
106 | I N I T I A L . I M | |
107 | */ | |
108 | void initialize() | |
109 | { | |
110 | echo(ECHO_REQUEST); | |
111 | sources = "*.c"; | |
112 | ||
113 | copt = COPT; | |
114 | lopt = "-s"; | |
115 | ||
116 | #ifdef GDB | |
117 | copt = COPT + " " + GDB; | |
118 | lopt = ""; | |
119 | #endif | |
120 | ||
121 | #ifdef PROFILING | |
122 | copt = COPT + " -pg"; | |
123 | lopt = "-pg"; | |
124 | #endif | |
125 | ||
126 | #ifdef EXTENSIVE_OPTIONS | |
127 | copt = "-O0 -g3 -ansi -pedantic -fno-common -pipe -W -Wall -Wcast-align" | |
128 | " -Wcast-qual -Wconversion -Wformat=2 -Winline -Wnested-externs" | |
129 | " -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef " | |
130 | "-Wno-unused-parameter -Waggregate-return -Wnested-externs"; | |
131 | lopt = "-s"; | |
132 | #endif | |
133 | ||
134 | ||
135 | cwd = chdir("."); | |
136 | ||
137 | setClasses(); // remaining classes | |
138 | ||
139 | classes = strtok(CLASSES, " "); // list of classes | |
140 | ||
141 | nClasses = sizeof(classes); | |
142 | } | |
143 | ||
144 | ||
145 | ||
146 | // c_compile: compile all sources in `{srcDir}/{cfiles}', storing the object | |
147 | // files in {srcDir}/o/{prefix}filename.o | |
148 | // | |
149 | // uses: g_compiler, g_opt, md, run | |
150 | // | |
151 | void c_compile(int prefix, string srcDir, list cfiles) | |
152 | { | |
153 | int idx; | |
154 | string compdest; | |
155 | string file; | |
156 | ||
157 | compdest = COMPILER + " -c -o " + srcDir + "/o/" + (string)prefix; | |
158 | md(srcDir + "/o"); | |
159 | ||
160 | for (idx = sizeof(cfiles); idx--; ) | |
161 | { | |
162 | file = element(idx, cfiles); | |
163 | ||
164 | compiled = 1; | |
165 | system(compdest + change_ext(file, "o") + " " + | |
166 | copt + " " + srcDir + "/" + file); | |
167 | } | |
168 | } | |
169 | ||
170 | ||
171 | list inspect(int prefix, list srcList, string library) | |
172 | { | |
173 | int idx; | |
174 | string ofile; | |
175 | string oprefix; | |
176 | string file; | |
177 | ||
178 | oprefix = "./o/" + (string)prefix; | |
179 | ||
180 | for (idx = sizeof(srcList); idx--; ) | |
181 | { | |
182 | file = element(idx, srcList); | |
183 | ofile = oprefix + change_ext(file, "o"); // make o-filename | |
184 | ||
185 | // A file s must be recompiled if it's newer than its object | |
186 | // file o or newer than its target library l, or if neither o nor l | |
187 | // exist. | |
188 | // Since `a newer b' is true if a is newer than b, or if a exists and | |
189 | // b doesn't exist s must be compiled if s newer o and s newer l. | |
190 | // So, it doesn't have to be compiled if s older o or s older l. | |
191 | // redo if file has changed | |
192 | if (file older ofile || file older library) | |
193 | srcList -= (list)file; | |
194 | } | |
195 | return srcList; | |
196 | } | |
197 | ||
198 | list inspect2(int prefix, list srcList) | |
199 | { | |
200 | int idx; | |
201 | string ofile; | |
202 | string oprefix; | |
203 | string file; | |
204 | ||
205 | oprefix = "./o/" + (string)prefix; | |
206 | ||
207 | for (idx = sizeof(srcList); idx--; ) | |
208 | { | |
209 | file = element(idx, srcList); | |
210 | ofile = oprefix + change_ext(file, "o"); // make o-filename | |
211 | ||
212 | // A file s must be recompiled if it's newer than its object | |
213 | // file o | |
214 | ||
215 | if (file older ofile) | |
216 | srcList -= (list)file; | |
217 | } | |
218 | return srcList; | |
219 | } | |
220 | ||
221 | /* | |
222 | S T D C P P . I M | |
223 | */ | |
224 | ||
225 | void std_cpp(int prefix, string srcDir, string library) | |
226 | { | |
227 | list files; | |
228 | string cwd; | |
229 | ||
230 | chdir(srcDir); | |
231 | // make list of all files | |
232 | if (library == "") | |
233 | files = inspect2(prefix, makelist(sources)); | |
234 | else | |
235 | files = inspect(prefix, makelist(sources), "../" + library); | |
236 | ||
237 | chdir(".."); | |
238 | ||
239 | if (sizeof(files)) | |
240 | c_compile(prefix, srcDir, files); // compile files | |
241 | } | |
242 | ||
243 | ||
244 | void static_library(string ofiles, string library) | |
245 | { | |
246 | if (!exists(library) || compiled) | |
247 | { | |
248 | system("ar ru " + library + " " + ofiles); | |
249 | system("ranlib " + library); | |
250 | system("rm " + ofiles); | |
251 | } | |
252 | } | |
253 | ||
254 | void cpp_make(string library) | |
255 | { | |
256 | int index; | |
257 | ||
258 | compiled = 0; | |
259 | ||
260 | // compile all files | |
261 | for (index = nClasses; index--; ) | |
262 | std_cpp(index, element(index, classes), library); | |
263 | ||
264 | // make the library | |
265 | static_library("*/o/*.o", library); | |
266 | } | |
267 | ||
268 | /* | |
269 | L I N K . I M | |
270 | */ | |
271 | ||
272 | void link(string binary, string library, string ofiles) | |
273 | { | |
274 | exec(COMPILER, "-o", binary, ofiles, library, libs, lopt); | |
275 | } | |
276 | ||
277 | void cpp_program(string dir, string libpath, string binary) | |
278 | { | |
279 | md(get_path(binary)); | |
280 | ||
281 | std_cpp(nClasses, dir, ""); // compile all files | |
282 | link(binary, libpath, dir + "/o/*"); | |
283 | } | |
284 | ||
285 | void remakebuiltins(list files) | |
286 | { | |
287 | string file; | |
288 | string dest; | |
289 | int cid; | |
290 | int idx; | |
291 | ||
292 | printf("rebuilding yodl/builtins.def and yodl/gram.h\n"); | |
293 | ||
294 | system("rm -f gram.h builtins.def o/global.o"); | |
295 | ||
296 | fprintf("gram.h", | |
297 | "#ifndef GRAM_H_\n", | |
298 | "#define GRAM_H_\n" | |
299 | "/*\n" | |
300 | " Automatically generated by make\n" | |
301 | " Do not edit\n" | |
302 | "*/\n" | |
303 | ); | |
304 | ||
305 | fprintf("builtins.def", | |
306 | "/*\n" | |
307 | " Automatically generated by make\n" | |
308 | " Do not edit\n" | |
309 | "*/\n" | |
310 | "#include \"gram.h\"\n" | |
311 | "Builtin builtin_array[] = \n" | |
312 | "{\n" | |
313 | ); | |
314 | ||
315 | for (idx = 0; idx < sizeof(files); idx++) | |
316 | { | |
317 | dest = ""; | |
318 | file = change_ext(element(idx, files), ""); | |
319 | for (cid = 4; cid < strlen(file); cid++) | |
320 | dest += element(cid, file); | |
321 | dest = strupr(dest); | |
322 | ||
323 | fprintf("gram.h", " void gram_", dest, "(void);\n"); | |
324 | fprintf("builtins.def", | |
325 | " {\"", dest, "\", gram_", dest, " },\n"); | |
326 | } | |
327 | ||
328 | fprintf("gram.h", "#endif\n"); | |
329 | fprintf("builtins.def", | |
330 | " { 0, 0 },\n" | |
331 | "};\n"); | |
332 | } | |
333 | ||
334 | void builtins() | |
335 | { | |
336 | string file; | |
337 | list files; | |
338 | int idx; | |
339 | ||
340 | chdir("yodl"); | |
341 | files = makelist("gram*.c"); | |
342 | ||
343 | for (idx = 0; idx < sizeof(files); idx++) | |
344 | { | |
345 | file = element(idx, files); | |
346 | if (file younger "builtins.def") | |
347 | { | |
348 | remakebuiltins(files); | |
349 | break; | |
350 | } | |
351 | } | |
352 | chdir(".."); | |
353 | } | |
354 | ||
355 | void buildyodl() | |
356 | { | |
357 | builtins(); | |
358 | ||
359 | cpp_program("yodl", "libyodl.a", "bin/yodl"); | |
360 | printf("ok: bin/yodl\n"); | |
361 | } | |
362 | ||
363 | void buildhtmlpost() | |
364 | { | |
365 | cpp_program("yodlpost", "libyodl.a", "bin/yodlpost"); | |
366 | printf("ok: bin/yodlpost\n"); | |
367 | } | |
368 | ||
369 | void buildverbinsert() | |
370 | { | |
371 | md("bin"); | |
372 | if ("verbinsert/verbinsert.c" younger "bin/yodlverbinsert") | |
373 | { | |
374 | system(COMPILER " -o bin/yodlverbinsert " | |
375 | + copt + " verbinsert/verbinsert.c " + lopt); | |
376 | printf("ok: bin/yodlverbinsert\n"); | |
377 | } | |
378 | } | |
379 | ||
380 | void install(string where) | |
381 | { | |
382 | list l; | |
383 | int idx; | |
384 | ||
385 | md(where); | |
386 | exec("cp", "bin/yodl", where); | |
387 | exec("cp", "bin/yodlpost", where); | |
388 | exec("cp", "bin/yodlverbinsert", where); | |
389 | ||
390 | exec(scripts + "configreplacements", config, | |
391 | scripts + "/yodl2whatever.in", | |
392 | where + "/yodl2whatever"); | |
393 | exec("chmod", "+x", where + "/yodl2whatever"); | |
394 | ||
395 | l = strtok(STD_CONVERSIONS, " "); | |
396 | ||
397 | chdir(where); | |
398 | for (idx = 0; idx < sizeof(l); idx++) | |
399 | exec("ln", "-sf", "yodl2whatever", "yodl2" + element(idx, l)); | |
400 | } | |
401 | ||
402 | ||
403 | void main(int argc, list argv) | |
404 | { | |
405 | string arg1; | |
406 | ||
407 | initialize(); | |
408 | ||
409 | if (argc == 1) | |
410 | { | |
411 | printf("Build what ? Options are:\n" | |
412 | " clean: rm all libraries and binaries\n" | |
413 | " install <target>: install the binaries in `target'\n" | |
414 | " lib: construct the library\n" | |
415 | " progs: construct all programs (in ./bin)\n" | |
416 | " yodl: construct the yodl program (in ./bin)\n" | |
417 | " yodlpost: construct the post processor (in ./bin)\n" | |
418 | " yodlverbinsert: construct yodlverbinsert (in ./bin)\n"); | |
419 | exit(1); | |
420 | } | |
421 | ||
422 | preset(".."); | |
423 | ||
424 | arg1 = element(1, argv); | |
425 | ||
426 | if (arg1 == "clean") | |
427 | system("rm -rf bin libyodl.a */o"); | |
428 | else if (arg1 == "lib") | |
429 | cpp_make("libyodl.a"); | |
430 | else if (arg1 == "yodl") | |
431 | { | |
432 | cpp_make("libyodl.a"); | |
433 | buildyodl(); | |
434 | } | |
435 | else if (arg1 == "yodlpost") | |
436 | { | |
437 | cpp_make("libyodl.a"); | |
438 | buildhtmlpost(); | |
439 | } | |
440 | else if (arg1 == "yodlverbinsert") | |
441 | { | |
442 | buildverbinsert(); | |
443 | } | |
444 | else if (arg1 == "progs") | |
445 | { | |
446 | cpp_make("libyodl.a"); | |
447 | buildyodl(); | |
448 | buildhtmlpost(); | |
449 | buildverbinsert(); | |
450 | } | |
451 | else if (arg1 == "install") | |
452 | install(element(2, argv)); | |
453 | else | |
454 | { | |
455 | printf("request `", arg1, "' not supported\n"); | |
456 | exit(1); | |
457 | } | |
458 | ||
459 | exit(0); | |
460 | } |
0 | /* Yodl version */ | |
1 | #ifndef TOPLEVEL_VERSION | |
2 | #define TOPLEVEL_VERSION "2.14.1" | |
3 | #endif | |
0 | #ifndef _INCLUDED_CONFIG_H_ | |
1 | #define _INCLUDED_CONFIG_H_ | |
4 | 2 | |
5 | #define YODL_YEARS "1996-2009" | |
3 | #include "../tmp/wip/config.h" | |
6 | 4 | |
7 | 5 | /* |
8 | 6 | For the "INCLUDEFILE(filename)" macro and for filenames on the command |
30 | 28 | #define DEFAULT_MAX_NESTED_FILES 20 |
31 | 29 | #define DEFAULT_MAX_REPLACEMENTS 1 |
32 | 30 | |
33 | /* | |
34 | The macro INCLUDEFILE(file) will search for `file' as-is, or in a | |
35 | system-wide library directory. What's your default system-wide directory | |
36 | for include files? This symbol should be set by the top-level Makefile. | |
37 | Edit that file (in this directory) before changing it here. | |
38 | */ | |
39 | #ifndef STD_INCLUDE | |
40 | #define STD_INCLUDE "/usr/share/yodl" | |
41 | 31 | #endif |
42 | 32 | |
43 | /* | |
44 | Standard conversions: | |
45 | Yodl's standard conversion types | |
46 | */ | |
47 | #define STD_CONVERSIONS "html latex man txt xml" | |
48 | 33 | |
49 | ||
50 | /* | |
51 | Location of the binaries: where will the binaries eventually be stored? | |
52 | Under Debian it will be /usr/bin | |
53 | */ | |
54 | #define YODL_BIN "/usr/bin" |
2 | 2 | char const *message_version() |
3 | 3 | { |
4 | 4 | snprintf(m_version, SIZEOF_VERSION, "%s version %s\n", |
5 | m_message.d_program_name, TOPLEVEL_VERSION); | |
5 | m_message.d_program_name, VERSION); | |
6 | 6 | |
7 | 7 | return m_version; |
8 | 8 | } |
0 | #!/usr/bin/icmake -qt/tmp/yodl | |
1 | ||
2 | void main(int argc, list argv) | |
3 | { | |
4 | string arg1; | |
5 | ||
6 | if (argc == 1) | |
7 | { | |
8 | printf("Build what ? Options are:\n" | |
9 | " clean: rm all yodlpost object files\n" | |
10 | " yodl: construct the Yodl program (in ../bin)\n" | |
11 | "\n" | |
12 | ); | |
13 | exit(1); | |
14 | } | |
15 | ||
16 | arg1 = element(1, argv); | |
17 | if (arg1 == "clean") | |
18 | system("rm -f builtins.def o/*"); | |
19 | else if (arg1 == "yodl") | |
20 | { | |
21 | chdir(".."); | |
22 | system("build yodl"); | |
23 | } | |
24 | else | |
25 | { | |
26 | printf("request `", arg1, "' not available\n"); | |
27 | exit(1); | |
28 | } | |
29 | ||
30 | exit(0); | |
31 | } | |
32 | ||
33 | ||
34 | ||
35 | ||
36 | ||
37 |
0 | /* | |
1 | Automatically generated by make | |
2 | Do not edit | |
3 | */ | |
4 | #include "gram.h" | |
5 | Builtin builtin_array[] = | |
6 | { | |
7 | {"ADDTOCOUNTER", gram_ADDTOCOUNTER }, | |
8 | {"ADDTOSYMBOL", gram_ADDTOSYMBOL }, | |
9 | {"ATEXIT", gram_ATEXIT }, | |
10 | {"CHAR", gram_CHAR }, | |
11 | {"CHDIR", gram_CHDIR }, | |
12 | {"COMMENT", gram_COMMENT }, | |
13 | {"COUNTERVALUE", gram_COUNTERVALUE }, | |
14 | {"DECWSLEVEL", gram_DECWSLEVEL }, | |
15 | {"DEFINECHARTABLE", gram_DEFINECHARTABLE }, | |
16 | {"DEFINECOUNTER", gram_DEFINECOUNTER }, | |
17 | {"DEFINEMACRO", gram_DEFINEMACRO }, | |
18 | {"DEFINESYMBOL", gram_DEFINESYMBOL }, | |
19 | {"DELETECHARTABLE", gram_DELETECHARTABLE }, | |
20 | {"DELETECOUNTER", gram_DELETECOUNTER }, | |
21 | {"DELETEMACRO", gram_DELETEMACRO }, | |
22 | {"DELETENOUSERMACRO", gram_DELETENOUSERMACRO }, | |
23 | {"DELETESYMBOL", gram_DELETESYMBOL }, | |
24 | {"DUMMY", gram_DUMMY }, | |
25 | {"ENDDEF", gram_ENDDEF }, | |
26 | {"ERROR", gram_ERROR }, | |
27 | {"EVAL", gram_EVAL }, | |
28 | {"FILENAME", gram_FILENAME }, | |
29 | {"FPUTS", gram_FPUTS }, | |
30 | {"IFBUILTIN", gram_IFBUILTIN }, | |
31 | {"IFCHARTABLE", gram_IFCHARTABLE }, | |
32 | {"IFCOUNTER", gram_IFCOUNTER }, | |
33 | {"IFDEF", gram_IFDEF }, | |
34 | {"IFEMPTY", gram_IFEMPTY }, | |
35 | {"IFEQUAL", gram_IFEQUAL }, | |
36 | {"IFGREATER", gram_IFGREATER }, | |
37 | {"IFMACRO", gram_IFMACRO }, | |
38 | {"IFSMALLER", gram_IFSMALLER }, | |
39 | {"IFSTREQUAL", gram_IFSTREQUAL }, | |
40 | {"IFSTRSUB", gram_IFSTRSUB }, | |
41 | {"IFSYMBOL", gram_IFSYMBOL }, | |
42 | {"IFZERO", gram_IFZERO }, | |
43 | {"INCLUDEFILE", gram_INCLUDEFILE }, | |
44 | {"INCLUDELIT", gram_INCLUDELIT }, | |
45 | {"INCWSLEVEL", gram_INCWSLEVEL }, | |
46 | {"INTERNALINDEX", gram_INTERNALINDEX }, | |
47 | {"NEWCOUNTER", gram_NEWCOUNTER }, | |
48 | {"NOEXPAND", gram_NOEXPAND }, | |
49 | {"NOEXPANDINCLUDE", gram_NOEXPANDINCLUDE }, | |
50 | {"NOEXPANDPATHINCLUDE", gram_NOEXPANDPATHINCLUDE }, | |
51 | {"NOTRANS", gram_NOTRANS }, | |
52 | {"NOUSERMACRO", gram_NOUSERMACRO }, | |
53 | {"OUTBASE", gram_OUTBASE }, | |
54 | {"OUTDIR", gram_OUTDIR }, | |
55 | {"OUTFILENAME", gram_OUTFILENAME }, | |
56 | {"PIPETHROUGH", gram_PIPETHROUGH }, | |
57 | {"POPCHARTABLE", gram_POPCHARTABLE }, | |
58 | {"POPCOUNTER", gram_POPCOUNTER }, | |
59 | {"POPMACRO", gram_POPMACRO }, | |
60 | {"POPSYMBOL", gram_POPSYMBOL }, | |
61 | {"POPWSLEVEL", gram_POPWSLEVEL }, | |
62 | {"PUSHCHARTABLE", gram_PUSHCHARTABLE }, | |
63 | {"PUSHCOUNTER", gram_PUSHCOUNTER }, | |
64 | {"PUSHMACRO", gram_PUSHMACRO }, | |
65 | {"PUSHSYMBOL", gram_PUSHSYMBOL }, | |
66 | {"PUSHWSLEVEL", gram_PUSHWSLEVEL }, | |
67 | {"RENAMEMACRO", gram_RENAMEMACRO }, | |
68 | {"SETCOUNTER", gram_SETCOUNTER }, | |
69 | {"SETSYMBOL", gram_SETSYMBOL }, | |
70 | {"STARTDEF", gram_STARTDEF }, | |
71 | {"SUBST", gram_SUBST }, | |
72 | {"SYMBOLVALUE", gram_SYMBOLVALUE }, | |
73 | {"SYSTEM", gram_SYSTEM }, | |
74 | {"TYPEOUT", gram_TYPEOUT }, | |
75 | {"UNDEFINEMACRO", gram_UNDEFINEMACRO }, | |
76 | {"UPPERCASE", gram_UPPERCASE }, | |
77 | {"USECHARTABLE", gram_USECHARTABLE }, | |
78 | {"USECOUNTER", gram_USECOUNTER }, | |
79 | {"VERBOSITY", gram_VERBOSITY }, | |
80 | {"WARNING", gram_WARNING }, | |
81 | {"WRITEOUT", gram_WRITEOUT }, | |
82 | { 0, 0 }, | |
83 | }; |
0 | 0 | #include "global.h" |
1 | 1 | |
2 | #include "builtins.def" /* req'd by builtin_array[], def'd here */ | |
2 | #include "../../tmp/wip/builtins.def" /* required by builtin_array[], */ | |
3 | /* created by `build programs' or */ | |
4 | /* `build yodl' */ | |
3 | 5 | |
4 | 6 | HashMap symtab; |
5 | 7 | Ostream outs; |
0 | #ifndef GRAM_H_ | |
1 | #define GRAM_H_ | |
2 | /* | |
3 | Automatically generated by make | |
4 | Do not edit | |
5 | */ | |
6 | void gram_ADDTOCOUNTER(void); | |
7 | void gram_ADDTOSYMBOL(void); | |
8 | void gram_ATEXIT(void); | |
9 | void gram_CHAR(void); | |
10 | void gram_CHDIR(void); | |
11 | void gram_COMMENT(void); | |
12 | void gram_COUNTERVALUE(void); | |
13 | void gram_DECWSLEVEL(void); | |
14 | void gram_DEFINECHARTABLE(void); | |
15 | void gram_DEFINECOUNTER(void); | |
16 | void gram_DEFINEMACRO(void); | |
17 | void gram_DEFINESYMBOL(void); | |
18 | void gram_DELETECHARTABLE(void); | |
19 | void gram_DELETECOUNTER(void); | |
20 | void gram_DELETEMACRO(void); | |
21 | void gram_DELETENOUSERMACRO(void); | |
22 | void gram_DELETESYMBOL(void); | |
23 | void gram_DUMMY(void); | |
24 | void gram_ENDDEF(void); | |
25 | void gram_ERROR(void); | |
26 | void gram_EVAL(void); | |
27 | void gram_FILENAME(void); | |
28 | void gram_FPUTS(void); | |
29 | void gram_IFBUILTIN(void); | |
30 | void gram_IFCHARTABLE(void); | |
31 | void gram_IFCOUNTER(void); | |
32 | void gram_IFDEF(void); | |
33 | void gram_IFEMPTY(void); | |
34 | void gram_IFEQUAL(void); | |
35 | void gram_IFGREATER(void); | |
36 | void gram_IFMACRO(void); | |
37 | void gram_IFSMALLER(void); | |
38 | void gram_IFSTREQUAL(void); | |
39 | void gram_IFSTRSUB(void); | |
40 | void gram_IFSYMBOL(void); | |
41 | void gram_IFZERO(void); | |
42 | void gram_INCLUDEFILE(void); | |
43 | void gram_INCLUDELIT(void); | |
44 | void gram_INCWSLEVEL(void); | |
45 | void gram_INTERNALINDEX(void); | |
46 | void gram_NEWCOUNTER(void); | |
47 | void gram_NOEXPAND(void); | |
48 | void gram_NOEXPANDINCLUDE(void); | |
49 | void gram_NOEXPANDPATHINCLUDE(void); | |
50 | void gram_NOTRANS(void); | |
51 | void gram_NOUSERMACRO(void); | |
52 | void gram_OUTBASE(void); | |
53 | void gram_OUTDIR(void); | |
54 | void gram_OUTFILENAME(void); | |
55 | void gram_PIPETHROUGH(void); | |
56 | void gram_POPCHARTABLE(void); | |
57 | void gram_POPCOUNTER(void); | |
58 | void gram_POPMACRO(void); | |
59 | void gram_POPSYMBOL(void); | |
60 | void gram_POPWSLEVEL(void); | |
61 | void gram_PUSHCHARTABLE(void); | |
62 | void gram_PUSHCOUNTER(void); | |
63 | void gram_PUSHMACRO(void); | |
64 | void gram_PUSHSYMBOL(void); | |
65 | void gram_PUSHWSLEVEL(void); | |
66 | void gram_RENAMEMACRO(void); | |
67 | void gram_SETCOUNTER(void); | |
68 | void gram_SETSYMBOL(void); | |
69 | void gram_STARTDEF(void); | |
70 | void gram_SUBST(void); | |
71 | void gram_SYMBOLVALUE(void); | |
72 | void gram_SYSTEM(void); | |
73 | void gram_TYPEOUT(void); | |
74 | void gram_UNDEFINEMACRO(void); | |
75 | void gram_UPPERCASE(void); | |
76 | void gram_USECHARTABLE(void); | |
77 | void gram_USECOUNTER(void); | |
78 | void gram_VERBOSITY(void); | |
79 | void gram_WARNING(void); | |
80 | void gram_WRITEOUT(void); | |
81 | #endif |
8 | 8 | fprintf (stderr, "%s%s", |
9 | 9 | "Yodl -- Your Own Document Language\n" |
10 | 10 | "\n" |
11 | "Copyright (c) " YODL_YEARS " by Frank B. Brokken (f.b.brokken@rug.nl)\n" | |
11 | "Copyright (c) " YEARS " by Frank B. Brokken (f.b.brokken@rug.nl)\n" | |
12 | 12 | " 1996-2004: also Karel Kubat; Jan Nieuwenhuizen\n" |
13 | 13 | "\n" |
14 | 14 | " This program is free software; you can redistribute it and/or\n" |
24 | 24 | #include "../file/file.h" |
25 | 25 | #include "../symbol/symbol.h" |
26 | 26 | |
27 | ||
28 | #include "gram.h" /* defines all `void gram_...() functions */ | |
27 | #include "../../tmp/wip/gram.h" /* defines all `void gram_...() functions */ | |
28 | /* created by `build programs' or */ | |
29 | /* `build yodl' */ | |
29 | 30 | |
30 | 31 | void add_user_macros(void); |
31 | 32 | void add_user_symbols(void); |
0 | #!/usr/bin/icmake -qt/tmp/yodl | |
1 | ||
2 | void main(int argc, list argv) | |
3 | { | |
4 | string arg1; | |
5 | ||
6 | if (argc == 1) | |
7 | { | |
8 | printf("Build what ? Options are:\n" | |
9 | " clean: rm all yodlpost object files\n" | |
10 | " post: construct the post processor (in ../bin)\n" | |
11 | "\n" | |
12 | ); | |
13 | exit(1); | |
14 | } | |
15 | ||
16 | arg1 = element(1, argv); | |
17 | if (arg1 == "clean") | |
18 | system("rm -f o/*"); | |
19 | else if (arg1 == "post") | |
20 | { | |
21 | chdir(".."); | |
22 | system("build post"); | |
23 | } | |
24 | else | |
25 | { | |
26 | printf("request `", arg1, "' not available\n"); | |
27 | exit(1); | |
28 | } | |
29 | ||
30 | exit(0); | |
31 | } | |
32 | ||
33 | ||
34 | ||
35 | ||
36 | ||
37 |