icmake

icmake.7.22.01.tar.gz

1992-2015


icmake(1)

icmake(1)

icmake.7.22.01.tar.gz A program maintenance utility

1992-2015

NAME

icmake - A program maintenance (make) utility using a C-like grammar

SYNOPSIS

icmake [options] source[.im] [dest[.bim]] [-- [args]]

icmun bimfile

DESCRIPTION

Icmake(1) can be used as an alternative to make(1). In its standard operation more, it calls the following programs:

Icmake allows the programmer to use a program language (closely resembling the well-known C-programming language) to define the actions involved in (complex) program maintenance. For this, icmake offers various special operators as well as a set of support functions that have proven to be useful in program maintenance.

The program icmun(1) may be used to disassemble the compiled byte-code file.

Traditional make-utilities recompile sources once header files are modified. In the context of C++ program development this is often a bad idea, as adding a new member to a class does not normally require you to recompile the class's sources. To handle class dependencies in a more sensible way, icmake(1)'s CLASSES file may define dependencies among classes. By default, class-dependencies are not interpreted. See the icmconf(7) man-page for details.

ADDITONS SINCE VERSION 7.00

OPTIONS

Icmake:

source: icmake script source file (default extension: .im).

dest: binary icmake script file (default: `source'.bim).

--: icmake/icmake-script arguments separator

args: arguments following -- are entered into the icmake scipt main() function's argv-list (see below at section USER DEFINED FUNCTIONS).

Icmun:

bimfile: binary icmake script file.

PREPROCESSOR DIRECTIVES

The following preprocessor directives are available:

DATA TYPES

The following data types are available:

Variables may be defined both at the global level as well as locally to functions. Variables are strongly typed. A variable cannot have the type void.

Variables may be initialized when they are defined. The initialization can use return values of functions, but cannot use variables. Consider initializations as being constructed from constant values.

PREDEFINED SYMBOLS

The following symbols are predefined by icmake. All are constant int values:


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

The following symbols are available depending on the architecture:


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 x86 running Linux (usually with gcc)
M_SYSV, M_UNIX x86 running SCO/Unix (usually with) Microsoft C
_POSIX _SOURCE Unix with Posix complient compiler
__hpux HP-UX, with the native HP compiler

OPERATORS

All C operators, except for the ternary operator, are supported, operating like their C counterparts on int variables and/or values.

Additionally, for string type variables and/or values the following operators are available:

For list type variables and/or values the following operators are available:

Typecasts may be performed using the standard C cast-operator to cast:

FLOW CONTROL

Icmake offers the following subset of C's statement types. They can be used as in the C programming language.

PREDEFINED FUNCTIONS

Icmake offers the following predefined functions, which can be used immediately by icmake scripts. The function overview is ordered alphabetically by function name, but where appropriate short summary labels are provided:

Helper functions of exec() (see also below at exec()):

String-to-ascii converters:

System calls:

Filename modifiers:

System calls:

Helper functions of exec() (see also below at exec()):

Icmake execution modifier:

Functions returning elements of aggregates:

System calls:

  • exec(string cmd, ...)
    Executes command with arguments. Each argument will be prefixed by arghead()'s argument and postfixed by argtail()'s argument. Note that no blanks are inserted between arghead()'s contents, the argument proper, and argtail()'s argument. All thus modified arguments are concatenated, this time separated by single blanks, and then cmdhead()'s contents are inserted between the command and the first argument (on either side delimited by single blanks) and cmdtail()'s contents are appended to the arguments (again, separated by a single blank). PATH is searched to locate cmd. 0 is returned.
  • exec(int checkcmd, string cmd, ...)
    Same functionality as the previous function, but by specifying checking as P_NOCHECK the function won't terminate the script. Rather, it will return the called command's exit status, or 0x7f00 if the command wasn't found.
  • execute(string cmd, string cmdhd, string arghd, ..., string argtl, string cmdtl)
    Same as exec(), but command head/tail and argument head/tail must be specified. The actually executed command starts with cmd, followed by cmdhd. Next is a series of arguments follows, each enclosed by arghd and argtl. The command terminates with cmdtl. 0 is returned
  • execute(int checking, string cmd, string cmdhd, string arghd, ..., string argtl, string cmdtl)
    Same functionality as the previous function, but by specifying checking as P_NOCHECK the function won't terminate the script. Rather, it will return the called command's exit status, or 0x7f00 if the command wasn't found. )

    System interface:

    Input interface:

    Output interface:

    Filename modifier:

    System interface:

    Filename modifier:

    Input interface:

    Filename modifier:

    System interface:

    Input interface:

    Functions creating lists of files:

    Output interface:

    System interface:

    List information:

    System information:

    String support:

    System calls:

    may contain redirection and/or piping characters.
  • int system(int checking, string command)
    Same functionality as the previous function, but by specifying checking as P_NOCHECK the function won't terminate the script. Rather, it will return the called command's exit status, or 0x7f00 if the command wasn't found. )

    USER DEFINED FUNCTIONS

    Icmake scripts may define functions, and a function main() must be defined. Functions must have the following elements:

    User defined functions must be defined before they can be used, although they may be called recursively. Therefore, indirect recursion is not supported by icmake.

    The user-defined function main() has three optional arguments, which may be omitted from the last one (envp) to the first (argc), as in C. Its full prototype is (note: void return type):

    
        void main(int argc, list argv, list envp)
            
    
    In main(), Example:
    
        void main(int argc, list argv)
        {
            list toCompile;
            int idx;
    
            if (argc == 1)
                usage(element(0, argv));
    
            if (toCompile = altered("*.cc"))
            {
                for (idx = sizeof(toCompile); idx--; )
                    compile(element(idx, toCompile));
    
                if (getenv("dryrun")[0] == "0")
                    linking(element(2, argv));
            }
            exit (0);
        }    
            
    

    FILES

    The mentioned paths are sugestive only and may be installation dependent:

    EXAMPLES

    The distribution (usually in /usr/share/doc/icmake) contains a directory examples containing various examples of icmake script. Note in particular the examples/icmbuild subdirectory containing a general script for C++ and C program maintenance.

    SEE ALSO

    icmbuild(1), icmconf(7), icmstart(1), icmstart.rc(7), make(1)

    BUGS

    None reported

    COPYRIGHT

    This is free software, distributed under the terms of the GNU General Public License (GPL).

    AUTHOR

    Frank B. Brokken (f.b.brokken@rug.nl).