开发者

creating makefile [duplicate]

This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

Creating makefile

Hello, I am trying to create the makefiles and configure for my library which its directory struct开发者_StackOverflowure 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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜