automake
[Top][All Lists]
Advanced

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

Re: right way to wrap/intercept submakes


From: John Richetta
Subject: Re: right way to wrap/intercept submakes
Date: Wed, 10 Sep 2008 02:49:00 -0700

On Sep 9, 2008, at 11:49 PM, Ralf Wildenhues wrote:

Hello John,

* John Richetta wrote on Wed, Sep 10, 2008 at 05:12:17AM CEST:
If I want to execute a script between a top level make invocation and a submake, it appears that the only straightforward way to do it that is
likely to be portable and reliable(?) is to redefine $MAKE.  If I
understand correctly, the right way to do this is as follows.

That looks really awkward and rather fragile.  Please go back one step
and describe what you really would like to achieve, rather than how you
think it would be best to achieve it.  Maybe there is a better way.

I have another method that will probably achieve what I want without this, but the intent was to run a shell script that examined some environment and make variables, computed some flags as a result, and passed these into other command line tools used in a submake.

   CommandToExec = "$@"
   ...
   Result = exec "${CommandToExec}"
   exit ${Result}

I am not sure if this is to be meta-language, but if it is to be shell,
then it should rather be something like

  # the command is passed in the positional parameters.
  exec "$@"
  exit 1

exec does not return at all if the command can be found and executed.
If the script is continued after the exec, it means the execution
failed.  If it worked, the exit status of the process is that of the
exec'ed command.

Thanks for the correction. I incorrectly "simplified" a working example, that was supposed to read:

   Result = eval "${CommandToExec}"

-jar




reply via email to

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