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