Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install a directory tree of data with automake

Tags:

automake

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.

like image 208
gbr Avatar asked Sep 03 '10 13:09

gbr


1 Answers

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.

like image 61
adl Avatar answered Nov 11 '22 17:11

adl