Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Sep 2012 15:35:38 +0300
From:      Peter Pentchev <roam@ringlet.net>
To:        Anton Shterenlikht <mexas@bristol.ac.uk>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: do I need to specify explicity what to install for make install to work?
Message-ID:  <20120927123538.GA4031@straylight.m.ringlet.net>
In-Reply-To: <201209261412.q8QECdG1077988@mech-cluster241.men.bris.ac.uk>
References:  <5062F35C.6050607@infracaninophile.co.uk> <201209261412.q8QECdG1077988@mech-cluster241.men.bris.ac.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

--0OAP2g/MAC+5xKAE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Sep 26, 2012 at 03:12:39PM +0100, Anton Shterenlikht wrote:
> 	From m.seaman@infracaninophile.co.uk Wed Sep 26 14:21:51 2012
>=20
> 	On 26/09/2012 13:06, Anton Shterenlikht wrote:
> 	> I was updating my port until I got to
> 	>=20
> 	> make: don't know how to make install. Stop
> 	> *** [do-install] Error code 2
> 	>=20
> 	> and I realised that I don't really understand
> 	> the sequence of commands involved in "make install".
> 	> I've looked through the porter's handbook,
> 	> but still not clear.
> 	>=20
> 	> I see lots of post-install targets in
> 	> Makefiles, but never just "install".
> 	> I presume it should be pulled into by
> 	> .include <bsd.port.mk>
> 	>=20
> 	> Still, if I have a set of source files,
> 	> generated object files, and just one
> 	> executable I want to install, I probably
> 	> have to specify somewhere in the Makefile
> 	> the name of this executable, right?
> 	>=20
> 	> Or are PLIST_FILES and PLIST_DIRS used
> 	> to let make know what to install?
>=20
> 	The ports 'make install' generally does one of two things: either it
> 	runs appropriate make install commands from $WRKDIR -- ie. what the
> 	ported software provides itself -- or it has a list of files,
> 	directories etc. from within $WRKDIR which it copies into place itself,
> 	which is usually only done if the ported software doesn't provide its
> 	own installation routines.  As I recall, if you don't provide an
> 	explicit install target yourself, the default is to run 'make install'
> 	from $WRKDIR.
>=20
> 	PLIST_FILES, PLIST_DOCS or the pkg-plist file don't tell the ports what
> 	to install.  Instead, they document what the installation process should
> 	be installing, and so what files to include in a pkg tarball and what to
> 	delete at pkg deinstallation time.  Hence the effort required to make
> 	sure your plist is accurate.
>=20
> Ok, I think I get it.
> All I need is the install target
> in $WRKDIR/Makefile.
> If I make this target empty, then
> I can add the real install commands
> under post-install in the port's
> Makefile.
>=20
> However, it seems if there is no
> install target in $WRKDIR/Makefile,
> then I must add install target to
> port's Makefile.

Actually, since the "install" target in bsd.port.mk does a lot of other
things (generating/handling package lists, registering the package
installation, etc), what you need to override is the "do-install"
target (in the port's Makefile).  For the upstream's Makefile (the one
in $WRKSRC) it is the "install" target that is looked for.

This is true for almost all of the "high-level" bsd.port.mk targets (the
ones that the user invokes with "make" in the port's directory) -
bsd.port.mk does some magic, determines whether anything needs to be
done at all, and if there is indeed a need to do something, it invokes
the "do-*" target.  Thus, if bsd.port.mk determines that it needs to
fetch an upstream tarball, it will invoke the "do-fetch" target that, by
default, tries to fetch ${DISTFILES} from ${MASTER_SITE} and so on.  If
it determines that it needs to build a program, it invokes the
"do-build" target that, by default, goes into ${WRKSRC} and does "make
all" (but of course, you can also override the "all" part using another
variable).  For the "install" target, if bsd.port.mk determines that it
needs to install the already-built-in-${WRKSRC} files to ${PREFIX}, it
will invoke "do-install"; if you don't override do-install, it will
change into ${WRKSRC} and run "make install" - and then it will go on
with the rest of what the "install" bsd.port.mk target does.

In general, you don't really need to do this very often - most of what
you might need to do in the do-* targets is already configurable by
other variables.  I guess that's why nobody felt the need to document
this in the Porter's Handbook so far :)

G'luck,
Peter

--=20
Peter Pentchev	roam@ringlet.net roam@FreeBSD.org peter@packetscale.com
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
=2Esiht ekil ti gnidaer eb d'uoy ,werbeH ni erew ecnetnes siht fI

--0OAP2g/MAC+5xKAE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCAAGBQJQZEgVAAoJEGUe77AlJ98TEHkP/1H5eWCSeocPv5DEM1+CGzpd
09v6qwP4vjMUjMMt/06bZ+qhMlKFUNdcVrwE8fIMCXRy0nZV1UZySZowYmor8UfE
sWOAM2zXYjmWGRsjAVolFlSnRrZDdOKUfSKjBdnjTK7ZJT0JX24j60drn1qckD4i
zjSwzQ5Mt3OkKdgUU9KWrnR8C0z99dSY7H7DoID30nB+rgSyPp/KJTMycKr1JDVu
5xvdLAN4TQuDXT42DsxJvZHsoaZ8XJGEecjFof9YzuF3w8uhgd/HsRSkenm+fJAs
q8yd5BTO6wNlvaDmNsqDOthebX5G9w5YDqARjY9xUHVX42YXuGtyS2nJHS+A8qdl
dvoptNss0L4AM/7Z9VoeLsyX1D0wNWzgw1SEcsVIFrY0rJYHdaYxfM4TesVtRneE
ug6sFB/ZqfhFoFeO87yNsdsEqvqL2l7YpoMSJsNbSB/bcFTKdb+5a1zkYEKHl+z4
yes9P6WJSOHrBBf0QFeVyRFMtjqEv+Kx+wTcyWA6G+O1Il9Putbxul9bVi2oIH/t
aBpzjPgCZdchH/DXgSfAnAs+BHeKIDxPa+hvxvjRhxZZu9gEY0CQBbcyCv17W5mM
dfmOeyor4zRWvAsN8sNXAFcWO++tpVVNwh5+6vGkf8onjpB1zN9KkWOGea4v7BEI
AzfjhJ4jRE6uXC9vcw5+
=J+MV
-----END PGP SIGNATURE-----

--0OAP2g/MAC+5xKAE--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120927123538.GA4031>