An example to illustrate my question:
Top level makefile
rootdir = $(realpath .)
export includedir = $(rootdir)/include
default:
@$(MAKE) --directory
Python is portable! So, I would suggest you this simple example in your submakefile
With current_dir
and destination_dir
paths os.path.relpath()
does the job for you so you do not have to re-invent the wheel.
submakefile.mk
current_dir=$(CURDIR)
makefile_target:
(echo "import os"; echo "print(os.path.relpath('$(destination_dir)', '$(current_dir)'))" )| python