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