help-make
[Top][All Lists]
Advanced

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

Re: Execution of recipe commands


From: thutt
Subject: Re: Execution of recipe commands
Date: Thu, 3 Sep 2015 10:14:32 -0700

Paul Smith writes:
 > 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.

 Thank you for the confirmation.

 In this case, the Makefile is generated by a tool.
 It'll be just as easy for our tool to write the recipe to a file and
 amend the rule to execute the file.

 >
 > 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.

 Yes.

--
vmware vending machine deal: 4Gb USB stick: $8.  A steal at $2 / Gb!!



reply via email to

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