如何使用Automake安装数据的目录树 [英] How to install a directory tree of data with automake

查看:69
本文介绍了如何使用Automake安装数据的目录树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过automake安装HTML文件,样式表和图像的目录树,而不必在每个子目录中创建Makefile?

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)

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

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

推荐答案

您可以编写

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

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.

这篇关于如何使用Automake安装数据的目录树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆