Add support to the x86 backend for generating code compatible with Google
[mono.git] / mono / mini / Makefile.am
1 count=100000
2 mtest=for_loop
3 monodir=$(top_builddir)
4
5 # This is needed for automake dependency generation
6 if INCLUDED_LIBGC
7 libgc_libs=$(monodir)/libgc/libmonogc.la
8 libgc_static_libs=$(monodir)/libgc/libmonogc-static.la
9 else
10 libgc_libs=$(LIBGC_LIBS)
11 libgc_static_libs=$(LIBGC_STATIC_LIBS)
12 endif
13
14 libs=   \
15         $(monodir)/mono/metadata/libmonoruntime.la      \
16         $(monodir)/mono/io-layer/libwapi.la     \
17         $(monodir)/mono/utils/libmonoutils.la \
18         $(GLIB_LIBS)    \
19         $(libgc_libs)
20
21 sgen_libs = \
22         $(monodir)/mono/metadata/libmonoruntimesgen.la  \
23         $(monodir)/mono/io-layer/libwapi.la     \
24         $(monodir)/mono/utils/libmonoutils.la \
25         $(GLIB_LIBS)
26
27 static_libs=    \
28         $(monodir)/mono/metadata/libmonoruntime-static.la       \
29         $(monodir)/mono/io-layer/libwapi.la     \
30         $(monodir)/mono/utils/libmonoutils.la \
31         $(GLIB_LIBS)    \
32         $(libgc_static_libs)
33
34 sgenstatic_libs = \
35         $(monodir)/mono/metadata/libmonoruntimesgen-static.la   \
36         $(monodir)/mono/io-layer/libwapi.la     \
37         $(monodir)/mono/utils/libmonoutils.la \
38         $(GLIB_LIBS)
39
40 CLASS=$(mcs_topdir)/class/lib/net_2_0
41
42 RUNTIME_EXECUTABLE = $(if $(SGEN),$(top_builddir)/mono/mini/mono-sgen,$(top_builddir)/runtime/mono-wrapper)
43
44 RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME_EXECUTABLE)
45 RUNTIME_AOTCHECK = MONO_PATH=$(CLASS):. $(RUNTIME_EXECUTABLE)
46
47 MCS = $(RUNTIME) $(CLASS)/gmcs.exe -unsafe -nowarn:0162
48 ILASM = $(RUNTIME) $(CLASS)/ilasm.exe
49
50 AM_CFLAGS = \
51         -I$(top_srcdir)         \
52         $(GLIB_CFLAGS)          \
53         $(LLVM_CFLAGS)          \
54         $(PLATFORM_CFLAGS) $(ARCH_CFLAGS)
55
56 AM_CXXFLAGS = $(LLVM_CXXFLAGS) $(GLIB_CFLAGS)
57
58 if HOST_WIN32
59 export HOST_CC
60 # The mingw math.h has "extern inline" functions that dont appear in libs, so
61 # optimisation is required to actually inline them
62 PLATFORM_CFLAGS = -O
63 endif
64
65 # hack for automake to have the same source file in a library and a bin
66 genmdesc_CFLAGS = $(AM_CFLAGS)
67
68 if NO_VERSION_SCRIPT
69 monoldflags=$(export_ldflags)
70 monobinldflags=$(export_ldflags)
71 else
72 monoldflags=-Wl,-version-script=$(srcdir)/ldscript $(export_ldflags)
73 monobinldflags=-Wl,-version-script=$(srcdir)/ldscript.mono $(export_ldflags)
74 endif
75
76 if HOST_WIN32
77 libmono_2_0_la_LDFLAGS=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
78 else
79 libmono_2_0_la_LDFLAGS=$(monoldflags) -version-info 1:0:0
80 endif
81
82 if JIT_SUPPORTED
83
84 if SUPPORT_SGEN
85 sgen_binaries = mono-sgen
86 sgen_libraries = libmonosgen-2.0.la
87 sgen_static_libraries = libmonosgen-static.la
88 endif
89
90 if HOST_WIN32
91 bin_PROGRAMS = mono monow
92 else
93 bin_PROGRAMS = mono $(sgen_binaries)
94 endif
95
96 noinst_PROGRAMS = genmdesc
97
98 lib_LTLIBRARIES = libmono-2.0.la $(sgen_libraries)
99 noinst_LTLIBRARIES = libmono-static.la $(sgen_static_libraries)
100
101 if MOONLIGHT
102 noinst_LTLIBRARIES += libmono-moon.la
103 endif
104
105 if LOADED_LLVM
106 lib_LTLIBRARIES += libmono-llvm.la
107 libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp
108 libmono_llvm_la_LIBADD = $(top_builddir)/mono/mini/libmono-$(API_VER).la $(LLVM_LIBS) $(LLVM_LDFLAGS) $(libs)
109 endif
110
111 endif
112
113 mono_SOURCES = \
114         main.c
115
116 mono_CFLAGS = $(AM_CFLAGS) $(BOEHM_DEFINES) $(LIBGC_CFLAGS)
117
118 mono_sgen_SOURCES = $(mono_SOURCES)
119 mono_sgen_CFLAGS = $(SGEN_DEFINES) $(AM_CFLAGS)
120
121 # We build this after libmono was built so it contains the date when the final
122 # link was done
123 buildver.h: libmono-static.la
124         @echo "const char *build_date = \"`date`\";" > buildver.h
125
126 mono-main.$(OBJEXT): buildver.h
127 mono_sgen-main.$(OBJEXT): buildver.h
128
129 if DTRACE_G_REQUIRED
130 LIBMONO_DTRACE_OBJECT = .libs/mono-dtrace.$(OBJEXT)
131 if STATIC_MONO
132 MONO_DTRACE_OBJECT = mono-dtrace.$(OBJEXT)
133 else
134 MONO_DTRACE_OBJECT = 
135 endif
136 else
137 MONO_DTRACE_OBJECT = 
138 LIBMONO_DTRACE_OBJECT = 
139 endif
140
141 if STATIC_MONO
142 # Link libmono into mono statically
143 # This leads to higher performance, especially with TLS
144 MONO_LIB=libmono-static.la
145 MONO_SGEN_LIB=libmonosgen-static.la
146 else 
147 MONO_LIB=libmono-2.0.la
148 MONO_SGEN_LIB=libmonosgen-2.0.la
149 endif
150
151 if LOADED_LLVM
152 LLVMMONOF=
153 else
154 LLVMMONOF=$(LLVM_LIBS) $(LLVM_LDFLAGS)
155 endif
156
157 mono_LDADD = \
158         $(MONO_LIB)             \
159         $(GLIB_LIBS)            \
160         $(LLVMMONOF)            \
161         -lm                     \
162         $(MONO_DTRACE_OBJECT)
163
164 mono_LDFLAGS = \
165         $(static_flags) -export-dynamic $(monobinldflags) $(monobin_platform_ldflags)
166
167 mono_sgen_LDADD = \
168         $(MONO_SGEN_LIB)        \
169         $(GLIB_LIBS)            \
170         $(LLVMMONOF)            \
171         -lm                     \
172         $(MONO_DTRACE_OBJECT)
173
174 mono_sgen_LDFLAGS = $(static_flags) -export-dynamic $(monobinldflags) $(monobin_platform_ldflags)
175
176 if DTRACE_G_REQUIRED
177
178 mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime-static.la
179         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
180         $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime-static.la mini.lo
181
182 .libs/mono-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d mini.lo $(monodir)/mono/metadata/libmonoruntime.la
183         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
184         --pic $@ $(top_srcdir)/data/mono.d $(monodir)/mono/metadata/libmonoruntime.la mini.lo
185
186 endif
187
188 # Create monow.exe, linked for the 'windows' subsystem
189 if HOST_WIN32
190 monow_LDADD = $(mono_LDADD)
191 monow_LDFLAGS = $(mono_LDFLAGS) -mwindows
192 monow_SOURCES = $(mono_SOURCES)
193 endif
194
195 genmdesc_SOURCES = \
196         mini.h          \
197         genmdesc.c      \
198         helpers.c       \
199         ../metadata/opcodes.c
200
201 # Don't link this against libmonoruntime to speed up rebuilds
202 genmdesc_LDADD = \
203         $(monodir)/mono/utils/libmonoutils.la -lm       \
204         $(GLIB_LIBS)
205
206 x86_sources = \
207         mini-x86.c              \
208         mini-x86.h              \
209         exceptions-x86.c        \
210         tramp-x86.c
211
212 amd64_sources = \
213         mini-amd64.c            \
214         mini-amd64.h            \
215         exceptions-amd64.c      \
216         tramp-amd64.c
217
218 ppc_sources = \
219         mini-ppc.c              \
220         mini-ppc.h              \
221         exceptions-ppc.c        \
222         tramp-ppc.c
223
224 arm_sources = \
225         mini-arm.c              \
226         mini-arm.h              \
227         exceptions-arm.c        \
228         tramp-arm.c
229
230 mips_sources = \
231         mini-mips.c             \
232         mini-mips.h             \
233         exceptions-mips.c       \
234         tramp-mips.c
235
236 sparc_sources = \
237         mini-sparc.c            \
238         mini-sparc.h            \
239         exceptions-sparc.c      \
240         tramp-sparc.c
241
242 s390_sources = \
243         mini-s390.c             \
244         mini-s390.h             \
245         exceptions-s390.c       \
246         tramp-s390.c
247
248 s390x_sources = \
249         mini-s390x.c            \
250         mini-s390x.h            \
251         exceptions-s390x.c      \
252         tramp-s390x.c
253
254 ia64_sources = \
255         mini-ia64.c             \
256         mini-ia64.h             \
257         exceptions-ia64.c       \
258         tramp-ia64.c
259
260 alpha_sources = \
261         mini-alpha.c            \
262         mini-alpha.h            \
263         exceptions-alpha.c      \
264         tramp-alpha.c
265
266 hppa_sources = \
267         mini-hppa.c             \
268         mini-hppa.h             \
269         exceptions-hppa.c       \
270         tramp-hppa.c
271
272 darwin_sources = \
273         mini-darwin.c
274
275 windows_sources = \
276         mini-windows.c
277
278 posix_sources = \
279         mini-posix.c
280
281 if ENABLE_LLVM
282 if LOADED_LLVM
283 llvm_sources =
284 else
285 llvm_sources = \
286         mini-llvm.c             \
287         mini-llvm-cpp.cpp
288 endif
289 endif
290
291 common_sources = \
292         mini.c                  \
293         ir-emit.h               \
294         method-to-ir.c          \
295         decompose.c             \
296         mini.h                  \
297         version.h               \
298         optflags-def.h          \
299         jit-icalls.h            \
300         jit-icalls.c            \
301         trace.c                 \
302         trace.h                 \
303         patch-info.h            \
304         mini-ops.h              \
305         mini-arch.h             \
306         dominators.c            \
307         cfold.c                 \
308         regalloc.c              \
309         regalloc.h              \
310         helpers.c               \
311         liveness.c              \
312         ssa.c                   \
313         abcremoval.c            \
314         abcremoval.h            \
315         ssapre.c                \
316         ssapre.h                \
317         local-propagation.c     \
318         driver.c                \
319         debug-mini.c            \
320         debug-mini.h            \
321         linear-scan.c           \
322         aot-compiler.c          \
323         aot-runtime.c           \
324         graph.c                 \
325         mini-codegen.c          \
326         mini-exceptions.c       \
327         mini-trampolines.c      \
328         declsec.c               \
329         declsec.h               \
330         wapihandles.c           \
331         branch-opts.c           \
332         mini-generic-sharing.c  \
333         regalloc2.c             \
334         simd-methods.h          \
335         tasklets.c              \
336         tasklets.h              \
337         simd-intrinsics.c       \
338         mini-unwind.h           \
339         unwind.c                \
340         image-writer.h          \
341         image-writer.c          \
342         dwarfwriter.h           \
343         dwarfwriter.c           \
344         mini-gc.h               \
345         mini-gc.c               \
346         debugger-agent.h        \
347         debugger-agent.c        \
348         debug-debugger.c        \
349         debug-debugger.h        \
350         xdebug.c                        \
351         mini-llvm.h                     \
352         mini-llvm-cpp.h
353
354 test_sources =                  \
355         basic-calls.cs          \
356         basic-long.cs           \
357         bench.cs                \
358         objects.cs              \
359         arrays.cs               \
360         basic-float.cs          \
361         basic-math.cs           \
362         basic.cs                \
363         exceptions.cs           \
364         devirtualization.cs     \
365         iltests.il.in           \
366         test.cs                 \
367         generics.cs             \
368         generics-variant-types.il\
369         basic-simd.cs
370
371 regtests=basic.exe basic-float.exe basic-long.exe basic-calls.exe objects.exe arrays.exe basic-math.exe exceptions.exe iltests.exe devirtualization.exe generics.exe basic-simd.exe
372 fsatests=basic.exe basic-float.exe basic-long.exe basic-calls.exe objects.exe arrays.exe basic-math.exe exceptions.exe devirtualization.exe basic-simd.exe
373
374 if X86
375 if MONO_DEBUGGER_SUPPORTED
376 if PLATFORM_DARWIN
377 mdb_x86 = mdb-debug-info32-darwin.s
378 else
379 mdb_x86 = mdb-debug-info32.s
380 endif
381 else
382 mdb_x86 = 
383 endif
384 arch_sources = $(x86_sources) $(mdb_x86)
385 arch_built=cpu-x86.h
386 arch_define=__i386__
387 endif
388
389 if AMD64
390 if MONO_DEBUGGER_SUPPORTED
391 arch_sources = $(amd64_sources) mdb-debug-info64.s
392 else
393 arch_sources = $(amd64_sources)
394 endif
395 arch_built=cpu-amd64.h
396 arch_define=__x86_64__
397 endif
398
399 if POWERPC
400 arch_sources = $(ppc_sources)
401 arch_built=cpu-ppc.h
402 arch_define=__ppc__
403 endif
404
405 if POWERPC64
406 arch_sources = $(ppc_sources)
407 arch_built=cpu-ppc64.h
408 arch_define=__ppc64__
409 endif
410
411 if MIPS
412 arch_sources = $(mips_sources)
413 arch_built=cpu-mips.h
414 arch_define=__mips__
415 endif
416
417 if ARM
418 # pick up arm_dpimacros.h and arm_fpamacros.h
419 ARCH_CFLAGS = -I../arch/arm
420 arch_sources = $(arm_sources)
421 arch_built=cpu-arm.h
422 arch_define=__arm__
423 endif
424
425 if SPARC
426 arch_sources = $(sparc_sources)
427 arch_built=cpu-sparc.h
428 arch_define=__sparc__
429 endif
430
431 if SPARC64
432 arch_sources = $(sparc_sources)
433 arch_built=cpu-sparc.h
434 arch_define=__sparc__
435 endif
436
437 if S390
438 arch_sources = $(s390_sources)
439 arch_built=cpu-s390.h
440 arch_define=__s390__
441 endif
442
443 if S390x
444 arch_sources = $(s390x_sources)
445 arch_built=cpu-s390x.h
446 arch_define=__s390__
447 endif
448
449 if IA64
450 arch_sources = $(ia64_sources)
451 arch_built = cpu-ia64.h
452 arch_define=__ia64__
453 endif
454
455 if ALPHA
456 arch_sources = $(alpha_sources) $(mono_debugger_sources)
457 arch_built = cpu-alpha.h
458 arch_define=__alpha__
459 endif
460
461 if HPPA
462 # Only support 32-bit targets for now
463 arch_sources = $(hppa_sources)
464 arch_built = cpu-hppa.h
465 arch_define=__hppa__
466 endif
467
468 if HOST_WIN32
469 os_sources = $(windows_sources)
470 monobin_platform_ldflags=
471 endif
472
473 if PLATFORM_SIGPOSIX
474 os_sources = $(posix_sources)
475 monobin_platform_ldflags=
476 endif
477
478 if PLATFORM_DARWIN
479 os_sources = $(darwin_sources) $(posix_sources)
480 #monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist -framework CoreFoundation
481 monobin_platform_ldflags=-framework CoreFoundation
482 endif
483
484 libmono_2_0_la_SOURCES = $(common_sources) $(llvm_sources) $(arch_sources) $(os_sources)
485 libmono_2_0_la_CFLAGS = $(AM_CFLAGS) $(BOEHM_DEFINES) $(LIBGC_CFLAGS)
486
487 libmonosgen_2_0_la_SOURCES = $(libmono_2_0_la_SOURCES)
488 libmonosgen_2_0_la_CFLAGS = $(AM_CFLAGS) $(SGEN_DEFINES)
489
490 if MOONLIGHT
491 libmono_moon_la_SOURCES = $(libmono_2_0_la_SOURCES)
492 libmono_moon_la_CFLAGS = $(AM_CFLAGS) $(BOEHM_DEFINES) $(LIBGC_CFLAGS)
493 endif
494
495 libmono_static_la_SOURCES = $(libmono_2_0_la_SOURCES)
496 libmono_static_la_CFLAGS = $(AM_CFLAGS) $(BOEHM_DEFINES) $(LIBGC_CFLAGS)
497 libmono_static_la_LDFLAGS = -static
498 libmono_static_la_LIBADD = $(static_libs) $(MONO_DTRACE_OBJECT)
499
500 libmonosgen_static_la_SOURCES = $(libmono_2_0_la_SOURCES)
501 libmonosgen_static_la_CFLAGS = $(AM_CFLAGS) $(SGEN_DEFINES)
502 libmonosgen_static_la_LDFLAGS = -static
503 libmonosgen_static_la_LIBADD = $(sgenstatic_libs) $(MONO_DTRACE_OBJECT)
504
505 nodist_libmono_static_la_SOURCES = $(nodist_libmono_la_SOURCES)
506 nodist_libmono_static_la_CFLAGS = $(AM_CFLAGS) $(BOEHM_DEFINES) $(LIBGC_CFLAGS)
507
508 BURGSRC= $(common_BURGSRC) $(arch_BURGSRC)
509
510 libmonoincludedir = $(includedir)/mono-$(API_VER)/mono/jit
511
512 libmonoinclude_HEADERS = jit.h
513
514 libmono_2_0_la_LIBADD = \
515         $(libs) $(LIBMONO_DTRACE_OBJECT)
516
517 libmonosgen_2_0_la_LIBADD = \
518         $(sgen_libs) $(LIBMONO_DTRACE_OBJECT)
519
520 if MOONLIGHT
521 libmono_moon_la_LIBADD = $(libmono_2_0_la_LIBADD)
522 endif
523
524 basic-simd.exe: basic-simd.cs
525         $(MCS) -out:$@ $< -r:TestDriver.dll -r:Mono.Simd.dll
526
527 generics.exe: generics.cs TestDriver.dll generics-variant-types.dll
528         $(MCS) -out:$@ $< -r:TestDriver.dll -r:generics-variant-types.dll
529
530 %.exe: %.cs TestDriver.dll
531         $(MCS) -out:$@ -unsafe $< -r:TestDriver.dll
532
533 iltests.il: iltests.il.in Makefile.am
534         echo '// DO NOT EDIT: This file has been generated from iltests.il.in' > iltests.il
535         cpp -Darch=$(arch_define) < $(srcdir)/iltests.il.in | sed 's/^#.*//' >> iltests.il
536
537 %.exe: %.il
538         $(ILASM) -output=$@ $<
539
540 TestDriver.dll: $(srcdir)/TestDriver.cs
541         $(MCS) -out:$@ -target:library $<
542
543 generics-variant-types.dll: generics-variant-types.il
544         $(ILASM) -dll -output=$@ $<
545
546 if NACL_CODEGEN
547 GENMDESC_OPTS=--nacl
548 else !NACL_CODEGEN
549 GENMDESC_OPTS=
550 endif !NACL_CODEGEN
551
552 # we don't always use the perl impl because it's an additional
553 # build dependency for the poor windows users
554 # $(arch_define) is the preprocessor symbol that enables all the opcodes
555 # for the specific platform in mini-ops.h
556 if CROSS_COMPILING
557 GENMDESC_PRG=perl $(srcdir)/genmdesc.pl $(arch_define) $(srcdir) $(GENMDESC_OPTS)
558 else !CROSS_COMPILING
559 GENMDESC_PRG=./genmdesc $(GENMDESC_OPTS)
560 endif !CROSS_COMPILING
561
562 cpu-x86.h: cpu-x86.md genmdesc$(EXEEXT)
563         $(GENMDESC_PRG) cpu-x86.h x86_desc $(srcdir)/cpu-x86.md
564
565 cpu-amd64.h: cpu-amd64.md genmdesc$(EXEEXT)
566         $(GENMDESC_PRG) cpu-amd64.h amd64_desc $(srcdir)/cpu-amd64.md
567
568 cpu-ppc.h: cpu-ppc.md genmdesc$(EXEEXT)
569         $(GENMDESC_PRG) cpu-ppc.h ppcg4 $(srcdir)/cpu-ppc.md
570
571 cpu-ppc64.h: cpu-ppc64.md genmdesc$(EXEEXT)
572         $(GENMDESC_PRG) cpu-ppc64.h ppc64_cpu_desc $(srcdir)/cpu-ppc64.md
573
574 cpu-arm.h: cpu-arm.md genmdesc$(EXEEXT)
575         $(GENMDESC_PRG) cpu-arm.h arm_cpu_desc $(srcdir)/cpu-arm.md
576
577 cpu-sparc.h: cpu-sparc.md genmdesc$(EXEEXT)
578         $(GENMDESC_PRG) cpu-sparc.h sparc_desc $(srcdir)/cpu-sparc.md
579
580 cpu-s390.h: cpu-s390.md genmdesc$(EXEEXT)
581         $(GENMDESC_PRG) cpu-s390.h s390_cpu_desc $(srcdir)/cpu-s390.md
582
583 cpu-s390x.h: cpu-s390x.md genmdesc$(EXEEXT)
584         $(GENMDESC_PRG) cpu-s390x.h s390x_cpu_desc $(srcdir)/cpu-s390x.md
585
586 cpu-ia64.h: cpu-ia64.md genmdesc$(EXEEXT)
587         $(GENMDESC_PRG) cpu-ia64.h ia64_desc $(srcdir)/cpu-ia64.md
588
589 cpu-alpha.h: cpu-alpha.md genmdesc$(EXEEXT)
590         $(GENMDESC_PRG) cpu-alpha.h alpha_desc $(srcdir)/cpu-alpha.md
591
592 cpu-hppa.h: cpu-hppa.md genmdesc$(EXEEXT)
593         $(GENMDESC_PRG) cpu-hppa.h hppa_desc $(srcdir)/cpu-hppa.md
594
595 cpu-mips.h: cpu-mips.md genmdesc$(EXEEXT)
596         $(GENMDESC_PRG) cpu-mips.h mips_desc $(srcdir)/cpu-mips.md
597
598 testi: mono test.exe
599         $(RUNTIME) -v -v --ncompile 1 --compile Test:$(mtest) test.exe
600
601 # ensure the tests are actually correct
602 checktests: $(regtests)
603         for i in $(regtests); do $(RUNTIME) $$i; done
604
605 rcheck: mono $(regtests)
606         $(RUNTIME) --regression $(regtests)
607
608 aotcheck: mono $(regtests)
609         rm -f *.exe.so
610         $(RUNTIME) --aot $(regtests) || exit 1
611         for i in $(regtests); do $(RUNTIME_AOTCHECK) --regression $$i || exit 1; done
612         rm -f *.exe.so
613
614 # This currently only works on amd64/arm
615 fullaotcheck: mono $(regtests)
616         rm -rf fullaot-tmp
617         mkdir fullaot-tmp
618         cp $(CLASS)/mscorlib.dll $(CLASS)/System.Core.dll $(CLASS)/System.dll $(CLASS)/Mono.Posix.dll $(CLASS)/System.Configuration.dll $(CLASS)/System.Security.dll $(CLASS)/System.Xml.dll $(CLASS)/Mono.Security.dll $(CLASS)/Mono.Simd.dll $(regtests) generics-variant-types.dll TestDriver.dll fullaot-tmp/
619         cp $(regtests) fullaot-tmp/
620         MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper --aot=full fullaot-tmp/* || exit 1
621         for i in $(regtests); do echo $$i; MONO_PATH=fullaot-tmp $(top_builddir)/runtime/mono-wrapper --full-aot fullaot-tmp/$$i --exclude '!FULLAOT' || exit 1; done
622
623 fsacheck: mono $(fsatests) fsacheck.c generics.exe
624         rm -rf fsa-tmp
625         mkdir fsa-tmp
626         cp $(CLASS)/mscorlib.dll $(CLASS)/System.Core.dll $(CLASS)/System.dll $(CLASS)/Mono.Posix.dll $(CLASS)/System.Configuration.dll $(CLASS)/System.Security.dll $(CLASS)/System.Xml.dll $(CLASS)/Mono.Security.dll $(CLASS)/Mono.Simd.dll \
627         $(fsatests) generics-variant-types.dll TestDriver.dll fsa-tmp/
628         cp $(fsatests) fsa-tmp/
629         MONO_PATH=fsa-tmp $(top_builddir)/runtime/mono-wrapper --aot=full,static fsa-tmp/*.dll || exit 1
630         MONO_PATH=fsa-tmp $(top_builddir)/runtime/mono-wrapper --aot=full,static fsa-tmp/*.exe || exit 1
631         $(CC) -o $@.out -g -static $(VPATH)/fsacheck.c fsa-tmp/*.o \
632         -lmono-2.0 -lpthread -lm -ldl -lrt \
633         -DTARGET_X86 -L.libs -I${prefix}/include/mono-2.0 \
634         -I${prefix} -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
635         for i in $(fsatests); do echo $$i; MONO_PATH=fsa-tmp ./$@.out $$i || exit 1; done
636
637 bench: mono test.exe
638         time env $(RUNTIME) --ncompile $(count) --compile Test:$(mtest) test.exe
639
640 mbench: test.exe
641         time $(monodir)/mono/jit/mono --ncompile $(count) --compile Test:$(mtest) test.exe
642
643 stat1: mono bench.exe
644         $(RUNTIME) --verbose --statfile stats.pl --regression bench.exe
645         perl viewstat.pl stats.pl
646
647 stat2: mono basic.exe
648         $(RUNTIME) --verbose --statfile stats.pl --regression basic.exe
649         perl viewstat.pl -e stats.pl
650
651 stat3: mono bench.exe
652         $(RUNTIME) --statfile stats.pl --ncompile 1000 --compile Tests:test_0_many_nested_loops bench.exe 
653         perl viewstat.pl stats.pl
654
655 docu: mini.sgm
656         docbook2txt mini.sgm
657
658 check-local: rcheck
659
660 clean-local:
661         rm -f mono a.out gmon.out *.o buildver.h test.exe
662
663 pkgconfigdir = $(libdir)/pkgconfig
664
665 if JIT_SUPPORTED
666 BUILT_SOURCES = version.h $(arch_built)
667 else
668 BUILT_SOURCES = version.h
669 endif
670
671 CLEANFILES= $(BUILT_SOURCES) *.exe *.dll
672 EXTRA_DIST = $(common_BURGSRC) TestDriver.cs ldscript ldscript.mono \
673         genmdesc.pl                             \
674         $(test_sources)                         \
675         $(x86_sources) cpu-x86.md               \
676         $(amd64_sources) cpu-amd64.md           \
677         $(ppc_sources) cpu-ppc.md cpu-ppc64.md  \
678         $(arm_sources) cpu-arm.md               \
679         $(mips_sources) cpu-mips.md             \
680         $(sparc_sources) cpu-sparc.md           \
681         $(s390_sources) cpu-s390.md             \
682         $(s390x_sources) cpu-s390x.md           \
683         $(ia64_sources) cpu-ia64.md             \
684         $(alpha_sources) cpu-alpha.md           \
685         $(hppa_sources) cpu-hppa.md             \
686         $(windows_sources)                      \
687         $(darwin_sources) Info.plist            \
688         $(posix_sources)
689
690 version.h: Makefile
691         if test -d $(top_srcdir)/.git; then \
692                 (cd $(top_srcdir); \
693                         LANG=C; export LANG; \
694                         branch=`git branch | grep '^\*' | cut -d ' ' -f 2`; \
695                         version=`git log --no-color --first-parent -n1 --pretty=format:%h`; \
696                         echo "#define FULL_VERSION \"$$branch/$$version\""; \
697                 ); \
698         else \
699                 echo "#define FULL_VERSION \"tarball\""; \
700         fi > version.h
701
702 # Utility target for patching libtool to speed up linking
703 patch-libtool:
704         sed -e 's,if (for obj in $$oldobjs,if (for obj in "",g' < ../../libtool > 2; mv 2 ../../libtool
705         chmod a+x ../../libtool
706
707 tags:
708         etags -o TAGS `find .. -name "*.h" -o -name "*.c"`