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