| 1 : |
anton
|
1.1
|
#Makefile for vmgen example |
| 2 : |
|
|
|
| 3 : |
anton
|
1.10
|
#Copyright (C) 2001,2003 Free Software Foundation, Inc. |
| 4 : |
anton
|
1.1
|
|
| 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 : |
|
|
LEX=flex -l |
| 22 : |
anton
|
1.11
|
YACC=bison -y |
| 23 : |
anton
|
1.1
|
#YACC=yacc |
| 24 : |
|
|
VMGEN=vmgen |
| 25 : |
anton
|
1.4
|
#GCC=gcc -g -Wall |
| 26 : |
anton
|
1.3
|
GCC=gcc -O3 -fomit-frame-pointer -Wall |
| 27 : |
anton
|
1.1
|
CC=$(GCC) |
| 28 : |
anton
|
1.8
|
#M4=m4 -s #recommended if supported |
| 29 : |
|
|
M4=m4 |
| 30 : |
anton
|
1.6
|
OBJECTS_MINI=mini.tab.o support.o peephole.o profile.o disasm.o engine.o engine-debug.o |
| 31 : |
anton
|
1.1
|
|
| 32 : |
anton
|
1.6
|
mini: $(OBJECTS_MINI) |
| 33 : |
|
|
$(CC) $(OBJECTS_MINI) -o $@ |
| 34 : |
anton
|
1.1
|
|
| 35 : |
|
|
lex.yy.c: mini.l |
| 36 : |
|
|
$(LEX) mini.l |
| 37 : |
|
|
|
| 38 : |
|
|
mini.tab.c: mini.y |
| 39 : |
anton
|
1.11
|
$(YACC) mini.y && mv y.tab.c $@ |
| 40 : |
anton
|
1.1
|
|
| 41 : |
|
|
mini-vm.i mini-disasm.i mini-gen.i mini-labels.i mini-profile.i mini-peephole.i: mini.vmg |
| 42 : |
|
|
$(VMGEN) mini.vmg |
| 43 : |
|
|
|
| 44 : |
anton
|
1.4
|
mini.vmg: mini-inst.vmg mini-super.vmg |
| 45 : |
anton
|
1.8
|
$(M4) mini-inst.vmg >$@ |
| 46 : |
anton
|
1.4
|
|
| 47 : |
anton
|
1.1
|
mini.tab.o: mini.tab.c mini-gen.i lex.yy.c mini.h |
| 48 : |
|
|
|
| 49 : |
|
|
support.o: support.c mini.h |
| 50 : |
|
|
|
| 51 : |
|
|
peephole.o: peephole.c mini-peephole.i mini.h |
| 52 : |
|
|
|
| 53 : |
|
|
profile.o: profile.c mini-profile.i mini.h |
| 54 : |
|
|
|
| 55 : |
|
|
disasm.o: disasm.c mini-disasm.i mini.h |
| 56 : |
|
|
|
| 57 : |
|
|
engine.o: engine.c mini-vm.i mini-labels.i mini.h |
| 58 : |
|
|
|
| 59 : |
|
|
engine-debug.o: engine.c mini-vm.i mini-labels.i mini.h |
| 60 : |
anton
|
1.9
|
$(CC) -DVM_DEBUG -DVM_PROFILING -Dengine=engine_debug -c -o $@ engine.c |
| 61 : |
anton
|
1.1
|
|
| 62 : |
|
|
clean: |
| 63 : |
anton
|
1.5
|
rm -f *.o mini mini-*.i lex.yy.c mini.tab.c mini.vmg xxx-bench |
| 64 : |
anton
|
1.2
|
|
| 65 : |
|
|
check: mini |
| 66 : |
anton
|
1.7
|
./mini test.mini | tr -d '\015' | diff - test.out |
| 67 : |
anton
|
1.5
|
|
| 68 : |
|
|
checkall: |
| 69 : |
anton
|
1.9
|
for i in 1 3 5 8 9 10; do make clean; echo $i; make check VMGEN=../vmgen CC="gcc -O3 -fomit-frame-pointer -Wall -DTHREADING_SCHEME=$i"; echo $i >>xxx-bench; time mini fib.mini 2>>xxx-bench; done; cat xxx-bench |
| 70 : |
anton
|
1.4
|
|
| 71 : |
|
|
#make profiles |
| 72 : |
|
|
%.prof: %.mini mini |
| 73 : |
|
|
./mini -p $< 2>$@ |