Thu May 1 15:18:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / mini / Makefile.am
1 count=100000
2 mtest=for_loop
3 monodir=$(top_builddir)
4 libs=   \
5         $(monodir)/mono/metadata/libmonoruntime.la      \
6         $(monodir)/mono/metadata/libmetadata.la \
7         $(monodir)/mono/io-layer/libwapi.la     \
8         $(monodir)/mono/utils/libmonoutils.la
9
10 MCS=mcs
11 RUNTIME=mono
12 WARN=-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations \
13         -Wstrict-prototypes  -Wmissing-prototypes -Wnested-externs \
14         -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings
15
16 INCLUDES = \
17         $(WARN) -fexceptions -DMONO_USE_EXC_TABLES      \
18         -I$(top_srcdir)         \
19         $(GMODULE_CFLAGS)               \
20         $(GLIB_CFLAGS)
21
22 # hack for automake to have the same source file in a library and a bin
23 genmdesc_CFLAGS = $(AM_CFLAGS)
24
25 regtests=basic.exe arrays.exe basic-float.exe basic-long.exe objects.exe basic-calls.exe iltests.exe exceptions.exe bench.exe
26
27 libmono_la_LDFLAGS=-Wl,-version-script=$(srcdir)/ldscript
28
29 bin_PROGRAMS = mono genmdesc
30
31 lib_LTLIBRARIES = libmono.la
32
33 mono_SOURCES = \
34         main.c
35
36 mono_LDADD = \
37         libmono.la              \
38         $(GLIB_LIBS)            \
39         $(GMODULE_LIBS)
40
41 mono_LDFLAGS = \
42         -export-dynamic
43
44 genmdesc_SOURCES = \
45         mini.h          \
46         genmdesc.c      \
47         helpers.c
48
49 genmdesc_LDADD = \
50         $(libs) -lgc -lm        \
51         $(GLIB_LIBS)            \
52         $(GMODULE_LIBS)
53
54 arch_sources = \
55         mini-x86.c              \
56         mini-x86.h              \
57         exceptions-x86.c        \
58         tramp-x86.c
59
60 libmono_la_SOURCES = \
61         mini.c          \
62         mini.h          \
63         mini-ops.h      \
64         mini-arch.h     \
65         dominators.c    \
66         cfold.c         \
67         regalloc.c      \
68         regalloc.h      \
69         inssel.c        \
70         helpers.c       \
71         liveness.c      \
72         ssa.c           \
73         driver.c        \
74         debug-mini.c    \
75         linear-scan.c   \
76         aot.c           \
77         graph.c         \
78         $(arch_sources)
79
80 libmono_la_LIBADD = \
81         $(libs) -lgc -lm        \
82         $(GLIB_LIBS)            \
83         $(GMODULE_LIBS)
84
85 %.exe: %.cs TestDriver.dll
86         $(MCS) /unsafe $< /r:TestDriver.dll
87
88 %.exe: %.il
89         ilasm /OUTPUT=$*.exe $<
90
91 TestDriver.dll: TestDriver.cs
92         $(MCS) /out:TestDriver.dll /target:library TestDriver.cs
93
94 cpu-pentium.h: cpu-pentium.md genmdesc
95         ./genmdesc $(srcdir)/cpu-pentium.md cpu-pentium.h pentium
96
97 BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-x86.brg $(srcdir)/inssel-long32.brg $(srcdir)/inssel-float.brg
98
99 inssel.c inssel.h: $(BURGSRC)
100         $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
101
102 testi: mono test.exe
103         ./mono -v -v --ncompile 1 --compile Test:$(mtest) test.exe
104
105 # ensure the tests are actually correct
106 checktests: $(regtests)
107         for i in $(regtests); do $(RUNTIME) $$i; done
108
109 rcheck: mono $(regtests)
110         ./mono --verbose --regression $(regtests)
111
112 aotcheck: mono $(regtests)
113         for i in $(regtests); do ./mono --aot $$i; done
114         ./mono --verbose --regression $(regtests)
115         rm -f *.exe.so
116
117 bench: mono test.exe
118         time ./mono --ncompile $(count) --compile Test:$(mtest) test.exe
119
120 mbench: test.exe
121         time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
122
123 stat1: mono bench.exe
124         ./mono --verbose --statfile stats.pl --regression bench.exe
125         perl viewstat.pl stats.pl
126
127 stat2: mono basic.exe
128         ./mono --verbose --statfile stats.pl --regression basic.exe
129         perl viewstat.pl -e stats.pl
130
131 stat3: mono bench.exe
132         ./mono --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe 
133         perl viewstat.pl stats.pl
134
135 docu: mini.sgm
136         docbook2txt mini.sgm
137
138 clean:
139         rm -f mono a.out gmon.out *.o test.exe
140
141 pkgconfigdir = $(libdir)/pkgconfig
142
143 BUILT_SOURCES= inssel.c inssel.h cpu-pentium.h
144 CLEANFILES= $(BUILT_SOURCES)
145 EXTRA_DIST = emullong.brg inssel-float.brg inssel-long.brg  \
146         inssel-long32.brg inssel-x86.brg inssel.brg jit-icalls.c cprop.c \
147         cpu-pentium.md cpu-g4.md ldscript
148
149