Enabled possibility to exclude SafeArray implementation on Windows.
[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         assembly.c              \
123         assembly-internals.h    \
124         attach.h                \
125         attach.c                \
126         cil-coff.h              \
127         class.c                 \
128         class-internals.h       \
129         class-inlines.h         \
130         class-accessors.c       \
131         cominterop.c            \
132         cominterop.h            \
133         console-io.h            \
134         coree.c                 \
135         coree.h                 \
136         coree-internals.h \
137         culture-info.h          \
138         culture-info-tables.h   \
139         debug-helpers.c         \
140         debug-mono-symfile.h    \
141         debug-mono-symfile.c    \
142         debug-mono-ppdb.h       \
143         debug-mono-ppdb.c       \
144         decimal-ms.c            \
145         decimal-ms.h            \
146         domain-internals.h      \
147         environment.c           \
148         environment.h           \
149         exception.c             \
150         exception.h             \
151         exception-internals.h   \
152         file-io.c               \
153         file-io.h               \
154         file-io-internals.h \
155         filewatcher.c           \
156         filewatcher.h           \
157         gc-internals.h          \
158         icall.c                 \
159         icall-internals.h \
160         icall-def.h             \
161         image.c                 \
162         image-internals.h       \
163         jit-info.c              \
164         loader.c                \
165         locales.c               \
166         locales.h               \
167         lock-tracer.c           \
168         lock-tracer.h           \
169         marshal.c               \
170         marshal.h               \
171         marshal-internals.h \
172         mempool.c               \
173         mempool.h               \
174         mempool-internals.h     \
175         metadata.c              \
176         metadata-verify.c       \
177         metadata-internals.h    \
178         method-builder.h        \
179         method-builder.c        \
180         mono-basic-block.c      \
181         mono-basic-block.h      \
182         mono-config.c           \
183         mono-debug.h            \
184         mono-debug.c            \
185         mono-debug-debugger.h   \
186         mono-endian.c           \
187         mono-endian.h           \
188         mono-hash.h             \
189         mono-mlist.c            \
190         mono-mlist.h            \
191         mono-perfcounters.c     \
192         mono-perfcounters.h     \
193         mono-perfcounters-def.h \
194         mono-ptr-array.h        \
195         mono-route.c            \
196         mono-route.h            \
197         monitor.h               \
198         nacl-stub.c             \
199         normalization-tables.h  \
200         number-formatter.h      \
201         number-ms.c             \
202         number-ms.h             \
203         object-internals.h      \
204         opcodes.c               \
205         property-bag.h  \
206         property-bag.c  \
207         socket-io.c             \
208         socket-io.h             \
209         w32process.c            \
210         w32process.h            \
211         w32process-internals.h          \
212         profiler.c              \
213         profiler-private.h      \
214         rand.h                  \
215         rand.c                  \
216         remoting.h              \
217         remoting.c              \
218         runtime.c               \
219         mono-security.c         \
220         security.h              \
221         security-core-clr.c     \
222         security-core-clr.h     \
223         security-manager.c      \
224         security-manager.h      \
225         string-icalls.c         \
226         string-icalls.h         \
227         sysmath.h               \
228         sysmath.c               \
229         tabledefs.h             \
230         threads.c               \
231         threads-types.h         \
232         threadpool-ms.c \
233         threadpool-ms.h \
234         threadpool-ms-io.c      \
235         threadpool-ms-io.h      \
236         verify.c                \
237         verify-internals.h      \
238         wrapper-types.h \
239         dynamic-image-internals.h       \
240         dynamic-stream.c        \
241         dynamic-stream-internals.h      \
242         reflection-cache.h      \
243         custom-attrs-internals.h        \
244         sre-internals.h \
245         reflection-internals.h  \
246         file-mmap-posix.c       \
247         file-mmap-windows.c     \
248         file-mmap.h     \
249         object-offsets.h        \
250         abi-details.h   \
251         metadata-cross-helpers.c        \
252         seq-points-data.h       \
253         seq-points-data.c       \
254         handle.c        \
255         handle.h        \
256         w32mutex.h      \
257         w32semaphore.h  \
258         w32event.h      \
259         w32handle-namespace.h   \
260         w32handle-namespace.c   \
261         w32handle.h     \
262         w32handle.c
263
264 # These source files have compile time dependencies on GC code
265 gc_dependent_sources = \
266         appdomain.c     \
267         domain.c        \
268         gc-stats.c      \
269         gc.c            \
270         monitor.c       \
271         mono-hash.c     \
272         object.c        \
273         dynamic-image.c \
274         sre.c   \
275         sre-encode.c    \
276         sre-save.c      \
277         custom-attrs.c  \
278         reflection.c
279
280
281 boehm_sources = \
282         boehm-gc.c
283
284 sgen_sources = \
285         sgen-bridge.c           \
286         sgen-bridge.h           \
287         sgen-bridge-internals.h \
288         sgen-old-bridge.c               \
289         sgen-new-bridge.c               \
290         sgen-tarjan-bridge.c            \
291         sgen-toggleref.c                \
292         sgen-toggleref.h                \
293         sgen-stw.c                              \
294         sgen-mono.c             \
295         sgen-client-mono.h
296
297 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
298 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
299 libmonoruntime_la_LIBADD = libmonoruntime-config.la
300
301 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
302 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
303 libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
304
305 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
306 libmonoruntime_static_la_LDFLAGS = -static
307 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
308 libmonoruntime_static_la_LIBADD = $(bundle_obj) libmonoruntime-config.la
309
310 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
311 libmonoruntimesgen_static_la_LDFLAGS = -static
312 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
313 libmonoruntimesgen_static_la_LIBADD = libmonoruntime-config.la
314
315 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
316
317 libmonoruntimeinclude_HEADERS = \
318         assembly.h              \
319         attrdefs.h              \
320         appdomain.h             \
321         blob.h                  \
322         class.h                 \
323         debug-helpers.h         \
324         debug-mono-symfile.h    \
325         threads.h               \
326         environment.h           \
327         exception.h             \
328         image.h                 \
329         loader.h                \
330         metadata.h              \
331         mono-config.h           \
332         mono-debug.h            \
333         mono-gc.h               \
334         sgen-bridge.h           \
335         object.h                \
336         opcodes.h               \
337         profiler.h              \
338         reflection.h            \
339         row-indexes.h           \
340         tokentype.h             \
341         verify.h                
342
343 EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
344                 threadpool-ms-io-poll.c threadpool-ms-io-epoll.c threadpool-ms-io-kqueue.c sgen-dynarray.h