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