cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pre-post actions ?


From: Gary Oberbrunner
Subject: Re: pre-post actions ?
Date: Mon, 17 Dec 2001 10:22:54 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.6) Gecko/20011120

Steven Knight wrote:


Redefine the CCCOM construction variable.  The modern way to do this
would be as an array reference for the separate commands:

        $env = new cons(CCCOM =>
                ["%ECHO_COLOR blue on white ----- Compiling c   %<",
                 "%CC %CFLAGS %_IFLAGS -c %< -o %>",
                 "@%LINT -os\(%DST/%<_lint.txt\) %LINTFLAGS %<",
                 "@perl /iris/rtos/bin/lint/lint_post.pl %DST/%<_lint.txt"],
                 LINT => 'lint',
                 LINTFLAGS => '',
                 DST => '/appopriate/directory',
                 ECHO_COLOR => '');

Thanks for mentioning the command array stuff, Steven -- that's a nice new feature. Nadim: If you want to make the PRE/POST actions more explicit, you can put them in as placeholder variables, then define them as desired in derived environments:

        $env = new cons(CCCOM =>
                ["%PRE_CCCOM",
                 "%CC %CFLAGS %_IFLAGS -c %< -o %>",
                 "%POST_CCCOM],
                 LINT => 'lint',
                 LINTFLAGS => '',
                 DST => '/appropriate/directory',
                 ECHO_COLOR => '');

        $carefulenv = $env->clone(POST_CCCOM => '@perl lint_post.pl');

and season to taste. (Undefined construction variables will expand to the null string.)

One thing about this is that it makes the build OS-specific since NT uses a different default CCCOM. You could, with a little more work, get around this:

$default_env = new cons();
$env = new cons(CCCOM => ["%PRE_CCCOM",
                          $default_env->{CCCOM},
                          "%POST_CCCOM",
                          ...);

I think it ought to work.

-- Gary Oberbrunner




reply via email to

[Prev in Thread] Current Thread [Next in Thread]