help-make
[Top][All Lists]
Advanced

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

Re: how to give a BASE directory for "make install"?


From: Brian Dessent
Subject: Re: how to give a BASE directory for "make install"?
Date: Tue, 20 Mar 2007 03:49:46 -0700

Wenbin Zhang wrote:

> How can I give a BASE dir for "make install"?
> Normally, when I run "make install", the compiled files will be copy
> to /usr/sbin, /usr/lib and some other corrosponding direcories.
> However, if I want to copy them to a filesystem under $BASE, say, I
> want to copy them to $BASE/usr/bin, $BASE/usr/lib, how can I achieve
> this simply?

This is not really a question about 'make'.  The answer depends entirely
on how the Makefile was written.

If using a standard GNU configure script, the proper way to do this is
to add --prefix=$BASE/usr to the configure invocation.  You can also
override the value of 'prefix' when invoking the install target ("make
install prefix=..."), but this is not the same thing; specifically if
any directories are compiled-in to the app or substituted into its
support files they will have the configured $prefix (default /usr/local)
and not the one given at "make install" time.  Thus, overriding prefix
at "make install" should be done *only* when moving the files to a
temporary staging area for e.g. creating packages.  The final installed
destination should always correspond to what was given with --prefix at
configure time.  If in doubt, always specify it as a configure
parameter.

Additionally, if you specify more than just a simple --prefix (e.g.
bindir, sbindir, libexecdir, datadir, sysconfdir, sharedstatedir,
localstatedir, infodir, mandir, ...) that do not depend on $prefix, then
overriding all of them will be difficult and you should instead use the
DESTDIR Makefile variable which gives a universal prefix to all
install-directories.  However, again, this should be used for staging
only, not to direct the files to their final destination.

But all of the above only applies to packages that follow the GNU coding
standards, most commonly those that use autoconf and optionally
automake.  None of this is inherent to 'make', so your question should
really be asked elsewhere; typically the mailing list for the package
you're building, or perhaps the mailing list of the software used to
create the Makefile (e.g. automake).

Brian




reply via email to

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