#############################################################################
#	Program Name:	BRIDGE for stanley
#
#	Filename:	Makefile
#
#	Creation Date:	5.8.91
#
#	Date:		5.8.91
#
#	Version:	1.0
#
#	Programmers:	K Kong
#
#	Modifications:
#
#	Copyright (c) 1991 by Hughes LAN Systems
#
#############################################################################

#ROOT	= /h/pvcs
ROOT	= junk
#PSDIR	= ${ROOT}/i960
VER 	=
VERSION	=
stanley:
	cd adminbus; make
	cd newdebug; make -r
	cd kernel; make
	cd libc; make
	cd libutil; make
#	cd sonic; make
#	cd sonic_new; make
	cd system; make
	cd tcpip; make
	cd uart; make
	cd util; make
	cd bp_ring; make -r

snew:	
	make smkdir 
	make sgetcfg 
	make sgetmf 
	cd tcpip; make new

ssource:
	make smkdir 
	make sgetcfg 
	make sgetmf
	make sgetsrc
	cd tcpip; make VERSION = ${VER} source

smkdir:
	mkdir lib include
	mkdir adminbus debugger kernel libc
	mkdir libutil sonic system tcpip uart util

sgetcfg:
	cp ${PSDIR}/adminbus/pvcs.cfg adminbus/pvcs.cfg
	cp ${PSDIR}/debugger/pvcs.cfg debugger/pvcs.cfg
	cp ${PSDIR}/kernel/pvcs.cfg kernel/pvcs.cfg
	cp ${PSDIR}/libc/pvcs.cfg libc/pvcs.cfg
	cp ${PSDIR}/libutil/pvcs.cfg libutil/pvcs.cfg
	cp ${PSDIR}/sonic/pvcs.cfg sonic/pvcs.cfg
	cp ${PSDIR}/system/pvcs.cfg system/pvcs.cfg
	cp ${PSDIR}/tcpip/pvcs.cfg tcpip/pvcs.cfg
	cp ${PSDIR}/uart/pvcs.cfg uart/pvcs.cfg
	cp ${PSDIR}/util/pvcs.cfg util/pvcs.cfg

sgetmf:
	cd adminbus; get -cpvcs.cfg Makefile
	cd debugger; get -cpvcs.cfg Makefile
	cd kernel; get -cpvcs.cfg Makefile
	cd libc; get -cpvcs.cfg Makefile
	cd libutil; get -cpvcs.cfg Makefile
	cd sonic; get -cpvcs.cfg Makefile
	cd system; get -cpvcs.cfg Makefile
	cd tcpip; get -cpvcs.cfg Makefile
	cd uart; get -cpvcs.cfg Makefile
	cd util; get -cpvcs.cfg Makefile

sgetsrc:
	get -y -cpvcs.cfg -v${VER} @${PSDIR}/local.lst
	cd adminbus; get -y -cpvcs.cfg -v${VER} @${PSDIR}/adminbus/local.lst
	cd debugger; get -y -cpvcs.cfg -v${VER} @${PSDIR}/debugger/local.lst
	cd kernel; get -y -cpvcs.cfg -v${VER} @${PSDIR}/kernel/local.lst
	cd libc; get -y -cpvcs.cfg -v${VER} @${PSDIR}/libc/local.lst
	cd libutil; get -y -cpvcs.cfg -v${VER} @${PSDIR}/libutil/local.lst
	cd sonic; get -y -cpvcs.cfg -v${VER} @${PSDIR}/sonic/local.lst
	cd system; get -y -cpvcs.cfg -v${VER} @${PSDIR}/system/local.lst
	cd uart; get -y -cpvcs.cfg -v${VER} @${PSDIR}/uart/local.lst
	cd util; get -y -cpvcs.cfg -v${VER} @${PSDIR}/util/local.lst
	cd include; get -y -v${VER} @${PSDIR}/local.lst
#
#	Booter for stanley
#
stbooter:
	cd kernel; make
	cd libc; make
	cd libutil; make
#	cd sonic; make
	cd tcpip; make stbooter
	cd uart; make
	cd util; make

sbnew:	
	make sbmkdir 
	make sbgetcfg 
	make sbgetmf 
	cd tcpip; make stnew

sbsource:
	make sbmkdir 
	make sbgetcfg
	make sbgetmf 
	make sbgetsrc
	cd tcpip; make VERSION = ${VER} stsource

sbmkdir:
	mkdir lib include
	mkdir kernel libc
	mkdir libutil sonic tcpip uart util

sbgetcfg:
	cp ${PSDIR}/kernel/pvcs.cfg kernel/pvcs.cfg
	cp ${PSDIR}/libc/pvcs.cfg libc/pvcs.cfg
	cp ${PSDIR}/libutil/pvcs.cfg libutil/pvcs.cfg
	cp ${PSDIR}/sonic/pvcs.cfg sonic/pvcs.cfg
	cp ${PSDIR}/tcpip/pvcs.cfg tcpip/pvcs.cfg
	cp ${PSDIR}/uart/pvcs.cfg uart/pvcs.cfg
	cp ${PSDIR}/util/pvcs.cfg util/pvcs.cfg

sbgetmf:
	cd kernel; get -cpvcs.cfg Makefile
	cd libc; get -cpvcs.cfg Makefile
	cd libutil; get -cpvcs.cfg Makefile
	cd sonic; get -cpvcs.cfg Makefile
	cd tcpip; get -cpvcs.cfg Makefile
	cd uart; get -cpvcs.cfg Makefile
	cd util; get -cpvcs.cfg Makefile

sbgetsrc:
	get -y -cpvcs.cfg -v${VER} @${PSDIR}/local.lst
	cd kernel; get -y -cpvcs.cfg -v${VER} @${PSDIR}/kernel/local.lst
	cd libc; get -y -cpvcs.cfg -v${VER} @${PSDIR}/libc/local.lst
	cd libutil; get -y -cpvcs.cfg -v${VER} @${PSDIR}/libutil/local.lst
	cd sonic; get -y -cpvcs.cfg -v${VER} @${PSDIR}/sonic/local.lst
	cd uart; get -y -cpvcs.cfg -v${VER} @${PSDIR}/uart/local.lst
	cd util; get -y -cpvcs.cfg -v${VER} @${PSDIR}/util/local.lst
	cd include; get -y -v${VER} @${PSDIR}/local.lst

sbtcp:
	cd tcpip; make stnew 

