如何使用 automake 安装数据目录树

发布于 2024-09-17 18:07:47 字数 356 浏览 3 评论 0原文

如何使用 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 之前未创建子目录。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长不大的小祸害 2024-09-24 18:07:47

您可以编写

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_ 前缀则要求分发文件。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文