创建生成文件
我正在尝试创建 makefile 并为我的库进行配置,其目录结构如下所示:
$projectroot ├── lib ├── src └── test
该库有 3 个不同的部分(第 1 部分、第 2 部分和第 3 部分),它是一个分层库,这意味着第 2 部分需要第 1 部分,第 3 部分需要第 2 部分和part1:
part1 ◁───┐ △ │ │ │ part2 │ △ │ │ │ │ │ part3 ┘
现在,我想要有4个不同的目标,如下所示:
all: <MAKE ALL THE 3 PARTS> part1: <MAKE PART1> part2: <MAKE PART2> part3: <MAKE PART3>
我对make(make all)没有问题,但例如也许有人只想安装part2,我需要验证part2是否已经安装或不
我该怎么做?
I am trying to create the makefiles and configure for my library which its directory structure is like following:
$projectroot ├── lib ├── src └── test
this library has 3 different parts (part1, part2 and part3) and it is a hierarchal library, that means part2 needs part1, part 3 needs part2 and part1:
part1 ◁───┐ △ │ │ │ part2 │ △ │ │ │ │ │ part3 ┘
Now, I want to have 4 different targets, as you can see below:
all: <MAKE ALL THE 3 PARTS> part1: <MAKE PART1> part2: <MAKE PART2> part3: <MAKE PART3>
I have no problem with make (make all), but for example maybe someone wants only to install part2, I need to verify whether part2 is already installed or not
How can I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将
part1
和part2
列为part3
的依赖项即可:Just list
part1
andpart2
as dependencies ofpart3
: