9fans archive / 2004 / 05 / 654 prev next
From: Geoff Collyer <geoff@col...>
Subject: kernel mk
Date: Sat, 29 May 2004 16:35:02 -0700
You don't have to; I type
mk # build 9pc
mk 'CONF=pccpu' # build 9pccpu
mk 'CONFLIST=pc pccpu' all # build both
mk all # build all kernels
The reason you can't just type
mk 9pccpu
is that there would have to already be a mkfile target named `9pccpu',
so adding a new kernel configuration would require editing the kernel
mkfile. The use of CONF and CONFLIST allows mk to construct the
necessary rules on the fly:
$p$CONF: $CONF.c $OBJ $LIB
$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
$LD -o $target -T0x80100020 -l $OBJ $CONF.$O $LIB
size $target