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