引用 CUDA 编译器驱动程序 nvcc 参考指南:
2.4. 支持的阶段
make dependency generation `-M`
3.2.1。指定编译阶段的选项
--generate-dependencies -M Generate for the one .c/.cc/.cpp/.cxx/.cu
input file (more than one are not allowed
in this step) a dependency file that can
be included in a make file.
3.2.2. 文件和路径规范
--output-directory -odir Specify the directory of the output file.
This option is intended for letting the
dependency generation step (--generate-dependencies)
generate a rule that defines the target
object file in the proper directory.
3.2.5。指导编译器驱动程序的选项
--dependency-drive-prefix -ddp On Windows platforms, when generating
dependency files (option -M), all file names
must be converted to whatever the used
instance of make will recognize. Some
instances of make have trouble with the
colon in absolute paths in native Windows
format, which depends on the environment in
which this make instance has been compiled.
Use -ddp /cygwin/ for a CygWin make, and -ddp /
for Mingw. Or leave these file names in native
Windows format by specifying nothing.
在该指南的第 5 章中,您可以找到一些使用示例。