File:  [ELWIX - Embedded LightWeight unIX -] / elwix / build_world.sh
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Jul 5 23:43:00 2011 UTC (12 years, 10 months ago) by misho
Branches: MAIN
CVS tags: HEAD
Initial revision

#!/bin/sh
#
# ELWIX build script for world
#
# (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
#    by Michael Pounov <misho@elwix.org>
#
# $Id: build_world.sh,v 1.1 2011/07/05 23:43:00 misho Exp $
#

[ -r ./config/rc.elwix ] && . ./config/rc.elwix
if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
	echo
	echo "ELWIX project is not configured !?!"
	echo
	exit 1
fi

if [ ! -d $BSDSRC ]; then
	echo
	echo "ELWIX project is not configured - missing BSD sources !?!"
	echo
	exit 1
fi

if [ ! -d $ADIR ]; then
	echo
	echo "ELWIX project is not configured - missing TargetArch directory !?!"
	echo
	exit 1
fi

if [ "${USER}" != "root" ]; then
	echo
	echo "ELWIX project is not configured - BSD kernel must compile under root !?!"
	echo
	exit 1
fi

clean_world()
{
	echo "+++ Clean ELWIX World ..."
	rm -rf $WORLD
	mkdir -p $WORLD
}

build_world()
{
	echo "+++ Build ELWIX World ..."
	cd $BSDSRC
	env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
		-j${PARALLEL_BUILD} buildworld DESTDIR=${WORLD}
	cd -
}

install_world()
{
	echo "+++ Install ELWIX World ..."
	cd $BSDSRC
	env MAKEOBJDIRPREFIX=${BSDOBJ} make TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
		installworld DESTDIR=${WORLD}
	cd -

	echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${WORLD}/elwix.ver
}

### main()
if ! SnitVer ${WORLD}/elwix.ver; then
	clean_world
	build_world
	install_world
else
	echo "Skipped ELWIX World build ..."
fi


echo "+++ Complete build ELWIX World"

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>