automake and project dependencies

后端 未结 2 606
萌比男神i
萌比男神i 2021-02-02 02:13

I have a project that I want to build using automake. The project consists of different components or modules, and there are inter module dependencies which require the project

2条回答
  •  星月不相逢
    2021-02-02 02:26

    If you're using autotools, then you might as well use automake. The top level Makefile.am can provide a list of subdirectories that are descended in order, e.g:

    SUBDIRS = module1 module2 module3 module4 module5
    

    The subdirectory Makefile.am can add targets for tests, invoked with 'make check', which will force the build if necessary:

    check_PROGRAMS = t_module1
    
    t_module1_SOURCES = t_module1.c
    t_module1_LDADD = ./libmodule1.la
    

    There's a lot to learn, and best current practice can be difficult to determine, but if you're using autotools, you'll be used to this situation.

    EDIT:

    info automake provides the reference documentation - but it makes a poor tutorial. One of the best guides I've come across can be found here.

提交回复
热议问题