Merge pull request #4967 from kumpera/profiler-arg-cleanup
[mono.git] / mono / profiler / Makefile.am
index b215a3091c3c87d3da5aee213d6421f9fc3ac585..f96c8a3fcccfba10337d1c2c3597139df56c46c5 100644 (file)
@@ -14,34 +14,35 @@ if !DISABLE_LIBRARIES
 if !DISABLE_PROFILER
 bin_PROGRAMS = mprof-report
 
-if !BITCODE
-prof_shlibs = \
-       libmono-profiler-aot.la \
-       libmono-profiler-iomap.la \
-       libmono-profiler-log.la
-endif
-
 if HAVE_VTUNE
-vtune_stlibs = libmono-profiler-vtune-static.la
-if !BITCODE
-vtune_shlibs = libmono-profiler-vtune.la
-endif
+vtune_libs = libmono-profiler-vtune.la libmono-profiler-vtune-static.la
 endif
 
 lib_LTLIBRARIES = \
-       $(prof_shlibs) \
+       libmono-profiler-aot.la \
        libmono-profiler-aot-static.la \
+       libmono-profiler-iomap.la \
        libmono-profiler-iomap-static.la \
+       libmono-profiler-log.la \
        libmono-profiler-log-static.la \
-       $(vtune_shlibs) \
-       $(vtune_stlibs)
+       $(vtune_libs)
 
 suppressiondir = $(datadir)/mono-$(API_VER)/mono/profiler
 suppression_DATA = mono-profiler-log.suppression
 
 if PLATFORM_DARWIN
+if BITCODE
+prof_ldflags = -no-undefined
+else
 prof_ldflags = -Wl,-undefined -Wl,suppress -Wl,-flat_namespace
 endif
+endif
+
+if TARGET_OSX
+libmono_dep =
+else
+libmono_dep = $(monodir)/mono/mini/$(LIBMONO_LA)
+endif
 
 if PLATFORM_ANDROID
 prof_ldflags = -avoid-version
@@ -49,49 +50,51 @@ endif
 
 # FIXME fix the profiler tests to work with coop.
 if !ENABLE_COOP
-if !NACL_CODEGEN
 check_targets = testlog
 endif
-endif
 
 endif
 endif
 endif
 
+monodir=$(top_builddir)
+
 # The log profiler uses eglib functions, so it needs to be linked against
 # libeglib in shared mode, but not in static mode, since that would
 # leads to duplicate symbols when it is linked into an app which
 # also uses eglib (e.g. the runtime). Automake doesn't support this
 # functionality, so create a separate static version of the library.
 
-libmono_profiler_aot_la_SOURCES = mono-profiler-aot.c
-libmono_profiler_aot_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
+libmono_profiler_aot_la_SOURCES = aot.c
+libmono_profiler_aot_la_LIBADD =  $(libmono_dep) $(GLIB_LIBS) $(LIBICONV)
 libmono_profiler_aot_la_LDFLAGS = $(prof_ldflags)
-libmono_profiler_aot_static_la_SOURCES = mono-profiler-aot.c
+libmono_profiler_aot_static_la_SOURCES = aot.c
 libmono_profiler_aot_static_la_LDFLAGS = -static
 
-libmono_profiler_iomap_la_SOURCES = mono-profiler-iomap.c
-libmono_profiler_iomap_la_LIBADD = $(GLIB_LIBS) $(LIBICONV)
+libmono_profiler_iomap_la_SOURCES = iomap.c
+libmono_profiler_iomap_la_LIBADD = $(libmono_dep) $(GLIB_LIBS) $(LIBICONV)
 libmono_profiler_iomap_la_LDFLAGS = $(prof_ldflags)
-libmono_profiler_iomap_static_la_SOURCES = mono-profiler-iomap.c
+libmono_profiler_iomap_static_la_SOURCES = iomap.c
 libmono_profiler_iomap_static_la_LDFLAGS = -static
 
-libmono_profiler_log_la_SOURCES = proflog.c
-libmono_profiler_log_la_LIBADD = $(GLIB_LIBS) $(Z_LIBS)
+libmono_profiler_log_la_SOURCES = log.c log-args.c
+libmono_profiler_log_la_LIBADD = $(libmono_dep) $(GLIB_LIBS) $(Z_LIBS)
 libmono_profiler_log_la_LDFLAGS = $(prof_ldflags)
-libmono_profiler_log_static_la_SOURCES = proflog.c
+libmono_profiler_log_static_la_SOURCES = log.c log-args.c
 libmono_profiler_log_static_la_LDFLAGS = -static
 
 if HAVE_VTUNE
-libmono_profiler_vtune_la_SOURCES = mono-profiler-vtune.c
+libmono_profiler_vtune_la_SOURCES = vtune.c
 libmono_profiler_vtune_la_CFLAGS = $(VTUNE_CFLAGS)
-libmono_profiler_vtune_la_LIBADD = $(VTUNE_LIBS) $(GLIB_LIBS) $(LIBICONV)
+libmono_profiler_vtune_la_LIBADD = $(VTUNE_LIBS) $(LIBMONO) $(GLIB_LIBS) $(LIBICONV)
 libmono_profiler_vtune_la_LDFLAGS = $(prof_ldflags)
-libmono_profiler_vtune_static_la_SOURCES = mono-profiler-vtune.c
+libmono_profiler_vtune_static_la_SOURCES = vtune.c
 libmono_profiler_vtune_static_la_LDFLAGS = -static
+libmono_profiler_vtune_static_la_CFLAGS = $(VTUNE_CFLAGS)
+libmono_profiler_vtune_static_la_LIBADD = $(VTUNE_LIBS)
 endif
 
-mprof_report_SOURCES = decode.c
+mprof_report_SOURCES = mprof-report.c
 mprof_report_LDADD = $(Z_LIBS) $(GLIB_LIBS) $(LIBICONV)
 
 PLOG_TESTS_SRC=test-alloc.cs test-busy.cs test-monitor.cs test-excleave.cs \
@@ -100,19 +103,19 @@ PLOG_TESTS=$(PLOG_TESTS_SRC:.cs=.exe)
 
 CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)
 
-with_mono_path = MONO_PATH=$(CLASS)
-
-RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
-MCS = $(RUNTIME) $(mcs_topdir)/class/lib/build/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219 -debug
+TOOLS_RUNTIME = MONO_PATH=$(mcs_topdir)/class/lib/build $(top_builddir)/runtime/mono-wrapper
+MCS = $(TOOLS_RUNTIME) $(CSC) -lib:$(CLASS) -unsafe -nologo -noconfig -nowarn:0162 -nowarn:0168 -nowarn:0219 -debug:portable
 
 %.exe: %.cs
        $(MCS) -out:$@ $<
 
 testlog: $(PLOG_TESTS)
-       $(with_mono_path) perl $(srcdir)/ptestrunner.pl $(top_builddir)
+       MONO_PATH=$(CLASS) perl $(srcdir)/ptestrunner.pl $(top_builddir)
 
 check-local: $(check_targets)
 
-EXTRA_DIST=utils.c utils.h proflog.h \
-       $(PLOG_TESTS_SRC) ptestrunner.pl \
+EXTRA_DIST=log.h \
+       aot.h \
+       $(PLOG_TESTS_SRC) \
+       ptestrunner.pl \
        $(suppression_DATA)