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.
我目前正在尝试将后期构建步骤添加到SunStudio项目的构建/生成文件中,但是要继续,我需要知道项目的目录。问题是$ {PWD}没有返回当前目录,我找不到任何环境变量,如$ {PROJECTDIR}或什么不是。
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.
实际上,我的问题是,我找不到任何关于SunStudio在构建项目时设置的环境变量的文档,因此任何有关该信息的答案都会更好。
Thanks
1 个解决方案
#1
I finally figured out a solution. I placed an "env" command in the pre-build target of my makefile like this:
我终于想出了一个解决方案。我在makefile的预构建目标中放置了一个“env”命令,如下所示:
.build-pre:
env
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.
这揭示了SunStudio用于构建(=> dmake)项目的所有环境变量,因此我了解到项目目录是在$ {DMAKE_PWD}变量中设置的。
#1
I finally figured out a solution. I placed an "env" command in the pre-build target of my makefile like this:
我终于想出了一个解决方案。我在makefile的预构建目标中放置了一个“env”命令,如下所示:
.build-pre:
env
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.
这揭示了SunStudio用于构建(=> dmake)项目的所有环境变量,因此我了解到项目目录是在$ {DMAKE_PWD}变量中设置的。