File:  [gforth] / gforth / vmgen.in
Revision 1.10: download - view: text, annotated - select for diffs
Sat Nov 1 22:19:30 2008 UTC (15 years, 5 months ago) by anton
Branches: MAIN
CVS tags: v0-7-0, HEAD
updated copyright years

    1: #! /bin/sh
    2: # @configure_input@
    3: #Copyright (C) 2001,2002,2003,2007,2008 Free Software Foundation, Inc.
    4: 
    5: #This file is part of Gforth.
    6: 
    7: #Gforth is free software; you can redistribute it and/or
    8: #modify it under the terms of the GNU General Public License
    9: #as published by the Free Software Foundation, either version 3
   10: #of the License, or (at your option) any later version.
   11: 
   12: #This program is distributed in the hope that it will be useful,
   13: #but WITHOUT ANY WARRANTY; without even the implied warranty of
   14: #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.#See the
   15: #GNU General Public License for more details.
   16: 
   17: #You should have received a copy of the GNU General Public License
   18: #along with this program; if not, see http://www.gnu.org/licenses/.
   19: 
   20: prefix=@prefix@
   21: test "x$GFORTHDIR" != x || GFORTHDIR=@exec_prefix@/bin
   22: test "x$GFORTHDATADIR" != x || GFORTHDATADIR=$prefix/share/gforth/@PACKAGE_VERSION@
   23: GFORTH=$GFORTHDIR/gforth-fast
   24: if test $# = 0 || test $1 = --help || test $1 = -h; then
   25:   echo "usage: `basename $0` <file>.vmg"
   26:   exit 0
   27: elif test $1 = --version || test $1 = -v; then
   28:   echo "vmgen (@PACKAGE_NAME@) @PACKAGE_VERSION@"
   29:   $GFORTH --version
   30:   echo 'Copyright (C) 2001,2002,2003,2007,2008 Free Software Foundation, Inc.'
   31:   echo 'This program is part of Gforth'
   32:   $GFORTH -e "license bye"
   33:   exit 0
   34: else
   35:     true #old shells require this
   36: fi
   37: if grep -q vmgen-version $1; then
   38:     version=`grep vmgen-version $1|sed 's/^.*vmgen-version //'`
   39: else
   40:     version=0.6.2
   41: fi
   42: prims2x=$GFORTHDATADIR/prims2x$version.fs
   43: file=`basename $1 .vmg`
   44: $GFORTH -m 1000000 -e "create vmgen" $prims2x -e "c-flag on s\" $file-vm.i\" out-filename 2! s\" $1\" ' output-c ' output-c-combined process-file bye" > $file-vm.i &&
   45: $GFORTH -m 1000000 -e "create vmgen" $prims2x -e "c-flag on s\" $1\" ' output-disasm dup process-file bye" > $file-disasm.i &&
   46: $GFORTH -m 1000000 -e "create vmgen" $prims2x -e "c-flag on s\" $1\" ' output-gen ' noop process-file bye" > $file-gen.i &&
   47: $GFORTH -m 1000000 -e "create vmgen" $prims2x -e "c-flag on s\" $1\" ' output-label dup process-file bye" > $file-labels.i &&
   48: $GFORTH -m 1000000 -e "create vmgen" $prims2x -e "c-flag on s\" $1\" ' output-profile dup process-file bye" > $file-profile.i &&
   49: $GFORTH -m 1000000 -e "create vmgen" $prims2x -e "c-flag on s\" $1\" ' noop ' output-peephole process-file bye" > $file-peephole.i

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