I\'m trying to consolidate some build information by using a common makefile. My problem is that I want to use that makefile from different subdirectory levels, which makes
My solution:
cwd := $(shell readlink -en $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))))
This also works for calls like make -f /opt/some/dir/Makefile whenn your in /opt/other/path/subdir.
make -f /opt/some/dir/Makefile
/opt/other/path/subdir