From owner-freebsd-current Wed Jul 30 13:52:13 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id NAA02716 for current-outgoing; Wed, 30 Jul 1997 13:52:13 -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 NAA02653 for ; Wed, 30 Jul 1997 13:52:00 -0700 (PDT) Received: (from reg@localhost) by shale.csir.co.za (8.8.6/8.8.5) id WAA01184; Wed, 30 Jul 1997 22:52:36 +0200 (SAT) Message-ID: <19970730225235.58179@shale.csir.co.za> Date: Wed, 30 Jul 1997 22:52:35 +0200 From: Jeremy Lea To: current@freebsd.org Subject: More bogons in Makefiles... Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.76 Sender: owner-freebsd-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hi all, I've been looking through the makefiles, and messing around a bit with the make world procedure to tickle things, and I wanted to ask a few questions before I start making suggestions that are going to attract heat... 1. What is the "general" policy with Makefile's pointing to directories like ${.OBJDIR}../../foo/bar when the library (normally) in question is installed in /usr/lib? In a number of places there are references like this, which might cause problems if the module is built without a full 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 constructs needed for 'make release' or 'make reinstall' or something? 2. There are a lot (15 or so, like cc, cvs) programs which have library directories, which are not installed, but are depended apon. If you cd to one of the subdirectories (without /usr/obj populated) and do a 'make all' then it falls over in the linking stage... I know: "Don't do that". 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? 3. There are a lot of tests of the form: .if exists(../../secure) && !defined(NOCRYPT) && !defined(NOSECURE) It seems that NOCRYPT could be set if NOSECURE is set, and NOSECURE set if there was no directory (../../secure), tested from a Makefile or Makefile.inc in /usr/src or elsewhere, saving a bit on tests and possible mix ups. Anyway, here are some other things which I think are a bit bogus (guess I should learn to send-pr): Some people don't cvsup /usr/src/games, since they dont want the games... *** ./share/doc/usd/Makefile.orig Thu May 22 10:18:17 1997 --- ./share/doc/usd/Makefile Wed Jul 30 01:03:20 1997 *************** *** 11,16 **** BINDIR= /usr/share/doc/usd SUBDIR= title contents 04.csh 07.mail 10.exref 11.vitut 12.vi 13.viref \ ! 18.msdiffs 19.memacros 20.meref 30.rogue 31.trek .include --- 11,20 ---- BINDIR= /usr/share/doc/usd SUBDIR= title contents 04.csh 07.mail 10.exref 11.vitut 12.vi 13.viref \ ! 18.msdiffs 19.memacros 20.meref ! ! .if exists(../../../games) && !defined(NOGAMES) ! SUBDIR+= 30.rouge 31.trek ! .endif .include The purpose of dependancies is to make sure files exist... 'make all install' fails because of this: *** ./share/zoneinfo/Makefile.orig Thu May 22 11:34:30 1997 --- ./share/zoneinfo/Makefile Wed Jul 30 01:03:24 1997 *************** *** 16,22 **** TZFILES+= backward .endif ! .if exists(${.OBJDIR}/yearistype) YEARISTYPE= ${.OBJDIR}/yearistype .else YEARISTYPE= ${.CURDIR}/yearistype --- 16,22 ---- TZFILES+= backward .endif ! .if exists(${.OBJDIR}) YEARISTYPE= ${.OBJDIR}/yearistype .else YEARISTYPE= ${.CURDIR}/yearistype Something tells me this hasn't been used for a while ;): *** ./bin/Makefile.inc.orig Wed Jul 23 16:58:56 1997 --- ./bin/Makefile.inc Wed Jul 30 01:51:06 1997 *************** *** 3,15 **** BINDIR?= /bin NOSHARED?= YES - - .if exists (${.CURDIR}/../../secure) - - .if exists(${.CURDIR}/../../secure/lib/libcipher/obj) - CIPHEROBJDIR= ${.CURDIR}/../../secure/lib/libcipher/obj - .else - CIPHEROBJDIR= ${.CURDIR}/../../secure/lib/libcipher - .endif - - .endif --- 3,5 ---- *** ./bin/ed/Makefile.orig Wed Jul 23 17:15:41 1997 --- ./bin/ed/Makefile Wed Jul 30 01:11:58 1997 *************** *** 5,15 **** LINKS= ${BINDIR}/ed ${BINDIR}/red MLINKS= ed.1 red.1 ! .if exists(../../secure) && !defined(NOCRYPT) && !defined(NOSECURE) DISTRIBUTION=des CFLAGS+=-DDES ! LDADD+= -L${CIPHEROBJDIR} -lcipher ! DPADD+= ${CIPHEROBJDIR}/libcipher.a .endif .include --- 5,15 ---- LINKS= ${BINDIR}/ed ${BINDIR}/red MLINKS= ed.1 red.1 ! .if exists(${DESTDIR}/usr/lib/libcipher.a) && !defined(NOCRYPT) && !defined(NOSECURE) DISTRIBUTION=des CFLAGS+=-DDES ! LDADD+= -lcipher ! DPADD+= ${DESTDIR}/usr/lib/libcipher.a .endif .include Why doesn't libcipher have an entry in bsd.libnames.mk? and shouldn't there be some ${DESTDIR}'s near those ${BINDIR}'s (Also in ./bin/test/Makefile)? That's what ./share/mk/bsd.README says... There's lots of those around the tree. Anyway, that's all for now. I'm still trying to understand make, *.mk and the Makefiles. Oops, one last thing: should ./usr.bin/lex/lib be built twice in the bootstrapping of 'make world' (as part of lib-tools and libraries) and should the whole of ./lib be rebuilt, including stuff that's been done a minute earlier? only libc and libm are needed, as far as I can see, to make the build-tools targets before the libraries are built anyway as part of the 'make all'. -Jeremy -- .sig.gz