Created
June 13, 2020 12:17
-
-
Save bbl/5429c4a0a498c5ef91c10201e1b651c2 to your computer and use it in GitHub Desktop.
Get Makefile root directory absolute path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) | |
test: | |
@echo $(ROOT_DIR) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No need to exec a shell for
dirname
, just use functiondir
:ROOT_DIR :=$(dir $ (realpath $(firstword $ (MAKEFILE_LIST))))