brauliobo.org | Blog | Fotos | Arquivos | Wiki


Installing data directories recursively with automake

If within your project you have a giant directory of with data files spreaded in multiples subdirectories recursively,then you got stuck and thought:

Do I have to add the pair of suffixed ‘dir’and ‘_data’for each directory recursively?

Oh no! that’d be unthinkable!

You could obviously white a perl or a python script to generate the Makefile.am you need. But…

…you could just add the following rule:

install-data-local:
find dir_name -type f -exec ${INSTALL_DATA} -D{}  "$(DESTDIR)$(datadir)/install_dir_name/"{} \;

And that’s it! But don’t forget the EXTRA_DIST variable:

EXTRA_DIST = dir_name
and fortunetely it scans directories recursively...
SociBookdel.icio.usDiggFacebookGoogleYahoo BuzzStumbleUpon