Plan 9 from Bell Labs’s /usr/web/sources/contrib/miller/9/bcm/mkfile

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


CONF=pi2
CONFLIST=pi picpu pifat pi2 pi2cpu pi4 pi4cpu piwifi pi2wifi pi4wifi
EXTRACOPIES=

loadaddr=0x80008000

objtype=arm
</$objtype/mkfile
p=9

DEVS=`{rc ../port/mkdevlist $CONF|sort}

PORT=\
	alarm.$O\
	alloc.$O\
	allocb.$O\
	auth.$O\
	cache.$O\
	chan.$O\
	dev.$O\
	edf.$O\
	fault.$O\
	mul64fract.$O\
	page.$O\
	parse.$O\
	pgrp.$O\
	portclock.$O\
	print.$O\
	proc.$O\
	qio.$O\
	qlock.$O\
	random.$O\
	rdb.$O\
	rebootcmd.$O\
	segment.$O\
	swap.$O\
	syscallfmt.$O\
	sysfile.$O\
	sysproc.$O\
	taslock.$O\
	tod.$O\
	xalloc.$O\

OBJ=\
	l.$O\
	lexception.$O\
	lproc.$O\
	arch.$O\
	clock.$O\
	fpi.$O\
	fpiarm.$O\
	fpimem.$O\
	main.$O\
#	mmu.$O\
	syscall.$O\
#	trap.$O\
	$DEVS\
	$PORT\
	$CONF.root.$O\
	$CONF.rootc.$O\

HFILES=\
	arm.h

LIB=\
	/$objtype/lib/libmemlayer.a\
	/$objtype/lib/libmemdraw.a\
	/$objtype/lib/libdraw.a\
	/$objtype/lib/libip.a\
	/$objtype/lib/libsec.a\
	/$objtype/lib/libmp.a\
	/$objtype/lib/libc.a\

9:V: $p$CONF s$p$CONF

$p$CONF:DQ:	$CONF.c $OBJ $LIB mkfile
	$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
	echo '# linking raw kernel'	# H6: no headers, data segment aligned
	$LD -s -l -o $target -H6 -R4096 -T$loadaddr $OBJ $CONF.$O $LIB

s$p$CONF:DQ:	$CONF.$O $OBJ $LIB
	echo '# linking kernel with symbols'
	$LD -l -o $target -R4096 -T$loadaddr $OBJ $CONF.$O $LIB
	size $target

$p$CONF.gz:D:	$p$CONF
	gzip -9 <$p$CONF >$target

$OBJ: $HFILES

install:V: /$objtype/$p$CONF

/$objtype/$p$CONF:D: $p$CONF s$p$CONF
	cp -x $p$CONF s$p$CONF /$objtype/ &
	for(i in $EXTRACOPIES)
		{ 9fs $i && cp $p$CONF s$p$CONF /n/$i/$objtype && echo -n $i... & }
	wait
	echo
	touch $target

<../boot/bootmkfile
<../port/portmkfile
<|../port/mkbootrules $CONF

arch.$O clock.$O fpiarm.$O main.$O mmu.$O screen.$O syscall.$O trap.$O trap4.$O: \
	/$objtype/include/ureg.h

archbcm.$O archbcm2.$O devether.$0 etherusb.$O: etherif.h ../port/netif.h
fpi.$O fpiarm.$O fpimem.$O: ../port/fpi.h
l.$O lexception.$O lproc.$O armv6.$O armv7.$O: arm.s
armv7.$O: cache.v7.s
main.$O: errstr.h init.h reboot.h
mouse.$O screen.$O: screen.h
devusb.$O usbdwc.$O: ../port/usb.h
usbdwc.$O: dwcotg.h

init.h:D:	../port/initcode.c init9.s
	$CC ../port/initcode.c
	$AS init9.s
	$LD -l -R1 -s -o init.out init9.$O initcode.$O /$objtype/lib/libc.a
	{echo 'uchar initcode[]={'
	 xd -1x <init.out |
		sed -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
	 echo '};'} > init.h

reboot.h:D:	rebootcode.s arm.s arm.h mem.h
	$AS rebootcode.s
	# -lc is only for memmove.  -T arg is PADDR(REBOOTADDR)
	$LD -l -s -T0x1800 -R4 -o reboot.out rebootcode.$O -lc
	{echo 'uchar rebootcode[]={'
	 xd -1x reboot.out |
		sed -e '1,2d' -e 's/^[0-9a-f]+ //' -e 's/ ([0-9a-f][0-9a-f])/0x\1,/g'
	 echo '};'} > reboot.h

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].