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