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