Makefile.am创建空目录 [英] Makefile.am create empty directory

查看:149
本文介绍了Makefile.am创建空目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用自动工具,在输入make install时需要创建一个空的目录树,例如:

Using autotools, I need to create an empty directory tree when typing make install, like:

/etc/myprg/
|-- foo

现在,我通过指定空目标来做到这一点,就像这样:

right now, I do this by specifying empty targets, like this:

myprgdir = $(sysconfdir)/myprg/
myprgfoodir = $(sysconfdir)/myprg/foo

然后

dist_myprg_DATA = 
dist_myprgfoo_DATA = 

但是,我想知道是否存在更好的方法来做这样的事情!

But, I wonder if a better way to do something like this exists!

推荐答案

也许像这样:

install-data-local:
    $(MKDIR_P) $(DESTDIR)$(sysconfdir)/myprg/foo

uninstall-local:
    rmdir $(DESTDIR)$(sysconfdir)/myprg/foo 2>/dev/null || :

您还必须在configure.ac中指定AC_PROG_MKDIR_P.

这篇关于Makefile.am创建空目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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