Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jul 1997 22:52:35 +0200
From:      Jeremy Lea <reg@shale.csir.co.za>
To:        current@freebsd.org
Subject:   More bogons in Makefiles...
Message-ID:  <19970730225235.58179@shale.csir.co.za>

next in thread | raw e-mail | index | archive | help
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 <bsd.subdir.mk>
--- 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 <bsd.subdir.mk>

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 <bsd.prog.mk>
--- 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 <bsd.prog.mk>

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



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