Remove removed files
[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         $(LIBGC_LIBS)   \
10         $(ICU_LIBS)
11
12 MCS=mcs
13 RUNTIME=mono
14
15 INCLUDES = \
16         -I$(top_srcdir)         \
17         $(LIBGC_CFLAGS)         \
18         $(GMODULE_CFLAGS)               \
19         $(GLIB_CFLAGS)
20
21 if PLATFORM_WIN32
22 export HOST_CC
23 # The mingw math.h has "extern inline" functions that dont appear in libs, so
24 # optimisation is required to actually inline them
25 AM_CFLAGS = -O
26 endif
27
28 # hack for automake to have the same source file in a library and a bin
29 genmdesc_CFLAGS = $(AM_CFLAGS)
30
31 if NO_VERSION_SCRIPT
32 monoldflags=
33 else
34 monoldflags=-Wl,-version-script=$(srcdir)/ldscript
35 endif
36 libmono_la_LDFLAGS=$(monoldflags)
37
38 if JIT_SUPPORTED
39 bin_PROGRAMS = mono
40
41 noinst_PROGRAMS = genmdesc
42
43 lib_LTLIBRARIES = libmono.la
44 endif
45
46 mono_SOURCES = \
47         main.c
48
49 mono_LDADD = \
50         libmono.la              \
51         $(GLIB_LIBS)            \
52         $(GMODULE_LIBS) -lm     \
53         $(ICU_LIBS)
54
55 mono_LDFLAGS = \
56         $(static_flags) -export-dynamic $(monoldflags)
57
58 genmdesc_SOURCES = \
59         mini.h          \
60         genmdesc.c      \
61         helpers.c
62
63 genmdesc_LDADD = \
64         $(libs) -lm     \
65         $(GLIB_LIBS)            \
66         $(GMODULE_LIBS)
67
68 x86_sources = \
69     mini-exceptions.c   \
70         mini-x86.c              \
71         mini-x86.h              \
72         exceptions-x86.c        \
73         tramp-x86.c
74
75 amd64_sources = \
76         mini-exceptions.c       \
77         mini-amd64.c            \
78         mini-amd64.h            \
79         exceptions-amd64.c      \
80         tramp-amd64.c
81
82 ppc_sources = \
83         mini-ppc.c              \
84         mini-ppc.h              \
85         exceptions-ppc.c        \
86         tramp-ppc.c
87
88 sparc_sources = \
89         mini-sparc.c            \
90         mini-sparc.h            \
91     mini-exceptions.c   \
92         exceptions-sparc.c      \
93         tramp-sparc.c
94
95 s390_sources = \
96         mini-s390.c             \
97         mini-s390.h             \
98         exceptions-s390.c       \
99         tramp-s390.c
100
101 s390x_sources = \
102         mini-s390x.c            \
103         mini-s390x.h            \
104         exceptions-s390x.c      \
105         tramp-s390x.c
106
107 common_sources = \
108         mini.c          \
109         mini.h          \
110         trace.c         \
111         trace.h         \
112         mini-ops.h      \
113         mini-arch.h     \
114         dominators.c    \
115         cfold.c         \
116         regalloc.c      \
117         regalloc.h      \
118         helpers.c       \
119         liveness.c      \
120         ssa.c           \
121         abcremoval.c    \
122         abcremoval.h    \
123         driver.c        \
124         debug-mini.c    \
125         linear-scan.c   \
126         aot.c           \
127         graph.c 
128
129 test_sources =          \
130         basic-calls.cs  \
131         basic-long.cs   \
132         bench.cs                \
133         objects.cs              \
134         arrays.cs               \
135         basic-float.cs  \
136         basic-math.cs   \
137         basic.cs                \
138         exceptions.cs   \
139         iltests.il              \
140         test.cs
141
142 regtests=basic.exe arrays.exe basic-float.exe basic-math.exe basic-long.exe objects.exe basic-calls.exe iltests.exe exceptions.exe bench.exe
143
144 common_BURGSRC= $(srcdir)/inssel.brg $(srcdir)/inssel-float.brg
145
146 if X86
147 libmono_la_SOURCES = \
148         $(common_sources) $(x86_sources)
149
150 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-x86.brg
151 arch_built=cpu-pentium.h
152 endif
153
154 if AMD64
155 libmono_la_SOURCES = \
156         $(common_sources) $(amd64_sources)
157 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-amd64.brg
158 arch_built=cpu-amd64.h
159 endif
160
161 if POWERPC
162 libmono_la_SOURCES = \
163         $(common_sources) $(ppc_sources)
164
165 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-ppc.brg
166 arch_built=cpu-g4.h
167 endif
168
169 if SPARC
170 libmono_la_SOURCES = \
171         $(common_sources) $(sparc_sources)
172
173 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-sparc.brg
174 arch_built=cpu-sparc.h
175 endif
176
177 if SPARC64
178 libmono_la_SOURCES = \
179         $(common_sources) $(sparc_sources)
180
181 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-sparc.brg
182 arch_built=cpu-sparc.h
183 endif
184
185 if S390
186 libmono_la_SOURCES = \
187         $(common_sources) $(s390_sources)
188
189 arch_BURGSRC= $(srcdir)/inssel-long32.brg $(srcdir)/inssel-s390.brg
190 arch_built=cpu-s390.h
191 endif
192
193 if S390x
194 libmono_la_SOURCES = \
195         $(common_sources) $(s390x_sources)
196
197 arch_BURGSRC= $(srcdir)/inssel-long.brg $(srcdir)/inssel-s390x.brg
198 arch_built=cpu-s390x.h
199 endif
200
201 nodist_libmono_la_SOURCES = inssel.c inssel.h
202
203 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
204
205 libmonoincludedir = $(includedir)/mono/jit
206
207 libmonoinclude_HEADERS = jit.h
208
209 libmono_la_LIBADD = \
210         $(libs)
211
212 %.exe: %.cs TestDriver.dll
213         $(MCS) /unsafe $< /r:TestDriver.dll
214
215 %.exe: %.il
216         ilasm /output=$*.exe $<
217
218 TestDriver.dll: TestDriver.cs
219         $(MCS) /out:TestDriver.dll /target:library TestDriver.cs
220
221 cpu-pentium.h: cpu-pentium.md genmdesc$(EXEEXT)
222         ./genmdesc $(srcdir)/cpu-pentium.md cpu-pentium.h pentium_desc
223
224 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
225         ./genmdesc $(srcdir)/cpu-amd64.md cpu-amd64.h amd64_desc
226
227 cpu-g4.h: cpu-g4.md genmdesc$(EXEEXT)
228         ./genmdesc $(srcdir)/cpu-g4.md cpu-g4.h ppcg4
229
230 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
231         ./genmdesc $(srcdir)/cpu-sparc.md cpu-sparc.h sparc_desc
232
233 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
234         ./genmdesc $(srcdir)/cpu-s390.md cpu-s390.h s390
235
236 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
237         ./genmdesc $(srcdir)/cpu-s390x.md cpu-s390x.h s390x
238
239 inssel.c inssel.h: $(BURGSRC)
240         $(monodir)/mono/monoburg/monoburg -c 1 -p -e $(BURGSRC) -d inssel.h -s inssel.c
241
242 testi: mono test.exe
243         ./mono -v -v --ncompile 1 --compile Test:$(mtest) test.exe
244
245 # ensure the tests are actually correct
246 checktests: $(regtests)
247         for i in $(regtests); do $(RUNTIME) $$i; done
248
249 rcheck: mono $(regtests)
250         ./mono --regression $(regtests)
251
252 aotcheck: mono $(regtests)
253         for i in $(regtests); do ./mono --aot $$i; done
254         ./mono --verbose --regression $(regtests)
255         rm -f *.exe.so
256
257 bench: mono test.exe
258         time ./mono --ncompile $(count) --compile Test:$(mtest) test.exe
259
260 mbench: test.exe
261         time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
262
263 stat1: mono bench.exe
264         ./mono --verbose --statfile stats.pl --regression bench.exe
265         perl viewstat.pl stats.pl
266
267 stat2: mono basic.exe
268         ./mono --verbose --statfile stats.pl --regression basic.exe
269         perl viewstat.pl -e stats.pl
270
271 stat3: mono bench.exe
272         ./mono --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe 
273         perl viewstat.pl stats.pl
274
275 docu: mini.sgm
276         docbook2txt mini.sgm
277
278 clean:
279         rm -f mono a.out gmon.out *.o test.exe
280
281 pkgconfigdir = $(libdir)/pkgconfig
282
283 if JIT_SUPPORTED
284 BUILT_SOURCES= inssel.c inssel.h $(arch_built)
285 endif
286
287 CLEANFILES= $(BUILT_SOURCES)
288 EXTRA_DIST = $(common_BURGSRC) jit-icalls.c cprop.c TestDriver.cs ldscript $(test_sources) \
289         inssel-long.brg inssel-long32.brg \
290         $(x86_sources) inssel-x86.brg cpu-pentium.md \
291         $(amd64_sources) inssel-amd64.brg cpu-amd64.md \
292         $(ppc_sources) inssel-ppc.brg cpu-g4.md \
293         $(sparc_sources) inssel-sparc.brg cpu-sparc.md \
294         $(s390_sources) inssel-s390.brg cpu-s390.md \
295         $(s390x_sources) inssel-s390x.brg cpu-s390x.md
296