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