如何在make变量中将当前目录捕获为绝对路径名? [英] How can I capture the current directory as an absolute pathname in a make variable?

查看:42
本文介绍了如何在make变量中将当前目录捕获为绝对路径名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在运行GNUmake文件的过程中获取当前目录,并将其放入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)

推荐答案

嗯,不,$PWD有时是在您的环境中定义的,因此由make继承,但通常不是.您需要$CURDIR.

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

DIR := ${CURDIR}

这篇关于如何在make变量中将当前目录捕获为绝对路径名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆