3
votes

I'm writing a library which uses autotools for compiling/installing. My directory tree is kinda like this

/src/
    file1.cpp
    file2.cpp
/include/
    dir/
        header1.hpp
        header2.hpp
        subdir/
            header.hpp
configure.ac
Makefile.am

And I want to install the headers in include/subdir/* in $(includedir)/subdir/. How do I do that? And no, recursive makefiles are not an option. Recursive Make Considered Harmful. http://miller.emu.id.au/pmiller/books/rmch/

1

1 Answers

6
votes

Try:

subdirheadersdir = $(includedir)/subdir
subdirheaders_HEADERS = include/subdir/header.hpp

Note that you cannot use wildcards (like include/subdir/*.hpp). You have to list all files. Also, subdirheaders is just an example name. You can use whatever you want.