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