How to install a directory tree of data with autom

2019-04-21 02:12发布

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.

标签: automake
1条回答
小情绪 Triste *
2楼-- · 2019-04-21 02:55

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.

查看更多
登录 后发表回答