From owner-freebsd-current Thu Jul 31 14:59:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id OAA06519 for current-outgoing; Thu, 31 Jul 1997 14:59:50 -0700 (PDT) Received: from shale.csir.co.za (shale.csir.co.za [146.64.46.5]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id OAA06510 for ; Thu, 31 Jul 1997 14:59:45 -0700 (PDT) Received: (from reg@localhost) by shale.csir.co.za (8.8.6/8.8.5) id AAA13118; Fri, 1 Aug 1997 00:00:19 +0200 (SAT) Message-ID: <19970801000015.50699@shale.csir.co.za> Date: Fri, 1 Aug 1997 00:00:15 +0200 From: Jeremy Lea To: "Jordan K. Hubbard" Cc: current@FreeBSD.ORG Subject: Re: More bogons in Makefiles... References: <19970730225235.58179@shale.csir.co.za> <19894.870331035@time.cdrom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.76 In-Reply-To: <19894.870331035@time.cdrom.com>; from Jordan K. Hubbard on Wed, Jul 30, 1997 at 11:37:15PM -0700 Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Wed, Jul 30, 1997 at 11:37:15PM -0700, Jordan K. Hubbard wrote: > Assuming anything about the contents of the final destination > directories for what may be a simple build is highly bogus and, while > this is still done in a number of places in /usr/src, the eventual > intent is to get rid of this and make /usr/src build in a properly > self-referential fashion. > > > src tree. I percieve the purpose of 'make world' to be to make sure that > > these libraries get installed before the build happens. Or are these > > It's the current kludge of `make world' to do this, but it's still not > its most ideal purpose. :) Ok, I think I'm getting the idea here, from what's been said here, in the "core group topics" thread and Satoshi's Makefile: The build process must be able to go from a src tree in '/a/foo' (defaulting to '/usr/src', which maybe read only), build with cross-compiling, a.out-> ELF or some such a build environment in another tree '/a/bar' (defaulting to '/usr/obj/usr/src/tmp' in Satoshi's patch or ${WORLDTMP}, a mix of '/usr/obj' or ${MAKEOBJDIRPREFIX} and '/' in current system) which can then by used to build the world in a temporary tree '/b/bas' (defaulting to '/usr/obj') which can then be used for multiple reinstalls via NFS into '/' or ${DESTDIR} for releases. *And* it must be able to do this without to much magic in the ording of steps in Makefile's and be 'make -j' safe. It's a wonder it works at all ;) I s'pose the second requirement is that it also work without having to require separate build environments etc, so that people can use it to stay -current while only building things that change, much like is done by most users. Anyway, where should I concentrate my efforts then ;)... I s'pose on making sure that everything gets built into ${WORLDTMP} and ${MAKEOBJDIRPREFIX} and ${DESTDIR}. What I've been doing at the moment is getting the tree to build and install in one pass, since I dont have enough space to store /usr/obj and I'm being stuborn about getting more... the changes I've fed through already and about 100 lines more (excluding gratitious diffs to /usr/src/Makefile) allow me to do the following in each directory (except for the next problem...): cd {.CURDIR} && make obj && make all install cleandir (I wish 'make obj all install cleandir' worked)... You'll notice this also fairly close to what most of the targets in the bootstrapping sections of 'make world' are doing. I'm worried by all the cross linking to libraries in /usr/obj because I'm not sure what I'm breaking or not picking up correctly. > > Is there a clean way of building and installing the lib in > > ${.OBJDIR}/.. as a first step in the Makefile, and cleaning it from the > > other subdirectory's Makefile if only that subdirectory was built? > > Not really, no. Not a clean way. :-) This is where most of the patching comes in... you have to make changes to a lot of makefiles to have them stop and make obj && make all && make install && make cleandir across their subtree. Would it be possible to add another .mk file which these could use rather than bsd.subdir.mk, with a before all traget which would build the shared directories and install them in ${.OBJDIR} at the top level and then an afterclean target to remove them. I'm not sure how to quite set up the dependancies so that the subdirs could perform a 'cd ${.CURDIR}../libfoo && make all install' if they were built seprately and have them clean up after themselves (in much the same fashion as ports do), but building the subdirs individually seems like a strange practice anyway, and they should probably just print a warning or cd .. and make. I'm working on diffs for this at the moment. You need about 15Mb free for /usr/obj a 'make world' like this... I wonder if you can build this in a mfs... should be fairly fast ;) > Yes, as you can see, things aren't always 100% consistent in there and > you've certainly identified some definite bogons. I or someone will > review and commit from this list fairly shortly. Thanks. No rush though, since they obviously aren't tripping to many people up. It's just good to remove possible problems I think. > You seem to be doing pretty well so far. :-) Thank you. -Jeremy -- | "In this world of temptation, I will stand for what is right. --+-- With a heart of salvation, I will hold up the light. | If I live or if I die, if I laugh or if I cry, | in this world of temptation, I will stand." -Pam Thum