help-make
[Top][All Lists]
Advanced

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

Re: Execution of recipe commands


From: Paul Smith
Subject: Re: Execution of recipe commands
Date: Thu, 03 Sep 2015 08:44:40 -0400

On Wed, 2015-09-02 at 20:41 -0700, address@hidden wrote:
> Is there any way to induce Gnu Make to write the recipe to a file
> and then 'bash -c' the file?

There is currently no way to get make to do this.  However you can do it
yourself if you have GNU make 4.0 or above, using the $(file ...)
function to write content to a file then having your recipe execute the
file via $(SHELL) or whatever.

BTW, make always uses /bin/sh (unless you reset SHELL explicitly) never
bash.  On some systems /bin/sh is the same thing as bash, but on other
systems it's not.  If you want your makefile to be portable you should
either explicitly set SHELL = /bin/bash or else use POSIX sh features
only and avoid bash extensions.




reply via email to

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