Merge pull request #5248 from alexrp/profiler-api
[mono.git] / mono / metadata / Makefile.am
1 if HOST_WIN32
2 win32_sources = \
3         console-win32.c \
4         console-win32-internals.h \
5         cominterop-win32-internals.h \
6         w32file-win32.c \
7         w32file-win32-internals.h \
8         icall-windows.c \
9         icall-windows-internals.h \
10         marshal-windows.c \
11         marshal-windows-internals.h \
12         mono-security-windows.c \
13         mono-security-windows-internals.h \
14         w32mutex-win32.c \
15         w32semaphore-win32.c \
16         w32event-win32.c \
17         w32process-win32.c \
18         w32process-win32-internals.h \
19         w32socket-win32.c \
20         w32error-win32.c
21
22 platform_sources = $(win32_sources)
23
24 # Use -m here. This will use / as directory separator (C:/WINNT).
25 # The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
26 # / by \ if running under WIN32.
27 if CROSS_COMPILING
28 assembliesdir = ${libdir}
29 confdir = ${sysconfdir}
30 else
31 assembliesdir = `cygpath -m "${libdir}"`
32 confdir = `cygpath -m "${sysconfdir}"`
33 endif
34 export HOST_CC
35 # The mingw math.h has "extern inline" functions that dont appear in libs, so
36 # optimisation is required to actually inline them
37 AM_CFLAGS = -O
38 else
39
40 assembliesdir = $(exec_prefix)/lib
41 confdir = $(sysconfdir)
42 unix_sources = \
43         console-unix.c \
44         w32mutex-unix.c \
45         w32semaphore-unix.c \
46         w32event-unix.c \
47         w32process-unix.c \
48         w32process-unix-internals.h \
49         w32process-unix-osx.c \
50         w32process-unix-bsd.c \
51         w32process-unix-haiku.c \
52         w32process-unix-default.c \
53         w32socket-unix.c \
54         w32file-unix.c \
55         w32file-unix-glob.c \
56         w32file-unix-glob.h \
57         w32error-unix.c
58
59 platform_sources = $(unix_sources)
60 endif
61
62 if PLATFORM_ANDROID
63 platform_sources += ../../support/libm/complex.c
64 endif
65
66 #
67 # libtool is not capable of creating static/shared versions of the same
68 # convenience lib, so we have to do it ourselves
69 #
70 if SUPPORT_SGEN
71 if DISABLE_EXECUTABLES
72 shared_sgen_libraries = libmonoruntimesgen.la 
73 else
74 if SHARED_MONO
75 shared_sgen_libraries = libmonoruntimesgen.la 
76 endif
77 endif
78 sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la 
79 endif
80
81 if SUPPORT_BOEHM
82 if DISABLE_EXECUTABLES
83 shared_boehm_libraries = libmonoruntime.la
84 else
85 if SHARED_MONO
86 shared_boehm_libraries = libmonoruntime.la
87 endif
88 endif
89 boehm_libraries = $(shared_boehm_libraries) libmonoruntime-static.la
90 endif
91
92 if DISABLE_EXECUTABLES
93 noinst_LTLIBRARIES = libmonoruntime-config.la $(shared_sgen_libraries) $(shared_boehm_libraries)
94 else
95 noinst_LTLIBRARIES = libmonoruntime-config.la $(boehm_libraries) $(sgen_libraries)
96 endif
97
98 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS)
99
100 #
101 # Make sure any prefix changes are updated in the binaries too.
102 #
103 # This won't result in many more false positives than AC_DEFINEing them
104 # in configure.ac.
105 #
106 mono-config-dirs.lo: Makefile
107
108 #
109 # This library is used to localize the usage of MONO_BINDIR etc. to just one source file, thus enabling
110 # ccache to work even if the value of these defines change. We need to use a convenience library since automake
111 # doesn't support per file cflags.
112 #
113 libmonoruntime_config_la_SOURCES = \
114         mono-config-dirs.h              \
115         mono-config-dirs.c
116 libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" -DMONO_RELOC_LIBDIR=\"../$(reloc_libdir)\"
117
118 CLEANFILES = mono-bundle.stamp
119
120 null_sources = \
121         console-null.c
122
123 null_gc_sources = \
124         null-gc.c \
125         null-gc-handles.h \
126         null-gc-handles.c
127
128 common_sources = \
129         $(platform_sources)     \
130         appdomain-icalls.h      \
131         assembly.c              \
132         assembly-internals.h    \
133         attach.h                \
134         attach.c                \
135         cil-coff.h              \
136         class.c                 \
137         class-internals.h       \
138         class-inlines.h         \
139         class-accessors.c       \
140         cominterop.c            \
141         cominterop.h            \
142         console-io.h            \
143         coree.c                 \
144         coree.h                 \
145         coree-internals.h \
146         culture-info.h          \
147         culture-info-tables.h   \
148         debug-helpers.c         \
149         debug-mono-symfile.h    \
150         debug-mono-symfile.c    \
151         debug-mono-ppdb.h       \
152         debug-mono-ppdb.c       \
153         decimal-ms.c            \
154         decimal-ms.h            \
155         domain-internals.h      \
156         environment.c           \
157         environment.h           \
158         exception.c             \
159         exception.h             \
160         exception-internals.h   \
161         w32file.c               \
162         w32file.h               \
163         w32file-internals.h \
164         filewatcher.c           \
165         filewatcher.h           \
166         gc-internals.h          \
167         icall.c                 \
168         icall-internals.h \
169         icall-def.h             \
170         image.c                 \
171         image-internals.h       \
172         jit-info.c              \
173         loader.c                \
174         locales.c               \
175         locales.h               \
176         lock-tracer.c           \
177         lock-tracer.h           \
178         marshal.c               \
179         marshal.h               \
180         marshal-internals.h \
181         mempool.c               \
182         mempool.h               \
183         mempool-internals.h     \
184         metadata.c              \
185         metadata-verify.c       \
186         metadata-internals.h    \
187         method-builder.h        \
188         method-builder.c        \
189         mono-basic-block.c      \
190         mono-basic-block.h      \
191         mono-config.c           \
192         mono-debug.h            \
193         mono-debug.c            \
194         debug-internals.h       \
195         mono-endian.c           \
196         mono-endian.h           \
197         mono-hash.h             \
198         mono-conc-hash.h                \
199         mono-mlist.c            \
200         mono-mlist.h            \
201         mono-perfcounters.c     \
202         mono-perfcounters.h     \
203         mono-perfcounters-def.h \
204         mono-ptr-array.h        \
205         mono-route.c            \
206         mono-route.h            \
207         monitor.h               \
208         normalization-tables.h  \
209         number-formatter.h      \
210         number-ms.c             \
211         number-ms.h             \
212         object-internals.h      \
213         opcodes.c               \
214         property-bag.h  \
215         property-bag.c  \
216         w32socket.c             \
217         w32socket.h             \
218         w32socket-internals.h           \
219         w32process.c            \
220         w32process.h            \
221         w32process-internals.h          \
222         profiler.c              \
223         profiler-events.h       \
224         profiler-legacy.c       \
225         profiler-private.h      \
226         rand.h                  \
227         rand.c                  \
228         remoting.h              \
229         remoting.c              \
230         runtime.c               \
231         mono-security.c         \
232         security.h              \
233         security-core-clr.c     \
234         security-core-clr.h     \
235         security-manager.c      \
236         security-manager.h      \
237         string-icalls.c         \
238         string-icalls.h         \
239         sysmath.h               \
240         sysmath.c               \
241         tabledefs.h             \
242         threads.c               \
243         threads-types.h         \
244         threadpool.c    \
245         threadpool.h    \
246         threadpool-worker-default.c     \
247         threadpool-worker.h     \
248         threadpool-io.c \
249         threadpool-io.h \
250         verify.c                \
251         verify-internals.h      \
252         wrapper-types.h \
253         dynamic-image-internals.h       \
254         dynamic-stream.c        \
255         dynamic-stream-internals.h      \
256         reflection-cache.h      \
257         custom-attrs-internals.h        \
258         sre-internals.h \
259         reflection-internals.h  \
260         file-mmap-posix.c       \
261         file-mmap-windows.c     \
262         file-mmap.h     \
263         object-offsets.h        \
264         abi-details.h   \
265         metadata-cross-helpers.c        \
266         seq-points-data.h       \
267         seq-points-data.c       \
268         handle.c        \
269         handle.h        \
270         w32mutex.h      \
271         w32semaphore.h  \
272         w32event.h      \
273         w32handle-namespace.h   \
274         w32handle-namespace.c   \
275         w32handle.h     \
276         w32handle.c     \
277         w32error.h
278
279 # These source files have compile time dependencies on GC code
280 gc_dependent_sources = \
281         appdomain.c     \
282         domain.c        \
283         gc-stats.c      \
284         gc.c            \
285         monitor.c       \
286         mono-hash.c     \
287         mono-conc-hash.c        \
288         object.c        \
289         dynamic-image.c \
290         sre.c   \
291         sre-encode.c    \
292         sre-save.c      \
293         custom-attrs.c  \
294         reflection.c
295
296
297 boehm_sources = \
298         boehm-gc.c
299
300 sgen_sources = \
301         sgen-bridge.c           \
302         sgen-bridge.h           \
303         sgen-bridge-internals.h \
304         sgen-old-bridge.c               \
305         sgen-new-bridge.c               \
306         sgen-tarjan-bridge.c            \
307         sgen-toggleref.c                \
308         sgen-toggleref.h                \
309         sgen-stw.c                              \
310         sgen-mono.c             \
311         sgen-client-mono.h
312
313 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
314 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
315 libmonoruntime_la_LIBADD = libmonoruntime-config.la
316
317 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
318 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
319 libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
320
321 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
322 libmonoruntime_static_la_LDFLAGS = -static
323 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
324 libmonoruntime_static_la_LIBADD = $(bundle_obj) libmonoruntime-config.la
325
326 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
327 libmonoruntimesgen_static_la_LDFLAGS = -static
328 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
329 libmonoruntimesgen_static_la_LIBADD = libmonoruntime-config.la
330
331 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
332
333 libmonoruntimeinclude_HEADERS = \
334         assembly.h              \
335         attrdefs.h              \
336         appdomain.h             \
337         blob.h                  \
338         class.h                 \
339         debug-helpers.h         \
340         debug-mono-symfile.h    \
341         threads.h               \
342         environment.h           \
343         exception.h             \
344         image.h                 \
345         loader.h                \
346         metadata.h              \
347         mono-config.h           \
348         mono-debug.h            \
349         mono-gc.h               \
350         sgen-bridge.h           \
351         object.h                \
352         opcodes.h               \
353         profiler.h              \
354         reflection.h            \
355         row-indexes.h           \
356         tokentype.h             \
357         verify.h                
358
359 EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
360                 threadpool-io-poll.c threadpool-io-epoll.c threadpool-io-kqueue.c sgen-dynarray.h