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