Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Mar 2003 15:07:41 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Ruslan Ermilov <ru@FreeBSD.org>
Cc:        Jake Burkholder <jake@FreeBSD.org>, <src-committers@FreeBSD.org>, <cvs-src@FreeBSD.org>, <cvs-all@FreeBSD.org>
Subject:   Re: cvs commit: src/share/mk bsd.kern.mk src/sys/conf Makefile.sparc64
Message-ID:  <20030302143808.V28556-100000@gamplex.bde.org>
In-Reply-To: <20030301132405.GC77007@sunbay.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 1 Mar 2003, Ruslan Ermilov wrote:

> On Sat, Mar 01, 2003 at 05:41:04PM +1100, Bruce Evans wrote:
> > On Fri, 28 Feb 2003, Ruslan Ermilov wrote:
> >
> > > +# Search for kernel source tree in standard places.
> > > +.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. /sys /usr/src/sys
> >
> > Style bug: line too long.
> >
> > > +.if !defined(SYSDIR) && exists(${_dir}/conf/kern.mk)
> > > +SYSDIR=	${_dir}
> > >  .endif
> >
> I just cut-n-pasted bsd.kmod.mk, with s/kmod/kern/ substitution.

Survival of the ugliest :-).

> > > [More removal of non-warning options.]
> > > +.if !defined(SYSDIR) || !exists(${SYSDIR}/kern) || !exists(${SYSDIR}/conf/)
> > > +.error "can't find kernel source tree"
> > >  .endif
> > > [More removal of non-warning options.]
> > > +.include "${SYSDIR}/conf/kern.mk"
> >
> > Not sure about this.  It seems reasonable to handle things in the same
> > way as bsd.kmod.mk, but this will just break compiling old sys trees
> > under -current until the old sys trees have conf/kern.mk.
> >
> It won't.  One needs to use "make buildkernel" to compile old
> kernels, and to downgrade in general, and that would use native
> .mk's.

Some ones need that but not me :-).  I never use buildkernel.  I use
old versions of config(8) checked out in the sys tree.  This works
with only minor source modifications for at least the following
configurations:
- my normal i386 config file under RELENG_3, at compile time
- my normal i386 config file under RELENG_4, at compile and run time
The source modications are to config for RELENG_3 and to the linker script
for RELENG_3 and RELENG_4.  This has worked since a year or two before
buildkernel existed, with most of the source changes unnecessary until
relatively recently.  But unsuitable warnings in bsd.kern.mk have spammed
the build output since the beginning.  They would require more hackish
source changes to avoid so I've waited to fix them properly by making
kern.mk sys-relative.

> > > Index: sys/conf/kern.post.mk
> > > ===================================================================
> > > RCS file: /home/ncvs/src/sys/conf/kern.post.mk,v
> > > retrieving revision 1.35
> > > diff -u -r1.35 kern.post.mk
> > > --- sys/conf/kern.post.mk	27 Feb 2003 08:52:11 -0000	1.35
> > > +++ sys/conf/kern.post.mk	28 Feb 2003 11:38:23 -0000
> > > @@ -221,4 +221,4 @@
> > >  majors.o:
> > >  	${NORMAL_C}
> > >
> > > -.include <bsd.kern.mk>
> > > +.include "kern.mk"
> >
> > Does the relative path work right here?  It depends on seaching in the
> > directory of kern.post.mk first.
> >
> Yes, I wanted to make it explicit that we use the same directory
> as the including (kern.post.mk) makefile.  It will always work,
> and stop on the first attempt from this list:
>
> : If double quotes are used, the including makefile's directory and
> : any directories specified using the -I option are searched before
> : the system makefile directory.

I can never remember this order.  I see that you added it to make.1.
The description is still fuzzy -- it's important that the makefile's
directory is searched before any -I directories.

> > kern.post.mk is known to be in
> > $S/conf/ and we could use that path for kern.mk too.
> >
> Maybe, I just don't see much difference to the "kern.mk"
> version.

I hope this will become moot anyway.  I want config(8) to do all the
inclusions at config time.  Having things in scattered include files
makes the Makefile harder to debug and hack on.  The same is true for
standard include files like bsd.prog.mk, but I haven't needed to edit
application Makefiles nearly as much as kernel Makefiles.  This may be
because standard include files are more standard or I don't often work
on big applications.

> > > I choose to preserve bsd.kern.mk because at least sys/boot/pc98/boot2
> > > utilizes it purposedly.
> >
> > This should use the relative kern.mk too.  pc98/boot2 is essentially
> > i386/boot/biosboot.  When I added bsd.kern.mk I made all the boot
> > programs use it to get consistent warnings checking for the sys tree.
> > This was one of many things lost in the sys/boot tree except in
> > pc98/boot2.
> >
> If I fix pc98/boot2/Makefile, may I remove the bsd.kern.mk
> completely?

OK with me.  I originally intended to remove it completely, but peter
pointed out some compatibility issues.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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