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