Expected project / catalog structure for Automake?

I am developing a static C library and using a Bluebone Makefile. Now we need to support remote installations and much more, and it's time to move on to a more reliable build standard. I really want it to be autotools - I like the automatic matching of the GNU Build System, and I also found it pretty easy to work.

However, I have a problem.

Here is an example project structure:

project/
    common/
       pkg/
    inc/
    src/
       submodule1/
           some_thing/
           some_other_thing/
       submodule2/
        . . .

commoncontains header files that will be installed on the target system - one header directly below the general, as well as some other common / pkg. (Well, that’s not true pkg, this is just an example.) Everything under commonis .h.

inc include, . inc .h.

src , ( , ). src .c.

make ​​ SOURCES, .c, src, -I./common -I./inc, . .

, automake, . , `project_CPPFLAGS = -I./Inc -I./common" - , , - . /p >

(?) , , , , - make install.

:

common , . , . project/, automake , common/thing.h common/pkg/other.h, includedir . , , , , , . - , lib, common?

, , -I? , HEADERS, , , .

, automake (, , GNU ) , . , . / . , - - , .

.

+5
1

-I. #include <pkg/foo.h> , , pkg/foo.h.

AM_CPPFLAGS = -I${top_srcdir}/common -I${top_srcdir}/inc

common, SUBDIRS = common (fromleplevel Makefile.am),

# <top>/common/Makefile.am
nobase_include_HEADERS = pkg/foo.h pkg2/bar.h

, , -

# <top>/Makefile.am
xxxpkgdir = ${includedir}/pkg
xxxpkg_HEADERS = common/pkg/foo.h
xxxpkg2dir = ${includedir}/pkg2
xxxpkg2_HEADERS = common/pkg2/bar.h
+6

All Articles