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