c++ - Makefile:将 perl/python 文件从源目录复制到构建目录

标签 c++ build makefile

我有以下源码目录结构

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/

相关文章:

build - 构建 gatsby 网站时如何解决错误 #95313?

c++ - 如何要求CMake不冗长?

c++ - 如何在 Node.js 中设置最大缓冲区大小?

c++ - 将 char* 转换为 uint8_t

ios - 为什么我不能为某些特定的 iOS 模拟器构建?

variables - Makefile 'match' 特殊变量的名称是什么?

c++ - Linux gnu++11,运行时获取 "Enable multithreading to use std::thread: Operation not permitted"

c++ - 在子字段上使用 std::forward

c++ - 如何使用 windows/cygwin 从 CMakeLists.txt 中的 Clion 中的 GCC 和 Clang 之间切换

r - 从 Github 安装时,包中缺少整理字段中的文件