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