freebsd-dev/share/mk
Ruslan Ermilov 8f463ff4c5 Moved the `distribute' target from bsd.obj.mk to bsd.subdir.mk,
to make it call `install' in the bsd.subdir.mk-driven makefiles
too.  (share/examples/Makefile,v 1.29 changed the bsd.prog.mk
to bsd.subdir.mk and many stuff was lost during "make release".
I then merged this change in rev. 1.28.2.2 to work around the
namespace pollution (FILES) in this makefile.)

There was an added complexity here.  Both the `distribute' and
`install' targets are recursive (they propagate to SUBDIRs).
So `distribute' first calls `install' in the ${.CURDIR}, then
calls `distribute' in each SUBDIR, etc.  The problem is that
`install' (being also recursive) causes the stuff from SUBDIR
to be installed twice, first time thru `install' in ${.CURDIR}
triggered by `distribute', second time by `distribute' run in
the SUBDIR.  This problem is not new, but it became apparent
only after I moved the `distribute' target from bsd.obj.mk to
bsd.subdir.mk.  My first attempt testing the fix failed due to
this, because the whole world was distributed twice, causing
all the imaginable mess (kerberos5 stuff was installed into both
"base" and "krb5" dists, there was /sbin/init.bak, etc.)
I say the problem is not new because bsd.prog.mk and bsd.lib.mk
makefiles with SUBDIR (even without this fix) had this problem
for years.  Try e.g. running ``make distribute DISTDIR=/foo''
from usr.bin/bzip2 or from lib/libcom_err (without the fix) and
watch the output.

So the solution was to make `install' behave non-recursive when
executed by `distribute'.  My first attempt in passing SUBDIR=
to the `install' in the `distribute' body failed because of the
way how src/Makefile and src/Makefile.inc1 communicate with each
other.  SUBDIR='s assignment precedence on the "make install
SUBDIR=" command line is lowered after src/Makefile wrapper calls
"make ... -f ${.CURDIR}/Makefile.inc1 install" because SUBDIR=
is moved into environment, and Makefile.inc1's assignments now
take higher precedence.  This may be fixed someday when we merge
Makefile with Makefile.inc1.  For now, this is implemented as a
NO_SUBDIR knob.

Spotted by:	Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>
Prodded by:	des
MFC after:	3 days
2002-07-12 15:09:35 +00:00
..
bsd.cpu.mk In gcc 3.1 Pentium/MMX now has its own -march=XXX option. 2002-06-13 08:35:36 +00:00
bsd.dep.mk Moved checkdpadd target to where it logically belongs. 2002-07-03 12:44:06 +00:00
bsd.doc.mk bsd.subdir.mk already has these dependencies coded. 2002-07-01 14:51:42 +00:00
bsd.files.mk Try really hard to fix parallel installs. Add a bunch of .ORDER 2002-07-03 12:28:03 +00:00
bsd.incs.mk Try really hard to fix parallel installs. Add a bunch of .ORDER 2002-07-03 12:28:03 +00:00
bsd.info.mk Part 1/2 of kerberos5/doc/ "make release" breakage fix: 2002-07-06 14:58:20 +00:00
bsd.init.mk Don't include bsd.own.mk from sys.mk, this makes it impossible 2002-04-17 13:49:29 +00:00
bsd.kern.mk For now, make the .ifdef GCC3 case default. We should change -Wno-format 2002-05-24 01:02:45 +00:00
bsd.kmod.mk Bring in the WARNS directive from NetBSD, localized in a new bsd.sys.mk 2001-05-19 23:18:21 +00:00
bsd.lib.mk Make it possible (again) to build and install shared library only. 2002-07-03 16:22:43 +00:00
bsd.libnames.mk Don't include bsd.own.mk from sys.mk, this makes it impossible 2002-04-17 13:49:29 +00:00
bsd.links.mk Try really hard to fix parallel installs. Add a bunch of .ORDER 2002-07-03 12:28:03 +00:00
bsd.man.mk Ensure manpages are built with the all-man in the 2002-05-13 13:04:46 +00:00
bsd.nls.mk Reimplemented bsd.nls.mk using bsd.files.mk and bsd.links.mk. 2002-07-02 12:37:09 +00:00
bsd.obj.mk Moved the `distribute' target from bsd.obj.mk to bsd.subdir.mk, 2002-07-12 15:09:35 +00:00
bsd.own.mk Added new bsd.incs.mk which handles installing of header files 2002-05-12 16:01:00 +00:00
bsd.port.mk Style. 2002-04-19 07:43:50 +00:00
bsd.port.post.mk Fix the type of .include. 2002-04-19 07:42:41 +00:00
bsd.port.pre.mk Fix the type of .include. 2002-04-19 07:42:41 +00:00
bsd.port.subdir.mk Style. 2002-04-19 07:43:50 +00:00
bsd.prog.mk Try really hard to fix parallel installs. Add a bunch of .ORDER 2002-07-03 12:28:03 +00:00
bsd.README Implement PROG_CXX for <bsd.prog.mk>. 2002-04-11 10:44:30 +00:00
bsd.subdir.mk Moved the `distribute' target from bsd.obj.mk to bsd.subdir.mk, 2002-07-12 15:09:35 +00:00
bsd.sys.mk Be more strict with WARNS now -- the GCC 3.1 turmoil is behind us. 2002-07-07 18:47:52 +00:00
Makefile Handle installation of hard and symbolic links via a seperate .mk file. 2002-07-02 12:16:54 +00:00
sys.mk Make .asm transformation rules synonyms to the .s rules. 2002-04-22 08:56:34 +00:00