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