File: icmake.1

package info (click to toggle)
icmake 6.22-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,120 kB
  • ctags: 1,045
  • sloc: ansic: 9,241; makefile: 1,138; asm: 126; sh: 124
file content (416 lines) | stat: -rw-r--r-- 12,634 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
.TH "icmake" "1" "Nov\&. 1999" "icmake" "icmake-X\&.YY\&.tar\&.gz" 
.SH "NAME" 
icmake \- an alternative to \fImake\fP
.SH "SYNOPSIS" 
.PP 
icmake [flags] source[\&.im] [dest[\&.bim]] [-- [args]]
.PP 
.SH "OPTIONS" 
.PP 
.IP o 
flags:  optional flags:
.IP o 
\fI-a\fP: information about ICMAKE
.IP o 
\fI-b\fP: blunt execution of the destinationfile
.IP o 
\fI-c\fP: the destination file is compiled
.IP o 
\fI-i file\fP: \'file\': name of source, end of icmake arguments
.IP o 
\fI-o file\fP: all icmake output is redirected to `file\' (Not
implemented on unix platforms)   
.IP o 
\fI-p\fP: only the preprocessor is activated
.IP o 
\fI-q\fP: quiet mode: copyright banner not displayed
.IP o 
\fI-t file\fP: \'file\' is used as a temporary bim-file, to be
removed on exit\&. Argument processing stops\&.
.IP o 
\fIsource\fP: make description source file (default extension: \&.im)
.IP o 
\fIdest\fP:   binary make file             (default:    source\&.bim)
.IP o 
\fI--\fP:   optional icmake-file arguments separator
.IP o 
\fIargs\fP:  optional arguments following -- received by
the icmake file in its argv-list
With \fIicmun\fP:
.br 
em (icmun bimfile)
.IP o 
bimfile: file to unassemble
.PP 
.SH "DESCRIPTION" 
.PP 
\fIicmake\fP is a program that can be used as an alternative to
\fImake\fP\&. \fIIcmake\fP is a shell program, normally calling the following
programs:
.IP o 
\fIicm-pp\fP    to preprocess the icmake file 
.IP o 
\fIicm-comp\fP   to compile the icmake file to byte-code
.IP o 
\fIicm-exec\fP   to interpret the byte-code file
The program \fIicmun\fP may be used to disassemble the compiled 
byte-code file\&.
.PP 
.IP o 
\fISyntax elements of the icmake file\fP:
.IP 
.IP o 
Preprocessor directives:
    
.nf 
 

    // comment              : comment until end-of-line
    /* comment */           : comment between /* and */
    #include "filename"     : includes a file
    #include <filename>     : includes a file from directory
                              pointed to by IM variable
    #define ident redef     : defines ident to expand to redef
    #! \&.\&.\&.                  : ignored line
    
.fi 
 

Note: 
.IP 
.IP o 
Any character on a line beyond an \fI#include \&.\&.\&.\fP directive
is ignored\&.
.IP o 
Comment in a \fI#define\fP is removed, but must given be on 
one line\&.
.IP o 
\fI#!\fP may be used on unix platforms to use icmake-shell
scripts, in combination with the -i or -t flags\&.
.IP 
E\&.g\&., if the first line of an (executable) icmakefile \'icm\'
(without extension) contains
centt(#! /usr/bin/icmake -qi)
then \'icm\' may be given as a command, thus executing
centt(/usr/bin/icmake -qi icm \&.\&.\&.)
Alternatively, 
centt(#! /usr/bin/icmake -qt /tmp/icm)
can be used, executing
centt(#! /usr/bin/icmake -qt /tmp/icm icm \&.\&.\&.)
In this case the binary makefile is not kept, but a
temporary file \fI/tmp/icm\&.PID\fP
is used and removed on exit\&. The
PID extension being the process-id of the icmake program
executing icm\&.
.IP 
.IP o 
Types and variables:
    
.nf 
 

int             (-0x8000\&.\&.0x7fff or \'x\', x: ASCII character)
string          (a piece of text)
list            (a number of strings)
void            (may be used for user-defined functions)
    
.fi 
 

Global and local variables are supported, as well as arguments
to user-defined functions\&.
.IP o 
Escape sequences in strings:
    
.nf 
 

\ea \eb \ef \en \er \et
    
.fi 
 

Other escape-sequences \fI\x\fP is interpreted as a literal \fIx\fP 
(e\&.g\&., use \fI\\\fP for \fI\\fP)\&. 
.IP o 
Flow control statements:
    
.nf 
 

    if (condition) statement
    if (condition) statement else statement
    for (init; condition; increment) statement 
    return (expression) - no (expression) with void functions
    break
    exit (expression)
    
.fi 
 
    
With the \fIfor\fP statement, init, condition and increment are optional\&.
With \fIvoid\fP functions, the \fIreturn\fP statement must not have a trailing
expression\&. In those cases use \fIreturn;\fP
.IP o 
The user-defined function main():
.IP 
Arguments may be (int argc, list argv, list envp)
or a subset of those, similar to C\&.
.IP 
Argc is the number of elements in argv\&.
.IP 
Argv holds the arguments, with element 0 the \&.bim filename,
element 1 the first argument etc\&.
.IP 
Envp holds the environment, element 0 is the first variable,
element 1 its value, element 2 the second variable,
element 3 its value, etc\&.
.IP o 
Operators:
.IP 
The ternary C-operator  ?:  is not supported\&.
.IP 
All other arithmetic operators of C are supported, operating
on int-operands\&.
.IP 
Operators available for string-operands:
        
.nf 
 

a + b           concatenates b to a
+=              concatenation and assignment
== != <= >= < > equality testing
!a              empty string test
a younger b     true if file a is more recent
a older b       true if file b is more recent
a newer b       synonym for younger
        
.fi 
 

Note: Equality testing is also alphabetically, using the
ordering of the ASCII-set\&. Internally \fIstrcmp()\fP
is
used to compare strings\&.
.IP 
Operators available for list-operands:
        
.nf 
 

a + b           merging of lists
a - b           opposite
+= -=           merging/subtraction and assignment
== !=           equality testing
!a              empty list test
        
.fi 
 

.IP 
Typecasts:
.IP 
Strings may be cast to ints and vice versa\&. 
Strings may be cast to lists\&.
.IP 
.IP o 
Predefined symbols:
    
.nf 
 

--------------------------------------------------------------
symbol          1 when defined on the platform \&.\&.\&. otherwise 0
--------------------------------------------------------------
MSDOS           MS-DOS platform (with MSC 7\&.00 compiler)
unix            Unix, usually with GNU\'s gcc compiler
linux           \'386 or \'486 running Linux (usually with gcc)
M_SYSV, M_UNIX  \'386 or \'486 running SCO/Unix (usually with
Microsoft C)
_POSIX_SOURCE   Unix with Posix complient compiler
__hpux          HP-UX, with the native HP compiler
--------------------------------------------------------------
    
.fi 
 

.IP o 
Predefined constants:    
    
.nf 
 

Used with makelist():
---------------------
O_ALL       8           O_FILE      1           O_DIR       2
O_SUBDIR    4

Used with echo():
-----------------
OFF         0           ON          1

Used with execute() and system() etc\&.:
--------------------------------------
P_CHECK     0           P_NOCHECK   1

Used with stat():
-----------------
S_IFCHR     1           S_IFDIR     2           S_IFREG     4
S_IREAD     8           S_IWRITE   16           S_IEXEC    32
    
.fi 
 

.IP o 
Predefined functions:
Note: In parameterlists below, the notation [type = value,] indicates
a default function argument of the indicated type and value\&.
An argument of the indicated type may be prvided to overrule the
default\&.
    
.nf 
 

arghead (string h)
        defines argument head, to be used with execute ()
argtail (string t)
        defines argument tail, to be used with execute ()
int ascii (string s)
        returns first character of \'s\' as an int; e\&.g\&.,
        ascii ("A") gives 65
string ascii (int i)
        returns i as a string, e\&.g\&., ascii (65) gives "A"
string change_base (string file, string newbase)
        changes basename of file, returns changed name
string change_ext (string file, string newext)
        changes extension of file, returns changed name
string change_path (string file, string newpath)
        changes path specification of file, returns changed name
string chdir ([int = P_CHECK,] string newdir)
        changes directory, returns the previous dir\&.
        Use "\&." for newdir to get current working directory\&.
        Use ""  for newdir to get startup working directory\&.
cmdhead (string h)
        defines command head, to be used with execute ()
cmdtail (string t)
        defines command tail, to be used with execute ()
echo (int opt)
        sets re-echoing of called programs, OFF for no echo 
        (default: ON)
string element (int index, list lst)
        returns index-th string from list
string element (int index, string str)
        returns index-th character from string as a mini-string
exec ([int = P_CHECK,] string cmd, \&.\&.\&.)
        runs command with arguments\&.
execute ([int = P_CHECK,] string cmd, string cmdhd, 
            string arghd, \&.\&.\&., string argtl, string cmdtl)
        same as exec(), except for command head/tail and argument
        head/tail\&. The actual executed program will start with the
        cmd, followed by the cmdhd\&. Next is a series of arguments,
        all enclosed by arghd and argtl\&. The command terminates 
        with cmdtl\&.
int exists (string file)
        returns non-zero if file exists
list fgets (string file, int offset)
        reads next string from file at offset\&. Return value:
        element(0,retlist) is the read string (including \en),
        element(1,retlist) is the next offset to read\&.
        An empty return list signifies EOF\&.
fprintf (string file, \&.\&.\&.)
        same as printf, but appends to file
string get_base (string file)
        returns basename of file
string get_ext (string file)
        returns extension of file
string getch ()
        returns keypress as mini-string
string get_path (string file)
        returns path of file
int getpid ()
        returns process-id (UNIX) or PSP-paragraph (DOS) of
        icm-exec
string gets ()
        returns string read from keyboard
list makelist ([int = O_FILE,] string mask)
        returns list of all files matching mask
        Use:
            O_ALL     to obtain all directory entries,
            O_DIR     to obtain a list of (sub)directories,
            O_FILE    (default) to obtain a list of only files,
            O_SUBDIR  to obtain a list of only subdirectories\&.
list makelist ([int = O_FILE,] string mask, newer, 
                string comparefile)
        returns list of all files matching mask which are newer
        than the comparefile\&. Operator younger is synonymous to
        newer\&.
list makelist ([int = O_FILE,] string mask, older, 
                string comparefile)
        see above; returns list of files older than the 
        comparefile\&.
list makelist ([int = O_FILE,] string mask, newer, 
                string comparefile)
    returns list of all files matching mask which are newer than
    the comparefile\&. Operator younger is synonymous to newer\&.
list makelist ([int = O_FILE,] string mask, older, string comparefile)
        see above; returns list of files which are older than the
        comparefile\&.
printf (\&.\&.\&.)
        prints arguments to screen
putenv (string)
        adds string to environment (as long as icmake is running)\&.
        Use format: "VAR=value"\&.
int sizeof (list l), int sizeoflist (list l)
        returns number of strings in list
list stat ([int = P_CHECK,] string entry)
        returns \'stat\' information of directory entry \'entry\' as 
        a list\&. The following list-elements are defined:
            Element             Definition
            --------------------------------------
                0               attribute value
                1               size of the file
            --------------------------------------
        Attributes are  returned as bit-flags, composed from the
        following predefined constants:
            -----------------------------------------------------
            S_IFCHR     1       S_IFDIR     2       S_IFREG     4
            S_IREAD     8       S_IWRITE   16       S_IEXEC    32
            -----------------------------------------------------
int strlen (string s)
        returns number of characters in s 
        (as C\'s strlen() function)
string strlwr (string s)
        returns lower-case duplicate of s
string strupr (string s)
        returns upper-case duplicate of s
list strtok (string str, string separators)
        returns list holding substrings of cut-up string
int substr (string big, string small)
        returns index in big where small occurs, or -1 if small 
        does not occur in big
int system ([int = P_CHECK,] string command)
        runs command\&. Return value indicates exit status\&.
    
.fi 
 

.IP 
.SH "FILES" 
-
.SH "SEE ALSO" 
\fBmake(1)\fP
.SH "DIAGNOSTICS" 
-
.SH "BUGS" 
No Documented Bugs\&.
.SH "ORGANIZATION" 
ICCE, University of Groningen\&.
.SH "COPYRIGHT" 
.IP 
This is free software, distributed under the terms of the GNU General
Public License\&.
.IP 
.SH "AUTHOR" 
Frank B\&. Brokken (\fBfrank@icce\&.rug\&.nl\fP)\&.
.IP