Merge pull request #3613 from kloun/patch-4
[mono-project.git] / mono / profiler / Makefile.am
blob3d7eb62e4004b07a10c4644c3086e9eedf21b66a
1 if HAVE_ZLIB
2 Z_LIBS= -lz
3 else
4 Z_LIBS=
5 endif
7 AM_CPPFLAGS = \
8         -DSUPPRESSION_DIR=\""$(datadir)/mono-$(API_VER)/mono/profiler"\"        \
9         -I$(top_srcdir)         \
10         $(GLIB_CFLAGS)
12 if !HOST_WIN32
13 if !DISABLE_LIBRARIES
14 if !DISABLE_PROFILER
15 bin_PROGRAMS = mprof-report
17 if HAVE_VTUNE
18 vtune_libs = libmono-profiler-vtune.la libmono-profiler-vtune-static.la
19 endif
21 lib_LTLIBRARIES = \
22         libmono-profiler-aot.la \
23         libmono-profiler-aot-static.la \
24         libmono-profiler-iomap.la \
25         libmono-profiler-iomap-static.la \
26         libmono-profiler-log.la \
27         libmono-profiler-log-static.la \
28         $(vtune_libs)
30 suppressiondir = $(datadir)/mono-$(API_VER)/mono/profiler
31 suppression_DATA = mono-profiler-log.suppression
33 if PLATFORM_DARWIN
34 if BITCODE
35 prof_ldflags = -no-undefined
36 else
37 prof_ldflags = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
38 endif
39 endif
41 if PLATFORM_ANDROID
42 prof_ldflags = -avoid-version
43 endif
45 # FIXME fix the profiler tests to work with coop.
46 if !ENABLE_COOP
47 if !NACL_CODEGEN
48 check_targets = testlog
49 endif
50 endif
52 endif
53 endif
54 endif
56 monodir=$(top_builddir)
58 # The log profiler uses eglib functions, so it needs to be linked against
59 # libeglib in shared mode, but not in static mode, since that would
60 # leads to duplicate symbols when it is linked into an app which
61 # also uses eglib (e.g. the runtime). Automake doesn't support this
62 # functionality, so create a separate static version of the library.
64 libmono_profiler_aot_la_SOURCES = mono-profiler-aot.c
65 libmono_profiler_aot_la_LIBADD =  $(monodir)/mono/mini/$(LIBMONO_LA) $(GLIB_LIBS) $(LIBICONV)
66 libmono_profiler_aot_la_LDFLAGS = $(prof_ldflags)
67 libmono_profiler_aot_static_la_SOURCES = mono-profiler-aot.c
68 libmono_profiler_aot_static_la_LDFLAGS = -static
70 libmono_profiler_iomap_la_SOURCES = mono-profiler-iomap.c
71 libmono_profiler_iomap_la_LIBADD = $(monodir)/mono/mini/$(LIBMONO_LA) $(GLIB_LIBS) $(LIBICONV)
72 libmono_profiler_iomap_la_LDFLAGS = $(prof_ldflags)
73 libmono_profiler_iomap_static_la_SOURCES = mono-profiler-iomap.c
74 libmono_profiler_iomap_static_la_LDFLAGS = -static
76 libmono_profiler_log_la_SOURCES = proflog.c
77 libmono_profiler_log_la_LIBADD = $(monodir)/mono/mini/$(LIBMONO_LA) $(GLIB_LIBS) $(Z_LIBS)
78 libmono_profiler_log_la_LDFLAGS = $(prof_ldflags)
79 libmono_profiler_log_static_la_SOURCES = proflog.c
80 libmono_profiler_log_static_la_LDFLAGS = -static
82 if HAVE_VTUNE
83 libmono_profiler_vtune_la_SOURCES = mono-profiler-vtune.c
84 libmono_profiler_vtune_la_CFLAGS = $(VTUNE_CFLAGS)
85 libmono_profiler_vtune_la_LIBADD = $(VTUNE_LIBS) $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
86 libmono_profiler_vtune_la_LDFLAGS = $(prof_ldflags)
87 libmono_profiler_vtune_static_la_SOURCES = mono-profiler-vtune.c
88 libmono_profiler_vtune_static_la_LDFLAGS = -static
89 endif
91 mprof_report_SOURCES = decode.c
92 mprof_report_LDADD = $(Z_LIBS) $(GLIB_LIBS) $(LIBICONV)
94 PLOG_TESTS_SRC=test-alloc.cs test-busy.cs test-monitor.cs test-excleave.cs \
95         test-heapshot.cs test-traces.cs
96 PLOG_TESTS=$(PLOG_TESTS_SRC:.cs=.exe)
98 CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
100 with_mono_path = MONO_PATH=$(CLASS)
102 RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
103 MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219 -debug
105 %.exe: %.cs
106         $(MCS) -out:$@ $<
108 testlog: $(PLOG_TESTS)
109         $(with_mono_path) perl $(srcdir)/ptestrunner.pl $(top_builddir)
111 check-local: $(check_targets)
113 EXTRA_DIST=utils.c utils.h proflog.h \
114         $(PLOG_TESTS_SRC) ptestrunner.pl \
115         $(suppression_DATA)