.TH "icmake" "1" "1992\-2020" "icmake\&.9\&.03\&.01\&.tar\&.gz" "A program maintenance utility" .PP .SH "NAME" icmake \- A program maintenance (\fImake\fP) utility using a \fBC\fP\-like grammar .PP .SH "SYNOPSIS" \fBicmake\fP [options] \fIsource[\&.im] [dest[\&.bim]]\fP [\-\- [args]] .PP \fBicmun\fP \fIbimfile\fP .PP .SH "DESCRIPTION" .PP \fBIcmake\fP(1) is a generic tool handling program maintenance that can be used as an alternative for \fBmake\fP(1)\&. It\(cq\&s a generic tool in that \fIicmake\fP\-scripts, written in a language closely resembling the \fBC\fP programming language, can perform tasks that are traditionally the domain of scripting languages\&. .PP \fBIcmake\fP allows programmers to use a programming language (closely resembling the well\-known \fBC\fP\-programming language) to define the actions that are required for (complex) program maintenance\&. For this, \fBicmake\fP offers various special operators as well as a set of support functions that have shown their usefulness in program maintenance\&. .PP Although \fBicmake\fP scripts can be written from scratch, often the required activities are highly comparable\&. This observation resulted in the construction of two \fBicmake\fP scripts, which are now part of the standard \fBicmake\fP distribution: \fBicmstart\fP(1), initializing a directory for program development and \fBicmbuild\fP(1), handling the actual program maintenance\&. Both come predefined as scripts tailored to initializing and maintaining \fBC++\fP programs (or, after minimal adaptation, \fBC\fP programs), but can easily be adapted to other programming languages\&. Both \fBicmstart\fP and \fBicmbuild\fP can be run without explicitly calling \fBicmake\fP\&. .PP This man\-page covers \fBicmake\fP (the program), its support programs, and the syntax and facilities offered by \fBicmake\(cq\&s\fP scripting language\&. Refer to the \fBicmstart\fP(1)) man\-page for information about how a directory can be initialized (created) in which (by default) a \fBC++\fP or \fBC\fP program can be developed and refer to the \fBicmbuild\fP(1) man\-page for information about how \fBicmbuild\fP can be used to handle program maintenance\&. .PP \fBIcmake\fP, its support programs, and scripts do not offer an \fIIntegrated Development Environment\fP (IDE)\&. \fBIcmake\fP merely performs tasks for which scripts can be written, and only a minimal set of pre\-defined scripts (\fBicmstart\fP and \fBicmbuild\fP) that repeatedly have shown to be extremely useful when developing and maintaining programs are included in the \fBicmake\fP distribution\&. .PP In its standard operation mode, \fBicmake\fP calls the following programs: .IP o \fIicm\-pp\fP to preprocess the icmake file .IP o \fIicm\-comp\fP to byte\-code compile the \fBicmake\fP \fBs\fP .IP o \fIicm\-dep\fP to handle class\-dependencies (see sections \fBICM\-DEP\fP in this and \fBicmbuild\fP(1)\(cq\&s man\-pages for more information about \fIicm\-dep\fP)\&. .IP o \fIicm\-exec\fP to execute the byte\-code file .PP The program \fBicmun\fP(1) disassembles compiled byte\-code (\&.bim) files\&. \fBIcmun\fP is mainly used for illustration, education, and debugging\&. As it is not required for \fBicmake\fP\(cq\&s daily use it is not installed in a standard \fIPATH\fP directory but (since \fBicmake\(cq\&s\fP version 9\&.02\&.00) in \fIicmake\(cq\&s\fP \fIlib\fP directory, which commonly is \fI/usr/lib/icmake\fP\&. .PP Traditional make\-utilities recompile sources once header files are modified\&. When developing \fBC++\fP programs this is often a bad idea, as adding a new member to a class does not normally require you to recompile all of the class\(cq\&s source files\&. To handle class dependencies \fBicmbuld\fP(1) may inspect class dependencies, (re)compiling sources of dependent classes whenever necessary\&. By default, class\-dependencies are not interpreted, but this can easily be changed by activating the \fIPRECOMP\fP and/or \fIUSE_ALL\fP defines which are found in the file \fIicmconf\fP\&. Refer to the \fBicmconf\fP(7) man\-page for further details\&. .PP Precompiled header files can also be used\&. Precompiled header files dramatically reduce the time that is required for compiling the source files of classes\&. Refer to the \fBicmconf\fP(7) man\-page (in particular the description of the \fIPRECOMP\fP define) for further details\&. .PP This manpage describes \fBicmake\fP\(cq\&s options in the next section\&. Following that section \fBicmake\fP\(cq\&s \fBC\fP\-like scripting language and support programs are described in the following separate sections: .IP o \fBPREPROCESSOR DIRECTIVES\fP .br \- supported preprocessor directives, like \fI#include\fP and \fI#define\fP; .IP o \fBDATA TYPES\fP .br \- \fIint, list, string\fP, and \fIvoid\fP (for functions); .IP o \fBPREDEFINED CONSTANTS\fP .br \- like \fIO_FILE, OFF\fP, and \fIS_IFREG\fP; .IP o \fBOPERATORS\fP .br \- like \fI+, younger\fP, and casts .IP o \fBFLOW CONTROL\fP .br \- \fIif, for, while\fP, etc\&. (the \fIswitch\fP is not available); .IP o \fBPREDEFINED FUNCTIONS\fP .br \- executing programs, changing directories, operations on \fIstring\fP and \fIlist\fP type variables, etc\&.; .IP o \fBUSER DEFINED FUNCTIONS\fP .br \- at least \fImain\fP, with or without its common parameters \fIargc, argv,\fP and \fIenvp\fP\&. .IP o \fBICM\-DEP\fP .br \- the \fBicm\-dep\fP dependency analyzer\&. .IP o \fBICMUN\fP .br \- a brief section about \fBicmun\fP\&. .PP .SH "OPTIONS" .PP Where available, single letter options are listed between parentheses beyond their associated long\-option variants\&. .PP .IP o \fI\-\-\fP .br This option separates \fBicmake\fP arguments from arguments passed to the \&.bim file\&. .br Arguments beyond \fI\-\-\fP are passed to the \&.bim file as\-is, and are available from the \fIlist argv\fP parameter available from the \fBicmake\fP script\(cq\&s \fImain\fP function\(cq\&s second parameter (see below at section \fBUSER DEFINED FUNCTIONS\fP)\&. For some options (see below) the \fI\-\-\fP separator is not required\&. .IP .IP o \fB\-\-about\fP (\fB\-a\fP) .br Show information about \fBicmake\fP and terminate\&. .IP .IP o \fB\-\-compile\fP (\fB\-c\fP) .br The \fBicmake\fP source file is compiled, generating a \&.bim file\&. .IP .IP o \fB\-\-execute\fP (\fB\-e\fP) .br Execute the \fBicmake\fP \&.bim file, given as \fBicmake\fP\(cq\&s first file argument\&. Any additional arguments are passed to the \&.bim file as\-is, and \fI\-\-\fP should not be specified\&. .IP .IP o \fB\-\-force\fP (\fB\-f\fP) .br The icmake source file is recompiled (even if the \fI\&.bim\fP file is up\-to\-date) either when no other options are specified, or when in combination with options \fI\-\-source\fP and \fI\-\-tmpbin\fP\&. .IP .IP o \fB\-\-help\fP (\fB\-h\fP) .br Provides usage info\&. .IP .IP o \fB\-\-icm\-dep\fP (\fB\-d\fP) .br Calls \fI/usr/lib/icmake/icm\-dep\fP, passing it all remaining arguments\&. If no additional arguments are specified \fIicm\-dep\(cq\&s\fP short usage information is shown to the std\&. output stream\&. See sections \fBICM\-DEP\fP in this and \fBicbuild\fP(1)\(cq\&s man\-pages for more information about the \fIicm\-dep\fP support program\&. An overview of \fIicm\-dep\(cq\&s\fP options follows below, after this overview of \fBicmake\fP\(cq\&s options\&. .IP .IP o \fB\-\-preprocess\fP (\fB\-p\fP) .br The \fBicmake\fP source file is only preprocessed, and the preprocessed file is written to \fBicmake\fP\(cq\&s second file argument (by default \fI`source\(cq\&\&.pim\fP)\&. .IP .IP o \fB\-\-source\fP (\fB\-i\fP) .br The first argument is the \fBicmake\fP source file, the default binary file is constructed if necessary\&. Any additional arguments are passed to the \&.bim file as\-is, and \fI\-\-\fP should not be specified\&. .IP .IP o \fB\-\-summary\fP (\fB\-F\fP) .br The filenames and flags as well as an overview of all actions to be performed by \fBicmake\fP are shown on the standard output stream\&. .IP .IP o \fB\-t\fP \fItmpbim\fP .br The \fItmpbim\fP argument following \fI\-t\fP is the name of a temporary \&.bim file, which is removed after \fBicmake\fP\(cq\&s call\&. When \fI\&.\fP is specified for \fItmpbim\fP then the default temporary directory, followed by \fBicmake\fP\(cq\&s process\-id, followed by \fI\&.bim\fP is used\&. .IP Following the name of the temporary \&.bim file the name of the \fBicmake\fP source script must be specified\&. Any additional arguments are passed to the \&.bim file as\-is, and \fI\-\-\fP should not be specified; After setting the source script file\(cq\&s executable flag (\fIchmod +x script\fP), and providing it with an initial line like this: .nf #!/usr/bin/icmake \-t\&. .fi the \fBicmake\fP script can directly be called: .nf script arg1 arg2 .fi in which case the \fBicmake\fP script \fI`script\(cq\&\fP is executed while it receives the arguments \fIscript arg1 arg2\fP\&. .IP .IP o \fB\-T\fP \fIdirectory\fP .br The specified directory is used to store temporary files\&. E\&.g\&., when compiling an \fBicmake\fP script, the output of \fBicmake\fP\(cq\&s preprocessor is a temporary file which is removed on exit\&. By default \fI/tmp\fP is used, unless \fI/tmp\fP is not a writable directory, in which case the current user\(cq\&s \fI$HOME\fP directory is used\&. Implicit temporary filenames always start with the process id of the current \fBicmake\fP process\&. .IP .IP o \fB\-\-version\fP (\fB\-v\fP) .br Displays \fBicmake\fP\(cq\&s version number\&. .PP .SH "PREPROCESSOR DIRECTIVES" .PP The following preprocessor directives are recognized: .IP o comment: .br standard \fBC\fP comment (everything from \fI/*\fP through \fI*/\fP) as well as comment\-to\-end\-of\-line (line content starting at \fI//\fP) is ignored\&. .IP .IP o Shell startup: The first line of the \fBicmake\fP\-script may start with \fI#!path\fP, where \fIpath\fP defines the absolute location of the \fBicmake\fP program\&. By making the script executable, it can be called without explicitly calling \fBicmake\fP\&. .IP E\&.g\&., if the first line of an (executable) icmakefile \(cq\&icm\(cq\& (without extension) contains .nf #!/usr/bin/icmake \-i .fi then \fIicm\fP may be issued as a command, thus executing .nf /usr/bin/icmake \-i icm \&.\&.\&. .fi Alternatively, .nf #!/usr/bin/icmake \-t /tmp/icm .fi may be used, resulting in the execution of .nf #!/usr/bin/icmake \-t /tmp/icm icm \&.\&.\&. .fi In this case the binary file is removed on exit\&. .IP .IP o \fI#include \(dq\&filename\(dq\&\fP .br The file \fIfilename\fP is included at the location of the directive .IP .IP o \fI#include \fP .br The file \fIfilename\fP is included at the location of the \fI#include\fP directive; \fIfilename\fP is searched in the colon\-separated directories specified by the \fIIM\fP environment variable\&. The first occurrence of \fIfilename\fP in the directories specified by the \fIIM\fP environment variable is used\&. .IP .IP o \fI#define identifier [definition]\fP .br The text \fIidentifier\fP is replaced by \fIdefinition\fP\&. The definition may contain references to already defined identifiers, using the \fI${identifier}\fP format\&. If the \fI${identifier}\fP hasn\(cq\&t been defined (yet), the text \fI${identifier}\fP is literally kept\&. To prevent infinite recursion at most 100 \fI${identifier}\fP replacements are allowed\&. .IP Definitions continue at the next line if the last character on a line is a backslash (\fI\e\fP)\&. (which is not included in the definition)\&. The preprocessor concatenates double\-quuted strings, and double quoted strings may not span multiple lines\&. Multiple blanks (outside of double quoted strings) in definitions are contracted to a single blank space\&. .IP The definition following the \fI#define\(cq\&s\fP identifier is optional\&. If omitted, the macro is defined, so it can be used in \fI#if(n)def\fP directives (see below), but they are not replaced by any text in \fBicmake\fP code statements\&. .IP .IP o \fI#ifdef identifier\fP .br If the \fIidentifier\fP macro was defined the next block of code (until a matching \fI#else\fP or \fI#endif\fP directive was read) is byte\-compiled\&. Otherwise, the block of code is ignored\&. .IP .IP o \fI#ifndef identifier\fP .br If the \fIidentifier\fP macro was \fInot\fP defined the next block of code (until a matching \fI#else\fP or \fI#endif\fP directive was detected) is byte\-compiled\&. Otherwise, the block of code is ignored\&. .IP .IP o \fI#else\fP .br Terminates a \fI#ifdef\fP and \fI#ifndef\fP directive, reversing the acceptance decision about the following code\&. Only one \fI#else\fP directive can be associated with \fI#if(n)def\fP directives\&. .IP .IP o \fI#endif\fP .br Terminates the preprocessor block starting at the matching \fI#ifdef\fP, \fI#ifndef\fP or \fI#else\fP directive\&. The \fI#endif\fP directory and its matching \fI#if(n)def\fP directive must be specified in the same file\&. .IP .IP o \fI#undef identifier\fP .br Remove \fIidentifier\fP from the set of defined symbols\&. This does not affect the specification of any previously defined symbols in which \fIidentifier\(cq\&s\fP definition has been used\&. If \fIidentifier\fP hasn\(cq\&t been defined a warning is issued\&. .PP .SH "DATA TYPES" .PP \fBIcmake\fP supports the following five data and value types: .IP o \fIASCII character constants\fP .br ASCII character constants are individual characters, surrounded by single or double quotes\&. Single characters (e\&.g\&., \fI\(cq\&a\(cq\&\fP) represent the character itself\&. Standard escape sequences (e\&.g\&., \fI\(cq\&\en\(cq\&\fP) are supported and represent their standard converted value (e\&.g\&., \fI\(cq\&\en\(cq\&\fP represents ascii value 10 (decimal))\&. Non\-standard escape sequences (e\&.g\&., \fI\(cq\&\ex\(cq\&\fP) represent the ascii character following the escape character (so \fI\(cq\&\ex\(cq\&\fP equals \fI\(cq\&x\(cq\&\fP)\&. Escape sequences consisting of three octal digits represent the ascii character corresponding to the octal value modulo 256 (e\&.g\&., \fI\(cq\&\e123\(cq\&\fP)\&. Escape sequences consisting of an x followed by two hexadecimal digits represent the ascii character corresponding to the hexadecimal value (e\&.g\&., \fI\(cq\&\exa4\(cq\&\fP)\&. .IP .IP o \fIint\fP .br Integral values, ranging from \fI\-0x8000\fP through \fI0x7fff\fP\&. \fIint\fP constants may be specified as decimal numbers (starting with digits 1 through 9), octal numbers (starting with 0, followed by one or more octal digits) hexadecimal numbers (starting with 0x, followed by one or more hexadecimal digits) or as \fIASCII\fP character constants\&. .IP .IP o \fIstring\fP .br Text values: text (or `string\(cq\&) constants are delimited by double quotes\&. Multiple string constants may be concatenated, but a single string constant may not span multiple lines\&. String constants separated by white space only (i\&.e\&., blanks, newlines, comment) are concatenated and represent one single string constant\&. To indicate an end\-of\-line in a string constant use the \fI\en\fP escape sequence\&. .IP ASCII character constants using double quotes can also be used in arithmetic expressions if one of the operands is an \fIint\fP\&. .IP Likewise, ASCII character constants using single quotes may be used in situations where string operands are expected\&. .IP .IP o \fIlist\fP .br A data structure containing a series of individually accessible \fIstring\fP values\&. When a list contains elements, its first element has index 0\&. .IP List constants can also be defined\&. They consist of comma\-separated strings (which may be \fIstring\fP variables or expressions returning \fIstring\fP values) and are surrounded by square brackets\&. E\&.g\&., .nf list words = [\(dq\&a\(dq\&, \(dq\&list\(dq\&, \(dq\&constant\(dq\&]; .fi .IP .IP o \fIvoid\fP .br Used with function definitions to indicate that the function does not return a value\&. .PP Variables can be defined at the global level as well as inside functions (not only at the top of compound statements but also between statements and in the initialization section of for\-statements)\&. When defined inside functions, the standard \fBC\fP scoping and visibility rules apply\&. Variables are strongly typed, and cannot have type \fIvoid\fP\&. .PP Variables may be initialized when they are defined\&. Initializations are expressions which may use predefined or user\-defined functions, constant values, and values of variables\&. Functions or variables that are used for initialization must be visible at the initialization point\&. .PP .SH "PREDEFINED CONSTANTS" .PP The following predefined \fIint\fP constants are available: .TS tab(~); --- lll --- lll lll lll lll --- lll lll --- lll lll --- lll lll lll lll lll lll --- c. symbol~value~intended for O_ALL~8~makelist O_DIR~2~makelist O_FILE~1~makelist O_SUBDIR~4~makelist OFF~0~echo ON~1~echo P_CHECK~0~system calls P_NOCHECK~1~system calls S_IEXEC~32~stat S_IFCHR~1~stat S_IFDIR~2~stat S_IFREG~4~stat S_IREAD~8~stat S_IWRITE~16~stat .TE .PP The following constants are architecture dependent: .TS tab(~); -- ll -- ll ll ll ll ll ll ll -- c. symbol~1 when defined on the platform, otherwise 0 unix~Unix, usually with GNU\(cq\&s gcc compiler UNIX~may alternatively be available linux~x86 running Linux (usually with gcc) LINUX~may alternatively be available M_SYSV, M_UNIX~x86 running SCO/Unix _POSIX~_SOURCE Unix with Posix compliant compiler __hpux~HP\-UX, with the native HP compiler .TE .PP .SH "OPERATORS" .PP \fBint\-operators:\fP .PP All \fBC\fP operators (including the ternary operator) are available (except for pointer operators, as \fBicmake\fP does not support pointers)\&. They operate like their \fBC\fP\-programming language\(cq\&s counterparts\&. Comparison operators return 1 if the comparison is true, otherwise 0 is returned\&. .PP \fBstring\-operators:\fP .PP For \fIstring\fP variables and/or constants the following operators are available (\fIa\fP and \fIb\fP represent \fIstring\fP variables or constants): .PP .IP o \fIa + b\fP: returns a new \fIstring\fP value containing the concatenation of \fIstring\fP values \fIa\fP and \fIb\fP\&. Note that \fIstring\fP constants may be directly concatetated (without using the \fI+\fP operator), e\&.g\&., the following two lines both define the string \fI\(dq\&hello world\(dq\&\fP: .nf \(dq\&hello \(dq\& \(dq\&world\(dq\& \(dq\&hello \(dq\& + \(dq\&world\(dq\& .fi .IP .IP o \fIa += b\fP: \fIa\fP must be a \fIstring\fP variable, to which the \fIstring\fP variable or value \fIb\fP is appended\&. .IP .IP o string comparisons: operators \fI== != <= >= < > !=\fP and \fI==\fP return 1 if the comparison is true, otherwise 0\&. Ordering comparison operators use the (case sensitive) character ordering defined by the \fIASCII\fP character set\&. .IP .IP o \fI!a\fP: the boolean \fI!\fP (not) operator returns 1 if the \fIstring a\fP is empty, otherwise it returns 0\&. Strings containing white\-space characters are not empty\&. .IP .IP o \fIa younger b, a newer b\fP: returns 1 if file \fIa\fP is more recent than file \fIb\fP\&. E\&.g\&., \fI\(dq\&source\&.cc\(dq\& newer \(dq\&source\&.o\(dq\&\fP\&. The files \fIa\fP and \fIb\fP do not have to exist: .br if both don\(cq\&t exist 0 is returned; .br if \fIa\fP doesn\(cq\&t exist 0 is returned; .br if \fIb\fP doesn\(cq\&t exist, 1 is returned; .br if they are equally old 0 is returned\&. .IP The predefined function \fIexists()\fP (see below, section \fBPREDEFINED FUNCTIONS\fP) can be used to test explicitly whether a file exists\&. .PP .IP o \fIa older b\fP: returns 1 if file \fIa\fP is older than file \fIb\fP\&. E\&.g\&., \fI\(dq\&libprog\&.a\(dq\& older \(dq\&source\&.o\(dq\&\fP\&. The files \fIa\fP and \fIb\fP do not have to exist: .br if both don\(cq\&t exist 0 is returned; .br if \fIa\fP doesn\(cq\&t exist, 1 is returned; .br if \fIb\fP doesn\(cq\&t exist 0 is returned; .br if they are equally old 0 is returned\&. .PP .IP o \fI[]\fP: the index operator retrieves a character from a string variable or constant: it returns a string as an \fIrvalue\fP\&. Thus, the following statement compiles OK: .nf // assume str1 and str2 are strings str1 = str2[3]; .fi but the following statement won\(cq\&t compile: .nf str2[3] = \(dq\&a\(dq\&; .fi If an invalid (out of bounds) index value is specified an empty string is returned\&. .PP .IP o The `backtick` operator (\fI`string cmd`\fP) .br A string placed between two backticks is executed by the \fIpopen\fP(3) function\&. The standard output gererated by the command that is stored in the string argument is returned as a list\&. An empty list indicates that the command could not be executed\&. .br A command that could be executed but did not produce any output returns a list containing one empty element\&. The command\(cq\&s standard error stream output is not collected by the backtick operator\&. However, standard shell redirection may be used to collect the standard error stream\(cq\&s output\&. Example: .nf printf(`\(dq\&ls\(dq\&`); // prints the elements in // the current directory .fi The predefined function \fIeval(string cmd)\fP behaves exactly like the backtick operator: they are synonyms\&. ) .PP \fBlist\-operators:\fP .PP For \fIlist\fP type variables and/or values the following operators are available: .IP o \fIa + b\fP: returns a new \fIlist\fP value containing the concatenation of \fIlist\fP values \fIa\fP and \fIb\fP\&. This is \fInot\fP a set operation: if an element appears both in \fIa\fP and in \fIb\fP, they will appear twice in the resulting list (set\-addition is provided by the built\-in function \fIlistunion\fP)\&. .IP .IP o \fIa \- b\fP: returns a new \fIlist\fP value containing the elements in \fIa\fP that are not present in \fIb\fP\&. This \fIis\fP a set\-difference operation: the returned list contains all elements in \fIa\fP that are not elements of \fIb\fP\&. .IP .IP o \fIa += b\fP: elements in \fIb\fP are added to the elements in \fIa\fP, which must be a \fIlist\fP variable\&. This is \fInot\fP a set operation\&. .IP .IP o \fIa \-= b\fP: elements in \fIb\fP are removed from the elements in \fIa\fP, which must be a \fIlist\fP variable\&. This \fIis\fP a set operation: all elements of \fIa\fP that are found in \fIb\fP are removed from \fIa\fP\&. .IP .IP o list equality comparisons: operators \fI!=\fP and \fI==\fP may be applied to \fIlist\fP values or variables\&. Operator \fI==\fP returns 1 if both lists have element\-by\-element identical elements, otherwise 0 is returned\&. Operator \fI!=\fP reverses the result of \fI==\fP\&. .IP .IP o \fI!a\fP: the boolean \fI!\fP operator returns 1 if the \fIlist a\fP is empty, otherwise 0 is returned\&. .IP .IP o \fI[]\fP: the index operator retrieves a list element from a list variable: it returns a string as an \fIrvalue\fP\&. Therefore, the following statement compiles OK: .nf // assume lst is a list, str is a string str = lst[3]; .fi but the following statement won\(cq\&t compile: .nf lst[3] = str; .fi If an invalid (out of bounds) index value is specified an empty string is returned\&. .PP \fBCasting:\fP .PP Type\-casts using the standard \fBC\fP cast\-operator can be used to cast .IP o strings to ints and vice versa (\fI(int)\(dq\&123\(dq\&, (string)55\fP) .br If the content of a string does not represent a (decimal) \fIint\fP value 0 the cast returns 0; .IP o Strings to lists (\fIlist lst = (list)\(dq\&hello\(dq\&\fP): this returns a list having one element (\fIhello\fP) (note that casting a string to a list as shown is overkill as \fIlist lst = [\(dq\&hello\(dq\&]\fP performs the same initialization)\&. .PP .SH "FLOW CONTROL" .PP \fBIcmake\fP offers the following subset of \fBC\fP\(cq\&s statements\&. They can be used as in the \fBC\fP programming language\&. .IP o \fIexpression ;\fP .br The plain expression statement; .IP .IP o The compound statement .br Variables of any type may be defined and initialized anywhere inside any compound statement\&. The \fIvisibility\fP of a variable starts at its point of definition\&. .IP .IP o \fIif (condition) statement\fP .br Inside the condition a variable may be defined and initialized\&. E\&.g, .nf if (string str = getText()) process(str); .fi In this example, \fIprocess\fP is not called if \fIgetText()\fP returns an empty string\&. The variable \fIstr\fP does not exist either before or after the \fIif\fP statement\&. .br Initialization and then using the variable in a subsequent expression, separated by a semicolon from the definition is not supported (e\&.g\&., \fIif (string str = getText() ; str)\fP cannot be used)\&. .IP .IP o \fIif (condition) statement else statement\fP .br Like the previous statement, inside the condition a variable may be defined and initialized\&. .IP .IP o \fIfor (init; condition; increment) statement\fP .br Variables (of a single type) may be initialized (and optionally be defined) in the \fIinit\fP section\&. The \fIinit\fP, \fIcondition\fP and \fIincrement\fP sections may remain empty\&. The empty condition section is interpreted as `always \fItrue\fP\(cq\&\&. .IP .IP o \fIwhile (condition) statement\fP .br Inside the condition a variable may be defined and initialized\&. .br A complementary \fIdo \&.\&.\&. while()\fP statement is not available\&. Note that defining a variable, using an initialization expression means that the initialization expressing is executed at each iteration of the \fIwhile\fP statement\&. Thus the following statement never ends, and displays a never ending stream of values 10: .nf while (int x = 10) printf(x\-\-, \(dq\&\en\(dq\&); .fi .IP .IP o \fIreturn;\fP, and \fIreturn expression;\fP .br Plain \fIreturn\fP statements can be used in \fIvoid\fP functions, and \fIreturn expression\fP statements are used in other type of functions\&. The function \fImain\fP has return type \fIvoid\fP and so in \fImain\fP only plain \fIreturn\fP statements can be used\&. By default an \fBicmake\fP script\(cq\&s exit value equals 0\&. Use the built\-in function \fIexit\fP (see below) to specify any other exit value\&. .IP \fBBe advised: \fP the behavior of non\-void functions not returning values is undefined\&. .IP .IP o \fIbreak\fP .br Leaves \fIfor\fP and \fIwhile\fP statements, overruling the statement\(cq\&s condition\&. .IP .IP o \fIcontinue\fP .br Continues with the next iteration of a \fIfor\fP or \fIwhile\fP statement\&. .IP .IP o \fIexit(expression)\fP .br Ends the execution of an \fBicmake\fP\-script\&. The \fIexpression\fP must evaluate to an \fIint\fP value, which becomes the script\(cq\&s exit value\&. .PP .SH "PREDEFINED FUNCTIONS" .PP \fBIcmake\fP provides the following predefined functions, which can be used anywhere in \fBicmake\fP scripts\&. The functions are ordered by categories, and within categories they are ordered alphabetically by function name\&. Five categories are distinguished: .IP o Functions operating on ints: .br these functions only have one purpose: they receive \fIint\fP arguments and simply process those arguments; .IP o Functions operating on lists: .br these functions only have one purpose: their main argument is a \fIlist\fP, which is somehow manipulated; .IP o Functions operating on strings: .br these functions only have one purpose: their main argument is a \fIstring\fP, which is somehow manipulated; .IP o Functions manipulating filenames: .br these functions receive filenames as their \fIstring\fP arguments, and return modified filenames (e\&.g\&., by changing the argument\(cq\&s extension); .IP o System\-related functions: .br these functions interface to facilities provided by the operating system, like executing programs or changing the environment\&. .PP \fBFunctions operating on ints:\fP .PP .IP o \fIstring ascii(int value)\fP .br returns \fIvalue\fP as a string: \fIascii(65)\fP returns the string \fI\(dq\&A\(dq\&\fP; .IP o \fIecho(int opt)\fP .br controls echoing of called programs (and their arguments), specify \fIOFF\fP if echoing is not requested\&. By default \fIecho(ON)\fP is used; .PP \fBFunctions operating on lists:\fP .PP .IP o \fIstring element(int index, list (or string) var)\fP .br acts identically to the index operator: refer to the index (\fI[]\fP) operator in section \fBOPERATORS\fP\&. .IP .IP o \fIlist fgets(string file, list offset)\fP .br see the \fBsystem functions\fP section; .IP .IP o \fIint listfind(list lst, string str)\fP .br returns the first index in \fIlst\fP where the string \fIstr\fP is found, or \-1 if \fIlst\fP does not contain \fIstr\fP; .IP .IP o \fIint listlen(list l)\fP .br returns the number of elements in \fIlist\fP; .IP .IP o \fIlist listunion(list lhs, list rhs)\fP .br returns a list containing the union of the elements in \fIlhs\fP and the elements of \fIrhs\fP; .IP .IP o \fIlist listunion(list lst, string str)\fP .br returns a list containing the union of the elements in \fIlst\fP and \fIstr\fP; .PP \fBFunctions operating on strings:\fP .PP .IP o \fIint ascii(string str)\fP .br returns the first character of \fIstr\fP as an in: \fIascii(\(dq\&A\(dq\&)\fP returns 65; .IP .IP o \fIstring resize(string str, int newlength)\fP returns a copy of string \fIstr\fP, resized to \fInewlength\fP characters\&. If \fInewlength\fP is negative then an empty string is returned, if \fInewlength\fP exceeds \fIstr\(cq\&s\fP length then the newly added characters are initialized to blank spaces; .IP .IP o \fIint strchr(string str, string chars)\fP .br returns the first index in \fIstr\fP where any of the characters in \fIchars\fP is found, or \-1 if \fIstr\fP does not contain any of the characters in \fIchars\fP; .IP .IP o \fIint strlen(string str)\fP .br returns the number of characters in \fIstr\fP (not counting the terminating NUL\-character); .IP .IP o \fIint strfind(string haystack, string needle)\fP .br returns index in \fIhaystack\fP where \fIneedle\fP is found, or \-1 if \fIneedle\fP is not found in \fIhaystack\fP; .IP .IP o \fIint strformat(string format, argument(s))\fP .br returns a string constructed from the \fIformat\fP string containing placeholders %1 \&.\&. %2 to refer to arguments following the format string\&. The specification %1 refers to the first argument following the format string\&. If fewer arguments than \fIn\fP are provided then additional 0 arguments are provided by \fBicmake\fP\&. Example: .br .nf void main() { string s2 = = strformat(\(dq\&%1 %2 %1\en\(dq\&, 10, 20); printf(\(dq\&s2 = \(dq\&, s2); // shows: s2 = 10 20 10 } .fi .IP .IP o \fIstring strlwr(string str)\fP .br returns a lower\-case duplicate of \fIstr\fP; .IP .IP o \fIlist strtok(string str, string separators)\fP .br returns a list containing all substrings of \fIstr\fP separated by one or more (consecutive) characters in \fIseparators\fP: \fIstrtok(\(dq\&hello icmake\(cq\&s+world\(dq\&, \(dq\& +\(dq\&)\fP returns a list containing the three strings \fI\(dq\&hello\(dq\&\fP, \fI\(dq\&icmake\(cq\&s\(dq\&\fP, and \fI\(dq\&world\(dq\&\fP; .IP .IP o \fIstring strupr(string str)\fP .br returns an upper\-case duplicate of \fIstr\fP\&. .IP .IP o \fIstring substr(string text, int offset, int count)\fP .br returns a substring of \fItext\fP, starting at \fIoffset\fP, consisting of \fIcount\fP characters\&. If \fIoffset\fP exceeds (or equals) the string\(cq\&s size or if \fIcount <= 0\fP, then an empty string is returned\&. If \fIoffset\fP is less than 0 then \fIoffset = 0\fP is used; .IP .IP o \fIstring trim(string str)\fP .br returns a copy of \fIstr\fP without leading and trailing white spaces; .IP .IP o \fIstring trimleft(string str)\fP .br returns a copy of \fIstr\fP without leading white spaces; .IP .IP o \fIstring trimright(string str)\fP .br Returns a copy of \fIstr\fP without trailing white spaces; .PP \fBFunctions manipulating filenames\fP: .PP .IP o \fIstring change_base(string file, string base)\fP .br returns \fIfile\fP whose base name is changed into \fIbase\fP: \fIchange_base(\(dq\&/path/demo\&.im\(dq\&, \(dq\&out\(dq\&)\fP returns \fI\(dq\&/path/out\&.im\(dq\&\fP; .IP .IP o \fIstring change_ext(string file, string ext)\fP .br returns \fIfile\fP whose extension is changed into \fIext\fP: \fIrss_changeExt(\(dq\&source\&.cc\(dq\&, \(dq\&o\(dq\&)\fP returns \fI\(dq\&source\&.o\(dq\&\fP\&. The extension of the returned \fIstring\fP is separated from the file\(cq\&s base name by a single dot (e\&.g\&., \fIrss_changeExt(\(dq\&source\&.\(dq\&, \(dq\&\&.cc\(dq\&)\fP returns \fI\(dq\&source\&.cc\(dq\&\fP); .IP .IP o \fIstring change_path(string file, string path)\fP .br return \fIfile\fP whose path is changed into \fIpath\fP: \fIchange_path(\(dq\&tmp/binary\(dq\&, \(dq\&/usr/bin\(dq\&)\fP returns \fI\(dq\&/usr/bin/binary\(dq\&\fP\&. To remove the path specify \fIpath\fP as an empty string; .IP .IP o \fIstring get_base(string file)\fP .br returns the base name of \fIfile\fP\&. The base name is the file without its path prefix and without its extension\&. The extension is all information starting at the final dot in the filename\&. If no final dot is found, the file name is the base name\&. E\&.g\&., the base name of \fIa\&.b\fP equals \fIa\fP, the base name of \fIa\&.b\&.c\fP equals \fIa\&.b\fP, the base name of \fIa/b/c\fP equals \fIc\fP; .IP .IP o \fIstring get_dext(string file)\fP .br returns the extension of \fIfile\fP, including the separating dot (hence the \fId\fP in \fIdext\fP)\&. The extension is all information starting at the filename\(cq\&s final dot\&. If \fIfile\fP does not have a final dot then an empty string is returned; .IP .IP o \fIstring get_ext(string file)\fP .br returns the extension of \fIfile\fP, without the separating dot\&. The extension are all characters in \fIfile\fP starting at \fIfile\(cq\&s\fP final dot\&. If no final dot is found, an empty string is returned; .IP .IP o \fIstring get_path(string file)\fP .br returns \fIfile\(cq\&s\fP path\-prefix\&. The path prefix is all information up to (and including) the final directory separator (which is, depending on the operating system, a forward slash or a backslash)\&. If no path is found, an empty strring is returned; .PP \fBSystem\-related functions:\fP .PP .IP o \fIvoid arghead(string h)\fP .br helper function of \fIexec()\fP (see also below at \fIexec()\fP): defines the `argument head\(cq\& that is used with \fIexec()\fP\&. By default, the `argument head\(cq\& is an empty string\&. The argument head is text that is prefixed to \fIexec\fP arguments, like a directory in which provided arguments are found; .IP .IP o \fIvoid argtail (string t)\fP .br helper function of \fIexec()\fP (see also below at \fIexec()\fP): defines the `argument tail\(cq\& that is used with \fIexec()\fP\&. By default, the `argument tail\(cq\& is an empty string\&. The argument tail is text that is appended to \fIexec\fP arguments, like the extensions of files that are passed as arguments to \fIexec\fP; .IP .IP o \fIstring chdir([int check,] string dir)\fP .br returns the script\(cq\&s working directory at the point where \fIchdir\fP is called as an absolute path, and changes the script\(cq\&s working directory to \fIdir\fP (which may be specified as absolute or relative to the script\(cq\&s current working directory)\&. The first argument is optional: if omitted and the change of directory cannot be performed then the \fBicmake\fP\-script ends with exit value 1; by specifying \fIP_NOCHECK\fP the function won\(cq\&t terminate the script but merely returns the script\(cq\&s current working directory\&. .IP Use \fIchdir(\(dq\&\&.\(dq\&)\fP to merely obtain the current working directory; use \fIchdir(\(dq\&\(dq\&)\fP to obtain the script\(cq\&s startup working directory; .IP .IP o \fIcmdhead(string h)\fP .br helper function of \fIexec()\fP (see also below at \fIexec()\fP)\&. Defines a `command head\(cq\& that is used with \fIexec()\fP\&. By default it is an empty string\&. It can be used to specify, e\&.g\&., compiler options when the arguments themselves are modified by \fIarghead\fP and \fIargtail\fP\&. \fICmdhead\fP is used unmodified; .IP .IP o \fIcmdtail(string t)\fP .br helper function of \fIexec()\fP (see also below at \fIexec()\fP)\&. Defines a `command tail that is used with \fIexec()\fP\&. By default it is an empty string\&. It can be used to specify a final argument (not modified by \fIarghead\fP and \fIargtail\fP); .IP .IP o \fIlist eval(string str)\fP .br this function can be used instead of the backtick operator\&. The example provided with the backtick operator could therefore also have been written like this: .nf printf(eval(\(dq\&ls\(dq\&)); // prints the elements in the current // directory .fi .IP .IP o \fIint exec([int check,] string cmd, argument(s))\fP .br Executes the command \fIcmd\fP with (optional) arguments\&. Each argument is prefixed by \fIarghead\fP and postfixed by \fIargtail\fP\&. Note that no blanks are inserted between \fIarghead\fP, argument(s), and \fIargtail\fP\&. The thus modified arguments are concatenated, separated by single blanks\&. \fICmdhead\fP is inserted between \fIcmd\fP and the first argument (delimited by single blanks) and \fIcmdtail\fP is appended to the arguments, separated by a single blank\&. \fIPATH\fP is searched to locate \fIcmd\fP\&. 0 is returned\&. .IP The first argument is optional: if omitted and the command does not return 0 the \fBicmake\fP script terminates\&. By specifying \fIP_NOCHECK\fP \fIexec\fP won\(cq\&t terminate the script but returns the called command\(cq\&s exit status, or \fI0x7f00\fP if the command wasn\(cq\&t found; .IP .IP o \fIexecute([int checking,] string cmd, string cmdhead, string arghead, argument(s), string argtail, string cmdtail)\fP .br Same functionality as the previous function, but the \fIcmdhead, arghead, argtail,\fP and \fIcmdtail\fP are explicitly specified (and are reset to empty strings after executing \fIcmd\fP); .IP .IP o \fIint exists(string file)\fP .br if \fIfile\fP exists, 1 is returned, otherwise 0 is returned; .IP .IP o \fIlist fgets(string file, list offset)\fP .br the next line found at offset value \fIoffset[3]\fP is read from \fIfile\fP\&. Pass an empty list to \fIfgets\fP to read \fIfile\fP from its beginning\&. .IP The returned list has four elements: .IP its first element ([0]) contains the read line (without the line\(cq\&s \fI\en\fP line terminator); .IP its second element ([1]) contains the line\(cq\&s \fI\en\fP line terminator (or an empty string if the line was not terminated by a \fI\en\fP); .IP its third element ([2]) contains the string \fIOK\fP if the line was successfully read and \fIFAIL\fP if reading from file failed; .IP its fourth element ([3]) contains the offset beyond the last read byte\&. .IP To read multiple lines, pass the returned list as argument to \fIfgets\fP: .nf list ret; while (ret = fgets(\(dq\&filename\(dq\&, ret)) { process(ret); } .fi .IP .IP o \fIint fprintf(string filename, argument(s))\fP .br appends all (comma separated) arguments to the file \fIfilename\fP\&. Returns the number of printed arguments\&. .IP If the first argument (following \fIfilename\fP) contains placeholders (\fI%1, %2, \&.\&.\&. %n\fP) then that argument is considered a format string (see also the function \fIstrformat\fP in the string functions section for additional information about format strings)\&. Some examples: .nf fprintf(\(dq\&out\(dq\&, \(dq\&hello\(dq\&, \(dq\&world\(dq\&, \(cq\&\en\(cq\&); fprintf(\(dq\&out\(dq\&, \(dq\&%1 %2\en\(dq\&, \(dq\&hello\(dq\&, \(dq\&world\(dq\&); .fi .IP .IP o \fIstring getch()\fP .br returns the next pressed key as a string (pressing the `Enter\(cq\&\-key is not required); .IP .IP o \fIlist getenv(string envvar)\fP .br returns the value of environment variable \fIenvvar\fP in a list containing two elements: .IP if the first element ([0]) is \fI\(dq\&1\(dq\&\fP then the environment variable was defined; .IP environment variables are of the form \fIvariable=value\fP\&. If element \fI[0]\fP is \fI\(dq\&1\(dq\&\fP then the returned list\(cq\&s second element [1] holds the \fIvalue\fP part of the environment variable, which is empty if the environment variable is merely defined; .IP .IP o \fIint getpid()\fP .br returns the process\-id of the icmake byte code interpreter \fBicm\-exec\fP; .IP .IP o \fIstring gets()\fP .br returns the next line read from the keyboard as a \fIstring\fP\&. The line contains all enteed characters until the `Enter\(cq\&\-key was pressed\&. The `Enter\(cq\&\-key\(cq\&s value itself is not stored in the returned string; .IP .IP o \fIlist makelist([int type = O_FILE], string mask)\fP .br the argument \fItype\fP is optional, in which case \fIO_FILE\fP is used\&. \fIMakelist\fP returns a list of all \fItype\fP entries matching \fImask\fP\&. E\&.g\&., \fImakelist(\(dq\&*\&.c\(dq\&)\fP returns a list containing all files ending in \fI\&.c\fP\&. For \fItype\fP one of the following set of values can be used to obtain a more specific selection of directory entries: .TS tab(~); ll ll ll ll ll c. symbol~meaning~ O_ALL~obtain all directory entries~ O_DIR~obtain all directories, including \&. and \&.\&.~ O_FILE~obtain a list of files~ O_SUBDIR~obtain all subdirectories~ .TE In Unix\-type operating systems the pattern \fI*\fP does not match entries starting with a dot (hidden entries)\&. To obtain a list of such entries use the pattern \fI\&.*\fP; .IP .IP o \fIlist makelist([int type = O_FILE,] string mask, {newer,older}, string comparefile)\fP .br the (optional) parameter \fItype\fP may be specified as in the previous variant of \fImakelist\fP\&. The third parameter must be either \fInewer\fP (or \fIyounger\fP) or \fIolder\fP\&. A list of all files is returned matching mask which are, resp\&., newer or older than a provided \fIcomparefile\fP\&. Note that \fInewer\fP and \fIyounger\fP are operators, not strings; .IP .IP o \fIint printf(argument(s))\fP .br the function\(cq\&s (comma separated) arguments are written to the standard output file\&. If the first argument contains \fI%1, %2, \&.\&.\&. %n\fP specifications then it\(cq\&s considered a format string (see also the function \fIstrformat\fP in the string functions section for additional information about format strings)\&. Like \fIfprintf printf\fP returns the number of printed arguments; .IP .IP o \fIint putenv(string envvar)\fP .br adds \fIenvvar\fP to the current \fBicmake\fP\-script environment\&. Use the format: \fI\(dq\&VAR=value\(dq\&\fP\&. The function returns 0; .IP .IP o \fIlist stat([int check,] string entry)\fP .br Returns \fBstat\fP(2) information of directory entry \fIentry\fP as a list\&. The first argument is optional: if omitted and calling the system \fIstat\fP function fails then the \fBicmake\fP\-script ends with exit value 1; by specifying \fIP_NOCHECK\fP the function won\(cq\&t terminate the script but returns the return value of the system \fIstat\fP function\&. .IP The returned list has two elements: .IP its first element ([0]) holds the entry\(cq\&s attributes\&. Attributes are returned as or\-ed combinations of the following bit\-flags (cf\&. \fBstat\fP(2)): .nf S_IFCHR S_IFDIR S_IFREG S_IREAD S_IWRITE S_IEXEC .fi its second element ([1]) contains the entry\(cq\&s size in bytes; .IP .IP o \fIint system([int check,] string command)\fP .br executes \fIcommand\fP using the \fBsystem\fP(3) function\&. The first argument is optional: if omitted and calling the \fBsystem\fP(3) function does not return 0 then the \fBicmake\fP\-script ends with exit value 1; by specifying \fIP_NOCHECK\fP \fBicmake\fP\(cq\&s \fIsystem\fP function won\(cq\&t terminate the script but returns the return value of the \fBsystem\fP(3) function (normally the executed command\(cq\&s exit value)\&. The string \fIcommand\fP may use redirection and/or piping; .PP .SH "USER DEFINED FUNCTIONS" .PP \fBvoid main\fP .PP \fBIcmake\fP scripts must be provided with a user\-defined function \fImain\fP\&. The function \fImain\fP has three optional parameters, which may be omitted from the last one (\fIenvp\fP) to the first (\fIargc\fP), like in \fBC\fP\&. Its full prototype is (note: \fBvoid\fP return type): .nf void main(int argc, list argv, list envp) .fi In \fImain\fP the parameter .IP o \fIargc\fP represents the number of elements in \fIargv\fP; .IP .IP o \fIargv\fP contains the arguments, with element 0 being equal to the name of the \fI\&.bim\fP file; .IP .IP o \fIenvp\fP contains the `environment\(cq\& variables\&. The function \fIlistlen\fP can be used to determine the number of its elements\&. Elements in \fIenvp\fP have the form \fIvariable=value\fP\&. Alternatively, the function \fIgetenv\fP can be used to retrieve a specific environment variable immediately\&. Example (the implementations of the user\-defined functions \fIusage, modified,\fP and \fIcompile\fP are left as an exercise for the reader): .nf void main(int argc, list argv) { if (argc == 1) usage(element(0, argv)); if (list toCompile = modified(\(dq\&*\&.cc\(dq\&)) { for (int idx = listlen(toCompile); idx\-\-; ) compile(toCompile[idx]); } } .fi After initializing all global variables in order of their definitions \fImain\fP is called by \fBicmake\fP\(cq\&s run\-time support system\&. \fBIcmake\fP scripts end once \fImain\fP returns (or \fIexit\fP is called by the script)\&. .PP \fBAdditionally defined user functions\fP .PP Additional functions may be defined\&. Once defined, they can be called\&. Forward referencing of either variables or functions is not supported, but recursively calling functions is\&. As function declarations are not supported indirect recursion is not supported\&. .PP User\-defined functions must have the following elements: .IP o The function\(cq\&s return type, which must be one of \fIvoid, int, string\fP or \fIlist\fP\&. There is no default type\&. .IP .IP o The function\(cq\&s name, e\&.g\&., \fIcompile\fP\&. .IP .IP o A parameter list, defining zero or more comma\-separated parameters\&. The parameters themselves consist of a type name (\fIint, string\fP, or \fIlist\fP) followed by the parameter\(cq\&s identifier\&. E\&.g\&., \fI(string outfile, string source)\fP\&. .IP .IP o A \fIbody\fP surrounded by a pair of curly braces (\fI{\fP and \fI}\fP)\&. .PP Function bodies may contain (optionally initialized) variable definitions\&. Variable definitions start with a type name, followed by one or more comma separated (optionally initialized) variable identifiers\&. If a variable is not explicitly initialized it is initialized by default\&. By default an \fIint\fP variable is initialized to 0, a \fIstring\fP is initialized to an empty string (\fI\(dq\&\(dq\&\fP) and a \fIlist\fP is initialized to an empty list\&. .PP In addition to variable definitions, bodies may contain zero or more statements (cf\&. section \fBFLOW CONTROL\fP)\&. Note that variables may be defined (and optionally initialized) anywhere inside functions, and also in the conditions of \fIif\fP and \fIwhile\fP statements and in the initialization section of \fIfor\fP statements\&. .PP The behavior of \fBicmake\fP\-scripts using non\-void functions that do not return values is not defined\&. .PP .SH "ICM\-DEP" .PP The \fBicm\-dep\fP program is a support program for \fBicmake\fP to determine source\-file dependencies\&. It is called automatically when \fIUSE_ALL\fP or \fIPRECOMP\fP is specified in the \fIicmconf\fP file that is processed by \fBicmake\fP\&. .PP To start its work, the dependencies\-analyzer \fIicm_dep\fP needs one command\-line argument: \fIgo\fP\&. Any other argument results in \fIicm_dep\fP performing a `dry run\(cq\&: it then performs all its duties (and verbose messages are displayed as if \fIgo\fP had been specified), but no files (precompiled headers or \fIUSE_ALL\fP files) are touched or removed\&. If neither options nor arguments are specified \fIicm_dep\fP writes its usage summary to the standard output\&. .PP Options of \fBicm\-dep\fP may immediately after \fBicmake\fP\(cq\&s \fI\-\-icm\-dep\fP option be specified\&. The following options are recognized: .IP o \fB\-\-classes\fP=\fIfilename\fP (\fB\-c\fP) .br by default, \fBicm\-dep\fP inspects dependencies of the classes whose directories are mentioned in the file \fICLASSES\fP\&. Furthermore, if the \fBicmconf\fP(7) file specifies \fIPARSER_DIR\fP and \fISCANNER_DIR\fP then those directories are also considered\&. Use this option if instead of \fICLASSES\fP another file should be inspected; .IP .IP o \fB\-\-help\fP (\fB\-h\fP) .br \fBicm\-dep\fP writes a summary of its usage to the standard output and terminates; .IP .IP o \fB\-\-icmconf\fP=\fIfilename\fP (\fB\-i\fP) .br by default \fBicm\-dep\fP inspects the content of \fIicmconf\fP files, looking for \fIUSE_ALL\fP and \fIPRECOMP\fP specifications\&. Use this option if instead of \fIicmconf\fP another file should be inspected; .IP .IP o \fB\-\-mainih\fP=\fImainheader\fP (\fB\-m\fP) .br the \fIicmconf\fP file uses the \fI#define IH\fP parameter to specify the suffix of class header files that should be precompiled, their filenames being equal to the names of the classes mentioned in the \fICLASSES\fP file\&. \fICLASSES\fP does not specify a top\-level directory\&. The name of the top\-level header file to precompile can be specified using this option\&. By default it is \fImain\&.ih\fP; .IP .IP o \fB\-\-gch\fP .br by default precompiled header files are inspected if \fIicmconf\fP contains a \fI#define PRECOMP\fP specification\&. If it does not, but precompiled headers should nonetheless be inspected, the option \fI\-\-gch\fP can be provided; .IP .IP o \fB\-\-no\-gch\fP .br by default precompiled header files are inspected if \fIicmconf\fP contains a \fI#define PRECOMP\fP specification\&. If in that case precompiled headers should \fInot\fP be inspected, the option \fI\-\-no\-gch\fP can be provided; .IP .IP o \fB\-\-no\-use\-all\fP .br by default files named at the \fI#define USE_ALL\fP specification are inspected if \fIicmconf\fP contains such a specification\&. To suppress inspections of \fI`USE_ALL\(cq\&\fP files provide this option; .IP .IP o \fB\-\-use\-all\fP=\fIfilename\fP .br by default files named at \fI#define USE_ALL\fP specifications of \fIicmconf\fP files are inspected\&. If the \fIUSE_ALL\fP define is not specified but \fI`USE_ALL\(cq\&\fP files should nonetheless be inspected, then provide this option, specifying the name of files to use as \fIUSE_ALL\fP files; .IP .IP o \fB\-\-verbose\fP (\fB\-V\fP) .br this option can be specified multiple times\&. The number of times it is specified determines \fBicm_dep\fP\(cq\&s verbosity\&. If not used then \fBicm\-dep\fP silently performs its duties\&. If specified once, then \fBicm\-dep\fP reports to the standard output what actions it performs; if specified twice it also reports the class dependencies; if specified more often it reports what files it encountered and what situations caused it to make its decisions; .IP .IP o \fB\-\-version\fP (\fB\-v\fP) .br \fBicm\-dep\fP reports its version number to the standard output and terminates\&. .PP .SH "icmun" .PP The \fIicmun\fP program expects one argument, the binary (\fIbimfile\fP) file produced by `\fBicmake\fP \fI\-c\fP\(cq\&\&. It disassembles the binary file an shows the assembler instructions and structure of the binary file\&. Note that in standard installations \fBicmun\fP is not located in one of the directories of the \fIPATH\fP environment variable, but is located in the \fI/usr/lib/icmake\fP directory\&. .PP As an illustration, assume the following script is compiled by \fBicmake\fP (e\&.g\&., by calling \fIicmake \-c demo\&.im\fP): .nf void main() { printf(\(dq\&hello world\(dq\&); } .fi the resulting \fIdemo\&.bim\fP file can be processed by \fBicmun\fP (e\&.g\&., calling \fI/usr/lib/icmake/icmun demo\&.bim\fP\&. \fBIcmun\fP then writes the following to the standard output fle: .PP .nf icmun by Frank B\&. Brokken (f\&.b\&.brokken@rug\&.nl) icmun V9\&.03\&.00, copyright (c) GPL 1992\-2020\&. Binary file statistics: strings at offset 0x0025 variables at offset 0x0031 filenames at offset 0x0031 first instruction at offset 0x001f String constants dump: \(dq\&hello world\(dq\& Disassembled code: [0014] 06 00 00 push string \(dq\&hello world\(dq\& [0017] 05 01 00 push int 0001 [001a] 1b 1d callrss 29 (printf) [001c] 1c 02 add sp, 2 [001e] 23 ret [001f] 21 14 00 call [0014] [0022] 04 push int 0 [0023] 24 pop reg [0024] 1d exit .fi .PP .SH "FILES" .PP The mentioned paths are sugestive only and may vary over different \fBicmake\fP\-installations: .IP o \fB/usr/bin/icmake\fP: the main \fBicmake\fP program; .IP o \fB/usr/bin/icmbuild\fP: the wrapper program around the \fIicmbuild\fP script handling standard program maintenance; .IP o \fB/usr/bin/icmstart\fP: an \fBicmake\fP\-script that is can be used to create the startup\-files of new projects; .IP o \fB/usr/lib/icmake/icm\-comp\fP: the compiler called by \fBicmake\fP; .IP o \fB/usr/lib/icmake/icm\-exec\fP: the byte\-code interpreter called by \fBicmake\fP; .IP o \fB/usr/lib/icmake/icm\-dep\fP: the support program handling class\- and precompiled header dependencies; .IP o \fB/usr/lib/icmake/icm\-pp\fP: the preprocessor called by \fBicmake\fP; .IP o \fB/usr/lib/icmake/icmun\fP: the \fBicmake\fP unassembler\&. .PP .SH "EXAMPLES" .PP The distribution (usually in \fI/usr/share/doc/icmake\fP) contains a directory \fIexamples\fP containing additional examples of \fBicmake\fP script\&. .PP .SH "SEE ALSO" \fBicmbuild\fP(1), \fBicmconf\fP(7), \fBicmstart\fP(1), \fBicmstart\&.rc\fP(7), \fBmake\fP(1) .PP .SH "BUGS" Standard comment starting on lines containing preprocessor directives may not extend over multiple lines\&. .PP Path names containing blanks are not supported\&. .PP The functions \fIsizeof(list lst)\fP and \fIsizeoflist(list lst)\fP are deprecated and should no longer be used\&. They are removed in a future version of \fBicmake\fP\&. Use \fIlistlen(list lst)\fP instead\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP