Makefile: How to determine directory where Makefile resides

detect_makefile_dir.mk
MAKEFILE_DIR              := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

Check out similar posts by category: Build Systems