tags:

views:

21

answers:

1

How can I install a directory tree of HTML files, stylesheets and images with automake without having to create Makefiles in each subdirectory?

Using the following in the toplevel directory

htmldir = $(docdir)/foo/html
html_DATA = \
        stylesheets/foo.css \
        images/foo.jpg \
        index.html \
        about/index.html \
        faq/index.html
EXTRA_DIST = $(html_DATA)

fails because the subdirectories are not created before install is called.

+1  A: 

You could write

foohtmldir = $(htmldir)/foo/html
nobase_dist_foohtml_DATA = \
    stylesheets/foo.css \
    images/foo.jpg \
    index.html \
    about/index.html \
    faq/index.html

htmldir is a variable the user is entitled to modify using configure --htmldir=... so I suggest using another one if you want to write to some subdirectory of it. The nobase_ prefix will tell Automake not to strip leading directories during installation, and the dist_ prefix requires the files to be distributed.

adl

related questions