[Tinyos-commits] CVS: tinyos-1.x/tos/lib/VM/languages/motlle/tools .cvsignore, NONE, 1.1 Makefile.am, NONE, 1.1 motlle-load, NONE, 1.1 motlle-vmbuild, NONE, 1.1 Makefile, 1.2, NONE mload, 1.4, NONE motllevm-build, 1.4, NONE

David Gay idgay at users.sourceforge.net
Sat Oct 29 13:27:18 PDT 2005


Update of /cvsroot/tinyos/tinyos-1.x/tos/lib/VM/languages/motlle/tools
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11739/languages/motlle/tools

Added Files:
	.cvsignore Makefile.am motlle-load motlle-vmbuild 
Removed Files:
	Makefile mload motllevm-build 
Log Message:
configure land - setup VM to have installable files (currently motlle and
tinysql support stuff)


--- NEW FILE: .cvsignore ---
Makefile
Makefile.in
GenPrims.class
Primitive.class
compilertable.class
motlle.class
vmargs.class
vmdispatch.class
vmret.class

--- NEW FILE: Makefile.am ---
AUTOMAKE_OPTIONS = foreign

bin_SCRIPTS = motlle-vmbuild \
	      motlle-load

pkgdata_DATA = GenPrims.class

GenPrims.class: GenPrims.java
	javac GenPrims.java


--- NEW FILE: motlle-load ---
#!/bin/sh
motlle=`ncc -print-tosdir`/lib/VM/languages/motlle
$motlle/full/motlle $motlle/src/mload.mt $motlle/src/ "$@"

--- NEW FILE: motlle-vmbuild ---
#!/bin/sh
java net.tinyos.script.VMBuilder -nw $1 || exit $?
grep -q 'rep-float' $1; float=$?
VM=`grep DIR= $1 | sed -e 's/.*DIR="\([^"]*\)".*/\1/'`
cd "$VM"

# set classpath to include motlle tools dir
tosdir=`ncc -print-tosdir`
if uname | grep -q CYGWIN; then
  tdir=`cygpath -w $tosdir/lib/VM/languages/motlle/tools`
  CLASSPATH="$tdir;$CLASSPATH"
else
  CLASSPATH="$tosdir/lib/VM/languages/motlle/tools:$CLASSPATH"
fi

# generate nesC primitive source code
java GenPrims vmargs vm.vmdf >primitive_args.h
java GenPrims vmret vm.vmdf >>primitive_args.h
java GenPrims vmdispatch vm.vmdf >MotllePrimitives.nc

# generate configuration for the motlle compiler
grep '\<OP_' MateConstants.h | sed -e 's/OP_/any rbytecode_/' -e 's/,/;/' > conf.mt
java GenPrims motlle vm.vmdf >>conf.mt
msg_size=`grep MSG_SIZE= Makefile | sed -e 's/MSG_SIZE=//'`
ncg  -DTOSH_DATA_LENGTH=$msg_size -java-classname=foo java MateConstants.h MateConstants.h >/tmp/motlle$$.tmp || exit 1
grep MATE_HANDLER /tmp/motlle$$.tmp | grep -v 'MATE_HANDLER_\(GLOBAL_\|INVALID \|SIZE \|NUM \)' | sed -e 's/.*MATE_HANDLER_\(.*\) = \([0-9]*\);/motehandler("\1", \2);/' >>conf.mt
grep MVIRUS /tmp/motlle$$.tmp | sed -e 's/^.*MVIRUS_/any MVIRUS_/' >>conf.mt
rm -f /tmp/motlle$$.tmp

# language and constants
if grep -q '^<VM .*language="tinyscheme"' vm.vmdf; then
  echo "is_scheme = true;" >>conf.mt
  grep '^CST ' vm.vmdf | sed -e 's/^CST \([-a-zA-Z_0-9$_?!]*\)=\([-0-9]*\).*/motecst("\1", \2);/' | tr _ - >>conf.mt
else
  grep '^CST ' vm.vmdf | sed -e 's/^CST \([-a-zA-Z_0-9$_?!]*\)=\([-0-9]*\).*/motecst("\1", \2);/' >>conf.mt
  echo 'motecst("true", 1);' >>conf.mt
  echo 'motecst("false", 0);' >>conf.mt
  echo 'motecst("null", null);' >>conf.mt
fi

# value representation
if test $float -eq 0; then
  echo "value_size = 4;" >>conf.mt
  echo "any new_mate_state = new_fmate_state;" >>conf.mt
else
  echo "value_size = 2;" >>conf.mt
  echo "any new_mate_state = new_imate_state;" >>conf.mt
fi

--- Makefile DELETED ---

--- mload DELETED ---

--- motllevm-build DELETED ---



More information about the Tinyos-commits mailing list