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