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