如何确定SunStudio中的项目目录和其他环境变量?
我目前正在尝试将构建后步骤添加到 SunStudio 项目的构建/制作文件中,但要继续,我需要知道项目的目录。 问题是 ${PWD} 不返回当前目录,并且我找不到任何环境变量,例如 ${PROJECTDIR} 或其他变量。
实际上,从更全面的角度来看,我的问题是我找不到任何有关 SunStudio 在构建项目时设置的环境变量的文档,因此任何包含该信息的答案都会更好。
谢谢
I'm currently trying to add a post build step to a SunStudio project's build/make file, but to continue I need to know the project's directory. Problem is ${PWD} doesn't return the current directory and I can't find any environmental variable like ${PROJECTDIR} or what not.
Actually in a more all encompassing way my problem is that I can't find ANY documentation about what environmental variables SunStudio sets when building a project, so any answer with that information would be even better.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我终于找到了解决办法。 我在 makefile 的预构建目标中放置了一个“env”命令,如下所示:
这显示了 SunStudio 用于构建 (=>dmake) 项目的所有环境变量,因此我了解到项目目录设置在${DMAKE_PWD} 变量。
I finally figured out a solution. I placed an "env" command in the pre-build target of my makefile like this:
This revealed all the environmental variables that SunStudio is using to build (=>dmake) the project, thus I learned that the project directory is set in the ${DMAKE_PWD} variable.