创建生成文件

发布于 2024-11-10 14:28:24 字数 841 浏览 3 评论 0原文

可能的重复:
创建 makefile

您好,我正在尝试创建 makefile 并为我的库进行配置,其目录结构如下:

 $projectroot
    ├── part1
    │   ├── src
    │   └── lib
    ├── part2
    │   ├── src
    │   └── lib
    └── part3
        ├── src
        └── lib

正如您所看到的,该项目有 3 个不同的部分,有人可能想要安装整个项目,或者有人可能只需要项目中的一个库。

我有一个如下所示的 Makefile:

SUBDIRS = part1/lib part1/src part2/lib part2/src part3/lib part3/src

part1:
    cd part1/lib; make
    cd part1/src; make

part2:
    cd part2/lib; make
    cd part2/src; make

part3:
    cd part3/lib; make
    cd part3/src; make

就会出现问题

$ make part1 install

当我使用它安装整个项目但我只想安装第 1 部分,而不是所有部分时,

我该怎么做?

Possible Duplicate:
Creating makefile

Hello, I am trying to create the makefiles and configure for my library which its directory structure is like following:

 $projectroot
    ├── part1
    │   ├── src
    │   └── lib
    ├── part2
    │   ├── src
    │   └── lib
    └── part3
        ├── src
        └── lib

As you can see, this project has 3 different parts, Someone would want to install the entire project, or someone might need only one library from project.

I have a Makefile like the following:

SUBDIRS = part1/lib part1/src part2/lib part2/src part3/lib part3/src

part1:
    cd part1/lib; make
    cd part1/src; make

part2:
    cd part2/lib; make
    cd part2/src; make

part3:
    cd part3/lib; make
    cd part3/src; make

The problem comes around when I use

$ make part1 install

that installs the whole project but I want just to install part1, not all the parts

How can I do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

你的他你的她 2024-11-17 14:28:24

你的问题确实很难解析,但我有一种感觉,你需要为每个部分提供一组额外的安装目标:

part1_install: part1
  cd part1/lib; make install
  cd part1/src; make install

然后你可以执行 make part1_install (part1 将隐式构建)。

Your question is really difficult to parse, but I have a feeling that you need an additional set of install targets for each part:

part1_install: part1
  cd part1/lib; make install
  cd part1/src; make install

Then you can just execute make part1_install (part1 will be built implicitly).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文