views:

211

answers:

2

Let say I have the following folders:

/A/C

/D/B/E

/D/B/C (this is a symlink to /A/C created by ln -s)

When one of the makefiles tries to use the path /D/B/C/../E it gets a "no file or directory" error. I understand why this happens; /A/E does not exist. However I have to use symlinks to populate the B folder and create the build tree (very long story).

Any ideas?

A: 

I can't imagine how you constructed a path like "D/B/C/../E", but you could do some text processing to clean it up.

Doing it with the Make functions is possible, but kind of ugly. I recommend delegating it to the shell:

PATH := $(shell echo $(PATH) | sed '|/[^/]*/\.\.||g')
Beta
A: 

I have changed the way I link the folders:

/D/B/C is now a link to ../../A/C insted of /A/C

l.thee.a