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