creating makefile [duplicate]

ⅰ亾dé卋堺 提交于 2019-12-13 17:22:03

问题


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?


回答1:


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).



来源:https://stackoverflow.com/questions/6175472/creating-makefile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!