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

    1: #!/bin/sh
    2: #
    3: # ELWIX build script for setup host cross compile process - *** START FIRST *** -
    4: #
    5: # (C) AITNET ltd - Sofia/Bulgaria <office@aitnet.org>
    6: #    by Michael Pounov <misho@elwix.org>
    7: #
    8: # $Id: build_init.sh,v 1.1 2011/07/05 23:43:00 misho Exp $
    9: #
   10: 
   11: [ -r ./config/rc.elwix ] && . ./config/rc.elwix
   12: if [ X"${ELWIX_IS_CONFIGURED}" != X"YES" ]; then
   13: 	echo
   14: 	echo "ELWIX project is not configured !?!"
   15: 	echo
   16: 	exit 1
   17: fi
   18: 
   19: if [ ! -d $BSDSRC ]; then
   20: 	echo
   21: 	echo "ELWIX project is not configured - missing BSD sources !?!"
   22: 	echo
   23: 	exit 1
   24: fi
   25: 
   26: if [ "${USER}" != "root" ]; then
   27: 	echo
   28: 	echo "ELWIX project is not configured - Init must build under root !?!"
   29: 	echo
   30: 	exit 1
   31: fi
   32: 
   33: clean_init()
   34: {
   35: 	echo "+++ Clean ELWIX Projects ..."
   36: 	echo -n "Erase *ALL* builded ELWIX projects [NO/yes]? "
   37: 	read LINE
   38: 	if [ X"$LINE" = X"yes" ]; then
   39: 		chflags -Rf noschg ${TOPDIR}
   40: 		rm -rf $TOPDIR
   41: 		mkdir -p $TOPDIR
   42: 		echo "+++ Erased *ALL* builded ELWIX projects!"
   43: 	fi
   44: }
   45: 
   46: install_init()
   47: {
   48: 	echo "+++ Install ELWIX Project directories ..."
   49: 
   50: 	install -d $REL
   51: 	install -d $DEST
   52: 	install -d $OBJS
   53: 	install -d $ADIR
   54: 	install -d $PKG
   55: 
   56: 	install -d $BSDOBJ
   57: 
   58: 	echo "ELWIX Platform:${PLATFORM} Version:${VERSION} TargetArch:${TARGET_ARCH}" >${TOPDIR}/elwix.ver
   59: }
   60: 
   61: ### main()
   62: install -d ${TOPDIR}
   63: 
   64: V=$(CheckVer ${TOPDIR}/elwix.ver)
   65: if [ $? -ne 0 -o X"$V" != X"${VERSION}" ]; then
   66: 	echo " Not found valid version or different version from current - Start CLEAN *ALL*"
   67: 	rm -rf $TOPDIR
   68: 	mkdir -p $TOPDIR
   69: 	echo "+++ CLEAN *ALL* complete"
   70: else
   71: 	clean_init
   72: fi
   73: 
   74: install_init
   75: 
   76: echo "+++ Complete Init ELWIX"

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