开发者

How to re-use autotools Makefile.am files

I am using autotools to help me with Makefiles.

What I am trying to do:

I am trying to make one Makefile.am to control开发者_如何学Python 1-n projects. i.e A root dir containing the autotools stuff configure, configure.ac etc. No code is in the root dir. So somehow I have to tell the Makefile.am that it has to start compiling project x, y, z...

Is it possible to have a root Makefile.am and a Makefile.am in each project, so I can use the root Makefile.am to compile all projects and if needed, I can use Makefile.am in project x to only compile project x ?

If possible how can I do this ?

BR DarkRoast


This is exactly how recursive make is designed. Simply put, in the root Makefile.am,

SUBDIRS = x y z

and then put the rules for compiling projects x, y, and z in x/Makefile.am, y/Makefile.am, and z/Makefile.am. Then, to compile all the projects, run make in the root directory. To compile only project x, change to directory x and run make there.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜