问题描述
如何通过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安装数据的目录树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!