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