I have a make file that has two includes like this :
$ cat /src/Makefile
include ../rules.mk
Test:
echo $(DIST_ROOT)
include src.base.mk
Test2:
echo $(DIST_ROOT)
. PHONY: Test Test2
$ cat /rules.mk
DIST_ROOT = $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
$ cat /src/src.base.mk
srcdir = $(DIST_ROOT)/src
The issue is that the output of both is /src
but it should be /
.
How does this happen and how can I fix this?