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