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.

1
  • @A.B I've updated the tree to more accurately reflect the layout of .cache
    – jbrown
    Aug 25, 2018 at 18:04

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .