7f569f5a03806f09d7456af260e3d93ff9c9eb48
[cacao.git] / src / vm / jit / intrp / vmgenx
1 #! /bin/sh
2 # vmgenx.  Variation of Gforth's vmgen
3 #Copyright (C) 2001,2002,2003 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 2
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, write to the Free Software
19 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
20
21 prefix=/usr
22 #test "x$GFORTHDIR" != x || GFORTHDIR=${prefix}/bin
23 #test "x$GFORTHDATADIR" != x || GFORTHDATADIR=$prefix/share/gforth/0.6.2
24 #GFORTH=$GFORTHDIR/gforth-fast
25 PRIMS2X=`pwd`/prims2x.fs
26 GFORTH=gforth
27 if test $# = 0 || test $1 = --help || test $1 = -h; then
28   echo "usage: `basename $0` <file>.vmg"
29   exit 0
30 elif test $1 = --version || test $1 = -v; then
31   echo "vmgen (gforth) 0.6.2"
32   $GFORTH --version
33   echo 'Copyright (C) 2001,2002,2003 Free Software Foundation, Inc.'
34   echo 'This program is part of Gforth'
35   $GFORTH -e "license bye"
36   exit 0
37 else
38     true #old shells require this
39 fi
40 file=`basename $1 .vmg`
41 $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 &&
42 $GFORTH -m 1000000 -e "create vmgen" $PRIMS2X -e "c-flag on s\" $1\" ' output-disasm dup process-file bye" > $file-disasm.i &&
43 $GFORTH -m 1000000 -e "create vmgen" $PRIMS2X -e "c-flag on s\" $1\" ' output-gen ' noop process-file bye" > $file-gen.i &&
44 $GFORTH -m 1000000 -e "create vmgen" $PRIMS2X -e "c-flag on s\" $1\" ' output-label dup process-file bye" > $file-labels.i &&
45 $GFORTH -m 1000000 -e "create vmgen" $PRIMS2X -e "c-flag on s\" $1\" ' output-profile dup process-file bye" > $file-profile.i &&
46 $GFORTH -m 1000000 -e "create vmgen" $PRIMS2X -e "c-flag on s\" $1\" ' noop ' output-peephole process-file bye" > $file-peephole.i &&
47 $GFORTH -m 1000000 -e "create vmgen" $PRIMS2X -e "c-flag on s\" $1\" ' output-superend dup process-file bye" > $file-superend.i &&
48 $GFORTH -m 1000000 -e "create vmgen" $PRIMS2X -e "c-flag on s\" $1\" ' output-forthname dup process-file bye" > $file-names.i &&
49 true
50
51