7

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!

Cristiano
  • 856
  • 10
  • 24

1 Answers1

11

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.

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
ptomato
  • 56,175
  • 13
  • 112
  • 165