Hi,
jcw...@zirx.pair.com wrote:
In writing several Makefiles, I come across a recurring problem. I don't have (and
don't want) "/cygdrive/c/Program Files/mspgcc/bin" in my path (using Cygwin
here, in case that's not obvious). However, msp430-gcc tries to exec msp430-ld and can't
find it.
To avoid adding the directory to the PATH you can do separate
compiling/linking:
CC := /cygdrive/c/Program\ Files/mspgcc/bin/msp430-gcc
LINK := /cygdrive/c/Program\ Files/mspgcc/bin/msp430-ld
...
module.elf : module.o
$(LINK) -o $@ $(LD_FLAGS) $* $(LIBS)
module.o : module.c module.h
$(CC) -c -o $@ $(CC_FLAGS) $<
The solution I'm looking for is to export PATH in a Makefile. I've tried a
couple variants. PATH=$(TOOLPATH):$(PATH) then 'export PATH'. For some
reason, make can't find msp430-gcc (I played around with a similiar problem a
few months ago, and localized it to a Cygwin problem either not exporting or
not inheriting variables correctly) I've tried 'export
PATH=$(TOOLPATH):$(PATH)', but make generates a circular reference error.
To avoid circular references try := instead of simple = (export PATH :=
$(TOOLPATH):$(PATH) ). Also make sure that the mspgcc toolchain and make
(!) is configured and built for cygwin and that very installation
location (/cygdrive/c/Prog....). However the compiler driver won't find
the linker as long as its location is not part of the PATH variable.
Regards
Arnd-Hendrik
I'm not sure of the implications of this, but it seems that since msp430-gcc
execs msp430-ld, it should attempt to exec it normally, then if it fails, try
execing it with any explicit path information that msp430-gcc was invoked with.
--jc
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users