创建生成文件
可能的重复:
创建 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的问题确实很难解析,但我有一种感觉,你需要为每个部分提供一组额外的安装目标:
然后你可以执行
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:
Then you can just execute
make part1_install
(part1 will be built implicitly).