e467bb16676bca8bae89fc9a573f0a40300c6640
[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         -DSUPPRESSION_DIR=\""$(datadir)/mono-$(API_VER)/mono/profiler"\"        \
10         -I$(top_srcdir)         \
11         $(GLIB_CFLAGS)
12
13 if !HOST_WIN32
14 if !DISABLE_LIBRARIES
15 if !DISABLE_PROFILER
16 bin_PROGRAMS = mprof-report
17
18 if HAVE_VTUNE
19 vtune_lib = libmono-profiler-vtune.la
20 endif
21
22 lib_LTLIBRARIES = libmono-profiler-aot.la libmono-profiler-iomap.la libmono-profiler-log.la libmono-profiler-log-static.la $(vtune_lib)
23
24 if PLATFORM_DARWIN
25 libmono_profiler_log_la_LDFLAGS = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
26 endif
27 if PLATFORM_ANDROID
28 libmono_profiler_log_la_LDFLAGS = -avoid-version
29 endif
30 endif
31 endif
32 endif
33
34 if HAVE_OPROFILE
35 # Do something that uses OPROFILE_CFLAGS and OPROFILE_LIBS
36 endif
37
38 if SUPPORT_BOEHM
39 if DISABLE_EXECUTABLES
40 LIBMONO=$(top_builddir)/mono/mini/$(LIBMONO_LA)
41 else
42 if !SHARED_MONO
43 static_libs=    \
44         $(top_builddir)/mono/metadata/libmonoruntime-static.la  \
45         $(top_builddir)/mono/io-layer/libwapi.la        \
46         $(top_builddir)/mono/utils/libmonoutils.la \
47         $(GLIB_LIBS) $(LIBICONV) \
48         $(LIBGC_STATIC_LIBS)
49
50 LIBMONO=$(top_builddir)/mono/mini/$(LIBMONO_LA) $(static_libs)
51 else
52 LIBMONO=$(top_builddir)/mono/mini/$(LIBMONO_LA)
53 endif
54 endif
55 else
56 LIBMONO=$(top_builddir)/mono/mini/libmonosgen-$(API_VER).la
57 endif
58
59 libmono_profiler_aot_la_SOURCES = mono-profiler-aot.c
60 libmono_profiler_aot_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
61 libmono_profiler_iomap_la_SOURCES = mono-profiler-iomap.c
62 libmono_profiler_iomap_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
63 libmono_profiler_log_la_SOURCES = proflog.c
64 libmono_profiler_log_la_LIBADD = $(LIBMONO) $(GLIB_LIBS) $(Z_LIBS)
65 if HAVE_VTUNE
66 libmono_profiler_vtune_la_SOURCES = mono-profiler-vtune.c
67 libmono_profiler_vtune_la_CFLAGS = $(VTUNE_CFLAGS)
68 libmono_profiler_vtune_la_LIBADD = $(VTUNE_LIBS) $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
69 endif
70
71 # The log profile uses eglib functions, so it needs to be linked against
72 # libeglib in shared mode, but not in static mode, since that would
73 # leads to duplicate symbols when it is linked into an app which
74 # also uses eglib (e.g. the runtime). Automake doesn't support this
75 # functionality, so create a separate static version of the library.
76 libmono_profiler_log_static_la_SOURCES = proflog.c
77 libmono_profiler_log_static_la_LDFLAGS = -static
78
79 mprof_report_SOURCES = decode.c
80 mprof_report_LDADD = $(Z_LIBS) $(GLIB_LIBS) $(LIBICONV)
81
82 PLOG_TESTS_SRC=test-alloc.cs test-busy.cs test-monitor.cs test-excleave.cs \
83         test-heapshot.cs test-traces.cs
84 PLOG_TESTS=$(PLOG_TESTS_SRC:.cs=.exe)
85
86 CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
87
88 with_mono_path = MONO_PATH=$(CLASS)
89
90 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
91 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219 -debug
92
93 %.exe: %.cs
94         $(MCS) -out:$@ $<
95
96 testlog: $(PLOG_TESTS)
97         $(with_mono_path) perl $(srcdir)/ptestrunner.pl $(top_builddir)
98
99 if NACL_CODEGEN
100 check-local:
101 else
102 check-local: testlog
103 endif
104
105 suppressiondir = $(datadir)/mono-$(API_VER)/mono/profiler
106 suppression_DATA = mono-profiler-log.suppression
107
108 EXTRA_DIST=utils.c utils.h proflog.h perf_event.h \
109         $(PLOG_TESTS_SRC) ptestrunner.pl \
110         $(suppression_DATA)