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