help-make
[Top][All Lists]
Advanced

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

Re: sourcing scripts inside Make


From: Ted Stern
Subject: Re: sourcing scripts inside Make
Date: Thu, 01 Feb 2007 10:42:09 -0800
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.93 (gnu/linux)

Dear Aditya:

1) Generally it is recommended to use a Bourne-syntax shell for
executing commands inside MAKE.  It has a smaller startup overhead.
If you require csh, you will have to specify it:
   
   SHELL = /bin/csh

2) Each line of the target commands is executed with a new sub-shell.
If you want your setups to work for several commands, you have to
string them together, like so:


   foo:
   <TAB> command 1 ; \
   <TAB> command 2 ; \
   <TAB> command 3

3) If you have set your shell to csh, there is a good chance that the
.cshrc file is being sourced anyway.

Ted

On 01 Feb 2007 00:19:31 -0800, Aditya Kher wrote:
>
>> > a silly question. How do I source a script inside a Makefile(say for
>> > setting up the environment etc)?
>> > source <script> doesnt work.
>> >
>> > Makefile:
>> >
>> > foo:
>> > <TAB> source ~/.cshrc
>>
>> Can't you just do?
>>
>> foo:
>>     ~/.cshrc
>>
>> Or if that file is not executable do
>>
>> foo:
>>     /bin/sh ~/.cshrc
>>
>
> Actually mere executing wont help beacuse that will not set the
> environment variables that I have in .cshrc
> Those variables are used in future targets build (i.e. after foo) by Make

-- 
 dodecatheon at gmail dot com
 Frango ut patefaciam -- I break so that I may reveal





reply via email to

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