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