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