Re: make and PATH
- From: Gianni Mariani <gi3nospam@xxxxxxxxxx>
- Date: Thu, 13 Sep 2007 06:23:15 +1000
Anders Christensen wrote:
Hi NG,
I have a problem with paths together with make.
I'd like my Makefile to execute a program in a specific working
directory.
My rule looks something like this
%.in %.out:
cd $(dir $*.in) && \
myprogram.exe $(notdir $*.in)
My test target looks something like this
test: wanted\path\mytarget.out wanted2\path2\mytarget2.out
wanted3\path3\mytarget3.out
For some reason myprogram.exe is unknown and I get this output when
running make:
cd wanted\path\ && \
myprogram.exe mytarget.in
'myprogram.exe' is not recognized as an internal or external command,
operable program or batch file.
make: *** [wanted\path\mytarget.out] Error 1
The path to myprogram.exe is in my PATH variable and I have no problem
running it if I manually navigate to wanted\path\ to execute it.
The strange thing is that there's no error if I change the Makefile to
%.IN %.OUT:
cd $(dir $*.IN)
myprogram.exe $(notdir $*.IN)
...but then the working directory for myprogram.exe is not wanted\path
\ as I want it to be.
What could be the problem? I'd appreciate any hint!
change the rule temporarily to run bash and check to see what is going on:
%.out : %.in
cd $(dir $*.in) && \
echo myprogram.exe $(notdir $*.in) ; bash
This will print the command and start a shell. You can then examine why it's not finding your exe.
What I normally do is put the entire path to the executable
MYPROGRAM=/usr/bin/myprogram
and then I use $(MYPROGRAM)
.
- Follow-Ups:
- Re: make and PATH
- From: Anders Christensen
- Re: make and PATH
- References:
- make and PATH
- From: Anders Christensen
- make and PATH
- Prev by Date: Re: How do I know if a process is being blocked?
- Next by Date: Re: Problem with SSH while developing a proxy/bouncer
- Previous by thread: make and PATH
- Next by thread: Re: make and PATH
- Index(es):
Relevant Pages
|