automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Install library sources with automake


From: Daniel Leidert
Subject: Re: Install library sources with automake
Date: Sat, 24 Mar 2007 22:10:24 +0100

Am Samstag, den 24.03.2007, 23:27 +0300 schrieb Alexey Beshenov:
> Hi!
> 
> At this time I have experience with Makefiles for real compiling only.
> 
> Now I have my own library sources. They should be placed in directory of 
> compiller include path, as well as documentation should be placed to the 
> system documentation directory.
> 
> If library is named foo and it's sources and documentation are in the `src' 
> and `doc' directories, awful shell script is
> 
> #!/bin/sh
> 
> rm -rf /usr/include/foo
> mkdir /usr/include/foo
> cp -r src/* /usr/include/foo
> 
> rm -rf /usr/share/doc/foo
> mkdir /usr/share/doc/foo
> cp -r doc/* /usr/share/doc/foo
> 
> How can I write more flexible Makefile without fixed directory destinations 
> and ability to uninstall everything?
> 
> Cold you give me a quick recipe, please?

Check the _HEADERS primary. You can simply use this:

myheadersdir = $(includedir)/foo
myheaders_HEADERS = [list of header files]

This istalls all header files defined in the _HEADERs variable to
$(includedir)/mylib (the includedir variable is defined by
configure/autoconf).

For documentation you can use:

mydocsdir = $(docdir)
mydocs_DATA = [list of docs]

or smaller:

doc_DATA = [list of docs]

because docdir is defined by autoconf/configure. Note, that the docdir
variable (and also the --docdir configure option) were introduced with
autoconf 2.60 IIRC. To be compatible with older autoconf releases, you
can use:

if test -n "$docdir"; then
        docdir="${datadir}/doc/${PACKAGE}"
        AC_SUBST([docdir])
fi

HTH & regards,
Daniel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]