Add -lm
[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) -lm
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)
82
83 %.exe: %.cs TestDriver.dll
84         $(MCS) /unsafe $< /r:TestDriver.dll
85
86 %.exe: %.il
87         ilasm /OUTPUT=$*.exe $<
88
89 TestDriver.dll: TestDriver.cs
90         $(MCS) /out:TestDriver.dll /target:library TestDriver.cs
91
92 cpu-pentium.h: cpu-pentium.md genmdesc
93         ./genmdesc $(srcdir)/cpu-pentium.md cpu-pentium.h pentium
94
95 BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-x86.brg $(srcdir)/inssel-long32.brg $(srcdir)/inssel-float.brg
96
97 inssel.c inssel.h: $(BURGSRC)
98         $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
99
100 testi: mono test.exe
101         ./mono -v -v --ncompile 1 --compile Test:$(mtest) test.exe
102
103 # ensure the tests are actually correct
104 checktests: $(regtests)
105         for i in $(regtests); do $(RUNTIME) $$i; done
106
107 rcheck: mono $(regtests)
108         ./mono --verbose --regression $(regtests)
109
110 aotcheck: mono $(regtests)
111         for i in $(regtests); do ./mono --aot $$i; done
112         ./mono --verbose --regression $(regtests)
113         rm -f *.exe.so
114
115 bench: mono test.exe
116         time ./mono --ncompile $(count) --compile Test:$(mtest) test.exe
117
118 mbench: test.exe
119         time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
120
121 stat1: mono bench.exe
122         ./mono --verbose --statfile stats.pl --regression bench.exe
123         perl viewstat.pl stats.pl
124
125 stat2: mono basic.exe
126         ./mono --verbose --statfile stats.pl --regression basic.exe
127         perl viewstat.pl -e stats.pl
128
129 stat3: mono bench.exe
130         ./mono --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe 
131         perl viewstat.pl stats.pl
132
133 docu: mini.sgm
134         docbook2txt mini.sgm
135
136 clean:
137         rm -f mono a.out gmon.out *.o test.exe
138
139 pkgconfigdir = $(libdir)/pkgconfig
140
141 BUILT_SOURCES= inssel.c inssel.h cpu-pentium.h
142 CLEANFILES= $(BUILT_SOURCES)
143 EXTRA_DIST = emullong.brg inssel-float.brg inssel-long.brg  \
144         inssel-long32.brg inssel-x86.brg inssel.brg jit-icalls.c cprop.c \
145         cpu-pentium.md cpu-g4.md ldscript
146
147