make and PATH



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!

../Anders.

.



Relevant Pages

  • Re: make and PATH
    ... I'd like my Makefile to execute a program in a specific working ... myprogram.exe $(notdir $*.in) ... 'myprogram.exe' is not recognized as an internal or external command, ... The strange thing is that there's no error if I change the Makefile to ...
    (comp.unix.programmer)
  • Re: MAKEFILE - only the first command ever works
    ... Still not sure about how to execute a batch command though.... ... switch into project B's directory, execute its makefile, copy its output back ... %userprofile%\Visual Studio Projects\MyComponent1 ...
    (microsoft.public.vc.language)
  • Re: MAKEFILE - only the first command ever works
    ... Still not sure about how to execute a batch command though.... ... switch into project B's directory, execute its makefile, copy its output back ... %userprofile%\Visual Studio Projects\MyComponent1 ...
    (microsoft.public.win32.programmer.tools)
  • Re: writing to a partition
    ... I'm not sure but I think the various labels in the Makefile ending ... When I simply imitate what the Makefile says, I execute: ... but gcc can't make sense of disk.o. ... the lilo boot process in a terminal window? ...
    (comp.os.linux.misc)