[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How do I *conditionally* add to INSTALL_DIRS ?
From: |
Ralf Wildenhues |
Subject: |
Re: How do I *conditionally* add to INSTALL_DIRS ? |
Date: |
Tue, 9 Jan 2007 22:21:37 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
* atoz wrote on Tue, Jan 09, 2007 at 09:54:47PM CET:
> Ralf Wildenhues wrote:
>
> ># Makefile.am snippet:
> >if MAN_PAGES
> >INSTALL_DIRS += $(foomandir)
> >endif
> >if FOO_DOCS
> >INSTALL_DIRS += $(foodocdir)
> >fi
>
> this doesn't make a difference though because automake copies this
> verbatim into Makefile.in where it does nothing useful because the
> vars EXTRA_DIST and INSTALL_DIRS need to be set BEFORE automake does
> its magic in order to generate the relevant code in Makefile.in
> accordingly.
But what magic does automake do with the variable INSTALL_DIRS?
EXTRA_DIST can just be added to as well, not much magic either.
fooman_MANS and foodoc_DATA come to mind as special variables,
if you are ok with having things installed by 'make install-data'
or plain 'make install'. I think this is what you really want,
but it doesn't totally fit this description:
> Basically, I want to be able to let a user do this
>
> ./configure --with-man-pages=yes/no --with-readme=yes/no
>
> (alternatively, --enable/disable-man-pages --enable/disable-readme)
>
> and as a result get a Makefile.in with something like this
>
> man-pages:
> # install man pages to $(foomandir) here
> ...
>
> readme:
> # install README to $(foodocdir) here
> ...
>
> IF and ONLY IF those options were set to "yes", otherwise ...
OK, but you insist on the targets `man-pages' and `readme', you can just
put the whole block inside an if:
if MAN_PAGES
man-pages:
# do your stuff
else
man-pages:
# do nothing
fi
> Furthermore, Makefile.in should also have the relevant instructions
> in the various clean targets to uninstall
In that second case, you'd have to write all that manually.
Cheers,
Ralf