[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make using a function defined in my .bashrc
From: |
sclemow |
Subject: |
Re: Make using a function defined in my .bashrc |
Date: |
Fri, 8 Feb 2008 07:37:59 -0800 (PST) |
Hi Thanks for all of the replies.
There were two issues, both solved now.
Firstly, I needed to export the defined function from bash using export -f
<func_name>
Secondly, I needed to call the function on the same line as any further
executions that used it's output. This is because it sets a variable, eg :
step
temp=func1 ; \
<execute> ; \
<execute $$temp>
.....
Thanks
Simon
Greg Chicares-2 wrote:
>
> On 2008-02-07 15:05Z, sclemow wrote:
>>
>> I have defined a function in my .bashrc file that I would like to use
>> within
>> a step in my Makefile, however Make doesn't seem to recognise the
>> function
>> exists. Is there a way that I can make it do this?
>>
>> I have tried it with an alias too, for some reason Make doesn't pick up
>> these from my environment.
>
> 'make' uses /bin/sh unless you set SHELL in the makefile itself.
> If 'bash' is invoked as 'sh', then it uses '--norc' by default,
> so '~/.bashrc' is skipped.
>
> I'd try setting SHELL to '/bin/bash' in the makefile. It becomes
> less portable because it depends on 'bash', but that sounds like
> what you want.
>
>
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
>
>
--
View this message in context:
http://www.nabble.com/Make-using-a-function-defined-in-my-.bashrc-tp15334363p15357590.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.