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