automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: installing a whole directory


From: Lorenzo Bettini
Subject: Re: installing a whole directory
Date: Thu, 16 Apr 2009 11:30:12 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

Ralf Wildenhues wrote:
Hello Laura, Lorenzo,

* Laura Hughes (lahughes) wrote on Tue, Apr 14, 2009 at 06:08:58PM CEST:
There may be a better way to do it so I'm looking forward to hearing how
others did this, but I did this by creating an install hook like this:

If you are installing a list of files only, then I can only recommend to
you to let Automake do it.  It will be easier to use if you know the
rules, and more correct, too (and faster, too, once you switch to 1.10b
or newer).  For example, your rule does not use $(DESTDIR) correctly,
and "make distcheck" should be able to point out to you, as well as the
missing uninstall-local rule.

For data files to be installed, you can use something like

  foodir = <where everything is to be installed>
  foo_DATA = <list of files>

Hi

the problem is that I should list all the files manually, and I'd need to install all the files generated by doxygen...


which will be sufficient to let the list of files be installed below
$(foodir).  You can replace "foo" with other names; if the "foo" name
contains "exec", then things will be installed by "install-exec".
See the chapter "info Automake Install" for more information.
(You can write dist_foo_DATA instead of foo_DATA if you want these files
distributed as well).

install-data-hook:
        (mkdir -p $(help_dir) ; \
        cp -f *_help.txt $(help_dir))

For example, I'd write this as

## This rule requires Autoconf 2.62 or newer.
install-data-local:
        @$(NORMAL_INSTALL)
        $(MKDIR_P) $(DESTDIR)$(help_dir)
        $(INSTALL_DATA) *_help.txt $(DESTDIR)$(help_dir)

## Warning: the following rule assumes that this package is the
## sole owner of files below $(help_dir)!
uninstall-local:
        @$(NORMAL_UNINSTALL)
        rm -f $(DESTDIR)$(help_dir)/*_help.txt


so this should be fine, and there's no need to list files explicitly, is that right?

(with Autoconf 2.62 or newer, you can be sure that $(INSTALL_DATA) is
able to handle multiple files at once; with earlier, you'd need to use
something like "cp -f", but then you still don't allow your users to
override permissions, or owner, or use "install-sh -C" or so here).

Hope that helps.

I'll try this

thanks! thanks also to Laura!

cheers
        Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134     (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net





reply via email to

[Prev in Thread] Current Thread [Next in Thread]