export BASEDIR
# RELATIVEDIR: relative path from BASEDIR to the current directory
-RELATIVEDIR=$(patsubst /%,%,$(patsubst $(BASEDIR)%,%,$(shell pwd)))
+RELATIVEDIR=$(patsubst /%,%,$(patsubst $(BASEDIR)%,%,$(shell pwd -L)))
# BACK_TO_BASE: relative path from the current directory to BASEDIR
BACK_TO_BASE:=$(shell echo $(RELATIVEDIR)|sed -e 's/[^/]\+/../g')