收录日期:2019/04/24 20:53:05 时间:2010-06-16 01:52:08 标签:directory,gnu-make

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)

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

DIR := ${CURDIR}