10

如何使用 automake 安装 HTML 文件、样式表和图像的目录树,而无需在每个子目录中创建 Makefile?

在顶级目录中使用以下内容

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

install失败,因为在调用之前未创建子目录。

4

1 回答 1

10

你可以写

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

htmldir是用户有权修改的变量,configure --htmldir=...因此如果您想写入它的某个子目录,我建议使用另一个变量。前缀将nobase_告诉 Automake 在安装过程中不要剥离前导目录,并且dist_前缀要求分发文件。

于 2010-09-05T02:28:05.803 回答