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