Search code examples
makefileautotoolsautoconflibtool

How to have automake install headers file in a subdirectory of include


My current project has a couple files in its include/tatoparser directory that I would like to distribute along with my library.

qdii@nomada ~/MyProject $ ls include/tatoparser/
dataset.h  interface_lib.h  linkset.h  sentence.h  tagset.h

I created a Makefile.am that references those files:

qdii@nomada ~/MyProject $ cat include/Makefile.am 
include_HEADERS = tatoparser/interface_lib.h tatoparser/sentence.h tatoparser/dataset.h tatoparser/tagset.h tatoparser/linkset.h

But when I run make install the referenced files get copied into /usr/include (or whatever $(includedir) was set to), and I want them copied in /usr/include/tatoparser.

How can I do that?


Solution

  • Use the nobase prefix to stop Automake from stripping the subdirectory path from the files:

    nobase_include_HEADERS = tatoparser/interface_lib.h tatoparser/...