Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Dec 1997 17:03:52 +0800
From:      Greg Lehey <grog@lemis.com>
To:        John-Mark Gurney <gurney_j@resnet.uoregon.edu>
Cc:        Francisco Reyes <reyesf@super.zippo.com>, "hackers@freebsd.org" <hackers@FreeBSD.ORG>
Subject:   Re: Why so many steps to build new kernel?
Message-ID:  <19971205170352.42121@lemis.com>
In-Reply-To: <19971205005430.09155@hydrogen.nike.efn.org>; from John-Mark Gurney on Fri, Dec 05, 1997 at 12:54:30AM -0800
References:  <199712050750.XAA25888@super.zippo.com> <19971205161339.59500@lemis.com> <19971205005430.09155@hydrogen.nike.efn.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 05, 1997 at 12:54:30AM -0800, John-Mark Gurney wrote:
> Greg Lehey scribbled this message on Dec 5:
>> On Fri, Dec 05, 1997 at 02:50:07AM -0400, Francisco Reyes wrote:
>>> I was wondering if there would be any problems with creating a script
>>> for some of the  steps of building a new kernel. What if any would be
>>> the problem with having a script which does:
>>>
>>> config kern1
>>> cd ../../kern1
>>> make depend
>>> make all
>>> make install
>>
>> Why not?  Of course, you could simplify it.
>>
>>> If such script was created it should check the return code of the
>>> make command to make sure there were no problems.
>>
>> You wouldn't need to do that if you wrote:
>>
>>  make config depend all install
>>
>> Better still, you could make a target 'world' which did this for you,
>> including the cd's and configs in your original version.
>
> hmm... where is this config target for make??  just checked my -current
> kernel source tree and see no config target...
>
> also, how do you propose to handle the directory tree being removed and
> recreated out from under you when config runs?  (hmm... something like
> exec'ing make after the config phase might work...)

That's left as an exercise to the reader.  OK, what the hell,
something like:

KERNEL = DEFAULT
CONF   = /usr/src/sys/i386/conf
COMPILE = /usr/src/sys/compile

world:  config depend build install

config:	${CONF}/${KERNEL}
	cd  ${CONF}
	config -g -n ${KERNEL}

depend:	${COMPILE}/${KERNEL}
	cd ${COMPILE}; make depend

all build:  ${COMPILE}/${KERNEL}
	cd ${COMPILE}; make all

install:	${COMPILE}/${KERNEL}
	cd ${COMPILE}; make install

If you want to build a different kernel, you specify the name to make:

  make world KERNEL=FOOBAR

What have I left out?

Greg



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