[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: include_HEADERS
From: |
Ralf Corsepius |
Subject: |
Re: include_HEADERS |
Date: |
29 Jul 2003 10:43:57 +0200 |
On Tue, 2003-07-29 at 09:19, Mattias Brändström wrote:
> Hello!
>
> I have a small question about installing headers and I hope someone
> have the time to answer. =)
>
> My project is laid out in a heirarchy something like this:
>
> .../src/project/foo
> .../src/project/bar
> .../src/project/main
>
> Now I want to install some of my header files when I do 'make
> install'. I want to install them in ${prefix}/include laid out in the
> same heirarchy as in the source tree and I want to specify what header
> files to install in the Makefile.am that is in the same directory as
> the header file.
>
> The only way I can think of to do this is to have this in
> .../foo/Makefile.am:
>
> fooincludedir = ${prefix}/include/project/foo
> fooinclude_HEADERS = headerA.h headerB.h headerX.h
>
> I wonder if this is the conventional way to do this?
Basically, yes.
One minor nit: You normally want your custom header directory to be
rooted at $(includedir), i.e.
fooincludedir = $(includedir)/project/foo
fooinclude_HEADERS = headerA.h headerB.h headerX.h
This allows users to install your headers this way:
make prefix=/usr includedir=/foo/bar/include install
[This kind of installation sometimes is required in networked
environments, where build-time directories and installation directory
hierarchies are different (eg. when using nfs, afs or similar.).]
> I know that I
> could put a nobase_include_HEADERS directive in .../src/Makefile.am
> but I would rather not do that. Is there another neater way? =)