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



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to