我有以下源码目录结构
src:
dir1: c++ files, Makefile
dir2: perl/python scripts, Makefile
build:
bin:
binary-executables
bin-subdir: I want my perl/python files to be copied during the build process.
此外,当我执行 make install
时,bin-subdir
是否会默认复制到 install/bin
中,或者我必须也指定那个?
最佳答案
基本上,当您运行make X
时,您是在告诉Make 在您的Makefile 中查找目标X
。因此,如果您没有 install:
目标,则什么也不会发生。所有这些实际上都取决于您的 Makefile 中的内容。如果您想将 perl/python 文件复制到构建目录中,一种方法是编写一个运行 *sh 命令的 Makefile 目标,如 mv dir2/*.pyc build; mv dir2/*.pl build
,并在您的 Makefile 中的其他地方要求该目标。如果您需要好的 Makefile 教程,here's one that I started with.
关于c++ - Makefile:将 perl/python 文件从源目录复制到构建目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17283428/