1

I've got the following directory layout:

/home/me/mydir
  \- tiller -> ./cache/git-repo1/subdir1/tiller
  \- makefiles -> ./cache/git-repo2/subdir2/makefiles

When I'm in /home/me/mydir if I type ls -l I get the above as expected.

However, if I change into /home/me/mydir/tiller and type ls ../makefiles I get an error: ls: ../makefiles: No such file or directory

How can I access /home/me/mydir/makefiles using a relative path from /home/me/mydir/tiller, or is my only option to use an absolute path?

Edit: I guess I'm hitting this. Is there a solution? I really need <cmd> ../makefiles to work from within /home/me/mydir/tiller.

jbrown
  • 121

1 Answers1

1

Since I actually want to make includes in Makefiles work, I've changed my include to take a value from an environment variable, which I set to the absolute path of /home/me/mydir, i.e.:

CACHE_ROOT?=..
include $(CACHE_ROOT)/makefiles/base.mk

After reading this great answer, I realised absolute paths were the only solution.

jbrown
  • 121