How can I capture the current directory as an absolute pathname in a make variable?

自古美人都是妖i 提交于 2020-01-01 01:10:28

问题


I'd like to get the current directory during a GNUmake file run put into a make variable.

What is the syntax to do this? Something like this?

DIR := $(PWD)

回答1:


Um, no, $PWD is sometimes defined in your environment and thus inherited by make, but oftentimes not. You need $CURDIR.

DIR := ${CURDIR}


来源:https://stackoverflow.com/questions/3050231/how-can-i-capture-the-current-directory-as-an-absolute-pathname-in-a-make-variab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!