Merge pull request #1635 from alexrp/core-clr-properties
[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 = $(shared_sgen_libraries) $(shared_boehm_libraries)
65 else
66 noinst_LTLIBRARIES = $(boehm_libraries) $(sgen_libraries)
67 endif
68
69 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" $(SHARED_CFLAGS)
70
71 #
72 # Make sure any prefix changes are updated in the binaries too.
73 #
74 #  assembly.c uses MONO_ASSEMBLIES
75 #  mono-config.c uses MONO_CFG_DIR
76 #
77 # This won't result in many more false positives than AC_DEFINEing them
78 # in configure.ac.
79 #
80 assembly.lo mono-config.lo: Makefile
81
82 CLEANFILES = mono-bundle.stamp
83
84 libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
85
86 null_sources = \
87         console-null.c
88
89 null_gc_sources = \
90         null-gc.c
91
92 common_sources = \
93         $(platform_sources)     \
94         assembly.c              \
95         attach.h                \
96         attach.c                \
97         char-conversions.h      \
98         cil-coff.h              \
99         class.c                 \
100         class-internals.h       \
101         cominterop.c            \
102         cominterop.h            \
103         console-io.h            \
104         coree.c                 \
105         coree.h                 \
106         culture-info.h          \
107         culture-info-tables.h   \
108         debug-helpers.c         \
109         debug-mono-symfile.h    \
110         debug-mono-symfile.c    \
111         decimal-ms.c            \
112         decimal-ms.h            \
113         domain-internals.h      \
114         environment.c           \
115         environment.h           \
116         exception.c             \
117         exception.h             \
118         file-io.c               \
119         file-io.h               \
120         filewatcher.c           \
121         filewatcher.h           \
122         gc-internal.h           \
123         gc-memfuncs.c           \
124         icall.c                 \
125         icall-def.h             \
126         image.c                 \
127         jit-info.c              \
128         loader.c                \
129         locales.c               \
130         locales.h               \
131         lock-tracer.c           \
132         lock-tracer.h           \
133         marshal.c               \
134         marshal.h               \
135         mempool.c               \
136         mempool.h               \
137         mempool-internals.h     \
138         metadata.c              \
139         metadata-verify.c       \
140         metadata-internals.h    \
141         method-builder.h        \
142         method-builder.c        \
143         mono-basic-block.c      \
144         mono-basic-block.h      \
145         mono-config.c           \
146         mono-cq.c               \
147         mono-cq.h               \
148         mono-debug.h            \
149         mono-debug.c            \
150         mono-debug-debugger.h   \
151         mono-endian.c           \
152         mono-endian.h           \
153         mono-hash.h             \
154         mono-mlist.c            \
155         mono-mlist.h            \
156         mono-perfcounters.c     \
157         mono-perfcounters.h     \
158         mono-perfcounters-def.h \
159         mono-ptr-array.h        \
160         mono-route.c            \
161         mono-route.h            \
162         mono-wsq.c              \
163         mono-wsq.h              \
164         monitor.h               \
165         nacl-stub.c             \
166         normalization-tables.h  \
167         number-formatter.h      \
168         object-internals.h      \
169         opcodes.c               \
170         socket-io.c             \
171         socket-io.h             \
172         process.c               \
173         process.h               \
174         profiler.c              \
175         profiler-private.h      \
176         rand.h                  \
177         rand.c                  \
178         remoting.h              \
179         remoting.c              \
180         runtime.c               \
181         mono-security.c         \
182         security.h              \
183         security-core-clr.c     \
184         security-core-clr.h     \
185         security-manager.c      \
186         security-manager.h      \
187         string-icalls.c         \
188         string-icalls.h         \
189         sysmath.h               \
190         sysmath.c               \
191         tabledefs.h             \
192         threads.c               \
193         threads-types.h         \
194         threadpool.c            \
195         threadpool.h            \
196         threadpool-internals.h  \
197         threadpool-microsoft.c  \
198         threadpool-microsoft.h  \
199         tpool-poll.c    \
200         verify.c                \
201         verify-internals.h      \
202         wrapper-types.h \
203         reflection-internals.h  \
204         file-mmap-posix.c       \
205         file-mmap-windows.c     \
206         file-mmap.h     \
207         object-offsets.h        \
208         abi-details.h   \
209         metadata-cross-helpers.c        \
210         seq-points-data.h       \
211         seq-points-data.c
212
213
214 # These source files have compile time dependencies on GC code
215 gc_dependent_sources = \
216         appdomain.c     \
217         domain.c        \
218         gc.c            \
219         monitor.c       \
220         mono-hash.c     \
221         object.c        \
222         reflection.c
223
224 boehm_sources = \
225         boehm-gc.c
226
227 sgen_sources = \
228         sgen-os-posix.c         \
229         sgen-os-mach.c          \
230         sgen-os-win32.c         \
231         sgen-gc.c               \
232         sgen-internal.c         \
233         sgen-marksweep.c        \
234         sgen-los.c              \
235         sgen-protocol.c \
236         sgen-bridge.c           \
237         sgen-bridge.h           \
238         sgen-old-bridge.c               \
239         sgen-new-bridge.c               \
240         sgen-tarjan-bridge.c            \
241         sgen-toggleref.c                \
242         sgen-toggleref.h                \
243         sgen-gc.h               \
244         sgen-conf.h             \
245         sgen-archdep.h          \
246         sgen-cardtable.c        \
247         sgen-cardtable.h        \
248         sgen-pointer-queue.c    \
249         sgen-pointer-queue.h    \
250         sgen-pinning.c  \
251         sgen-pinning.h  \
252         sgen-pinning-stats.c    \
253         sgen-workers.c  \
254         sgen-workers.h  \
255         sgen-gray.c     \
256         sgen-gray.h     \
257         sgen-major-copy-object.h \
258         sgen-minor-copy-object.h \
259         sgen-copy-object.h \
260         sgen-marksweep-scan-object-concurrent.h \
261         sgen-minor-scan-object.h \
262         sgen-marksweep-drain-gray-stack.h       \
263         sgen-protocol.h         \
264         sgen-protocol-def.h             \
265         sgen-scan-object.h      \
266         sgen-nursery-allocator.c        \
267         sgen-hash-table.c       \
268         sgen-hash-table.h       \
269         sgen-descriptor.c               \
270         sgen-descriptor.h               \
271         sgen-alloc.c            \
272         sgen-debug.c            \
273         sgen-simple-nursery.c   \
274         sgen-split-nursery.c    \
275         sgen-memory-governor.c  \
276         sgen-memory-governor.h  \
277         sgen-stw.c                              \
278         sgen-fin-weak-hash.c    \
279         sgen-layout-stats.c     \
280         sgen-layout-stats.h     \
281         sgen-qsort.c    \
282         sgen-qsort.h    \
283         sgen-tagged-pointer.h
284
285 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
286 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
287
288 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
289 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
290
291 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
292 libmonoruntime_static_la_LDFLAGS = -static
293 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
294
295 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
296 libmonoruntimesgen_static_la_LDFLAGS = -static
297 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
298
299 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
300
301 libmonoruntimeinclude_HEADERS = \
302         assembly.h              \
303         attrdefs.h              \
304         appdomain.h             \
305         blob.h                  \
306         class.h                 \
307         debug-helpers.h         \
308         debug-mono-symfile.h    \
309         threads.h               \
310         environment.h           \
311         exception.h             \
312         image.h                 \
313         loader.h                \
314         metadata.h              \
315         mono-config.h           \
316         mono-debug.h            \
317         mono-gc.h               \
318         sgen-bridge.h           \
319         object.h                \
320         opcodes.h               \
321         profiler.h              \
322         reflection.h            \
323         row-indexes.h           \
324         tokentype.h             \
325         verify.h                
326
327 if DTRACE_G_REQUIRED
328
329 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
330
331 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
332         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
333         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
334
335 else
336 PEDUMP_DTRACE_OBJECT = 
337 endif
338
339 if SHARED_MONO
340 if SUPPORT_BOEHM
341 pedump_SOURCES =                \
342         pedump.c
343
344 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
345         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
346
347 if PLATFORM_DARWIN
348 pedump_LDFLAGS=-framework CoreFoundation -framework Foundation
349 endif
350 endif
351 endif
352
353 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
354                 tpool-poll.c tpool-epoll.c tpool-kqueue.c