Makefile.am create empty directory

吃可爱长大的小学妹 提交于 2019-12-12 11:46:27

问题


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

and then

dist_myprg_DATA = 
dist_myprgfoo_DATA = 

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


回答1:


Perhaps like this:

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

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

You have to specify AC_PROG_MKDIR_P in configure.ac as well.



来源:https://stackoverflow.com/questions/8518979/makefile-am-create-empty-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!