LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   makefile settings (https://www.linuxquestions.org/questions/linux-newbie-8/makefile-settings-512059/)

Peter Shepard 12-19-2006 06:07 PM

makefile settings
 
Hello,

I am trying to run a make command in a directory. In this directory sits a makefile file. When the the compiler gets to the command:

usage.msg: usage.txt
echo '/* GENERATED CODE, DO NOT EDIT */' > $@.tmp
stringify $< >> $@.tmp
mv -f $@.tmp $@

I get the following error:

stringify usage.txt >> usage.msg.tmp
/bin/sh: stringify: not found
make: *** [usage.msg] Error 127

The stringify command is in my PATH and comes up when I type it on the command line but obviously not with this makefile?

Any ideas.

Thanks

makyo 12-21-2006 10:50 AM

Hi.

I have run with a trivial Makefile to try to replicate the error you report. I tried executing a local script, a shell script in a $HOME/bin directory, a builtin command (echo), and an alias.

The only way I can elicit the message (other than to use a command that was clearly not found in my PATH) was to use an alias . Aliases are not usually exported, so although they look like commands, they couldn't be used in Makefile without special preparation.

Post the result of:
Code:

whereis stringify
cheers, makyo

Peter Shepard 12-21-2006 11:00 AM

whereis stringify
 
Hi Makyo,

I have it working now. If I set my path in the /etc/environment folder to

which stringify output:
/home/pedro/bin/i686/stringify, it works as user but not as root?

Thanks,

Peter

makyo 12-21-2006 12:24 PM

Hi, Peter.
Quote:

Originally Posted by Peter Shepard
... it works as user but not as root?

Yes, root and user will almost certainly have different settings for PATH. Use:
Code:

echo $PATH
while as user and while as root to see the differences. To see root PATH be certain to use su with a minus sign:
Code:

su -
to make sure you are using the environment of root ... cheers, makyo

( edit 1: typo )


All times are GMT -5. The time now is 08:22 AM.