Merge pull request #980 from StephenMcConnel/bug-18638
[mono.git] / mono / profiler / Makefile.am
1 if HAVE_ZLIB
2 Z_LIBS= -lz
3 else
4 Z_LIBS=
5 endif
6
7 AM_CPPFLAGS = \
8         -fexceptions -DMONO_USE_EXC_TABLES      \
9         -I$(top_srcdir)         \
10         $(GLIB_CFLAGS)
11
12 if !DISABLE_LIBRARIES
13 if !DISABLE_PROFILER
14 bin_PROGRAMS = mprof-report
15 lib_LTLIBRARIES = libmono-profiler-cov.la libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la
16 if PLATFORM_DARWIN
17 libmono_profiler_log_la_LDFLAGS = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
18 endif
19 if PLATFORM_ANDROID
20 libmono_profiler_log_la_LDFLAGS = -avoid-version
21 endif
22 endif
23 endif
24
25 if HAVE_OPROFILE
26 # Do something that uses OPROFILE_CFLAGS and OPROFILE_LIBS
27 endif
28
29 if SUPPORT_BOEHM
30 if DISABLE_EXECUTABLES
31 LIBMONO=$(top_builddir)/mono/mini/$(LIBMONO_LA)
32 else
33 if !SHARED_MONO
34 static_libs=    \
35         $(top_builddir)/mono/metadata/libmonoruntime-static.la  \
36         $(top_builddir)/mono/io-layer/libwapi.la        \
37         $(top_builddir)/mono/utils/libmonoutils.la \
38         $(GLIB_LIBS) $(LIBICONV) \
39         $(LIBGC_STATIC_LIBS)
40
41 LIBMONO=$(top_builddir)/mono/mini/$(LIBMONO_LA) $(static_libs)
42 else
43 LIBMONO=$(top_builddir)/mono/mini/$(LIBMONO_LA)
44 endif
45 endif
46 else
47 LIBMONO=$(top_builddir)/mono/mini/libmonosgen-$(API_VER).la
48 endif
49
50 libmono_profiler_cov_la_SOURCES = mono-cov.c
51 libmono_profiler_cov_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
52 libmono_profiler_aot_la_SOURCES = mono-profiler-aot.c
53 libmono_profiler_aot_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
54 #libmono_profiler_logging_la_SOURCES = mono-profiler-logging.c
55 #libmono_profiler_logging_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
56 libmono_profiler_iomap_la_SOURCES = mono-profiler-iomap.c
57 libmono_profiler_iomap_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
58 libmono_profiler_log_la_SOURCES = proflog.c
59 libmono_profiler_log_la_LIBADD = $(LIBMONO) $(Z_LIBS)
60
61 if PLATFORM_ANDROID
62 libmono_profiler_log_la_LIBADD += $(GLIB_LIBS)
63 endif
64
65 mprof_report_SOURCES = decode.c
66 mprof_report_LDADD = $(Z_LIBS)
67
68 PLOG_TESTS_SRC=test-alloc.cs test-busy.cs test-monitor.cs test-excleave.cs \
69         test-heapshot.cs test-traces.cs
70 PLOG_TESTS=$(PLOG_TESTS_SRC:.cs=.exe)
71
72 with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/net_4_5
73
74 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
75 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219 -debug
76
77 %.exe: %.cs
78         $(MCS) -out:$@ $<
79
80 testlog: $(PLOG_TESTS)
81         $(with_mono_path) perl $(srcdir)/ptestrunner.pl $(top_builddir)
82
83 if NACL_CODEGEN
84 check-local:
85 else
86 check-local: testlog
87 endif
88
89 EXTRA_DIST=utils.c utils.h proflog.h log-profiler.txt perf_event.h \
90         $(PLOG_TESTS_SRC) ptestrunner.pl