Merged into single file, added assertions
[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 SHARED_MONO
43 shared_sgen_libraries = libmonoruntimesgen.la 
44 endif
45 sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la 
46 endif
47
48 if SUPPORT_BOEHM
49 if SHARED_MONO
50 shared_boehm_libraries = libmonoruntime.la
51 endif
52 boehm_libraries = $(shared_boehm_libraries) libmonoruntime-static.la
53 endif
54
55 if MOONLIGHT
56 moonlight_libraries = libmonoruntimemoon.la
57 moon-do-build: libmonoruntime-static.la libmonoruntimemoon.la
58 moon-do-clean:
59         -test -z "libmonoruntime-static.la" || rm -f libmonoruntime-static.la
60         -test -z "libmonoruntimemoon.la" || rm -f libmonoruntimemoon.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) $(moonlight_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)\"
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.in.
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 common_sources = \
90         $(platform_sources)     \
91         assembly.c              \
92         attach.h                \
93         attach.c                \
94         char-conversions.h      \
95         cil-coff.h              \
96         class.c                 \
97         class-internals.h       \
98         cominterop.c            \
99         cominterop.h            \
100         console-io.h            \
101         coree.c                 \
102         coree.h                 \
103         culture-info.h          \
104         culture-info-tables.h   \
105         debug-helpers.c         \
106         debug-mono-symfile.h    \
107         debug-mono-symfile.c    \
108         decimal.c               \
109         decimal.h               \
110         domain-internals.h      \
111         environment.c           \
112         environment.h           \
113         exception.c             \
114         exception.h             \
115         file-io.c               \
116         file-io.h               \
117         filewatcher.c           \
118         filewatcher.h           \
119         gc-internal.h           \
120         icall.c                 \
121         icall-def.h             \
122         image.c                 \
123         loader.c                \
124         locales.c               \
125         locales.h               \
126         lock-tracer.c           \
127         lock-tracer.h           \
128         marshal.c               \
129         marshal.h               \
130         mempool.c               \
131         mempool.h               \
132         mempool-internals.h     \
133         metadata.c              \
134         metadata-verify.c       \
135         metadata-internals.h    \
136         method-builder.h        \
137         method-builder.c        \
138         mono-basic-block.c      \
139         mono-basic-block.h      \
140         mono-config.c           \
141         mono-cq.c               \
142         mono-cq.h               \
143         mono-debug.h            \
144         mono-debug.c            \
145         mono-debug-debugger.h   \
146         mono-debug-debugger.c   \
147         mono-endian.c           \
148         mono-endian.h           \
149         mono-hash.h             \
150         mono-mlist.c            \
151         mono-mlist.h            \
152         mono-perfcounters.c     \
153         mono-perfcounters.h     \
154         mono-perfcounters-def.h \
155         mono-ptr-array.h        \
156         mono-wsq.c              \
157         mono-wsq.h              \
158         monitor.h               \
159         nacl-stub.c             \
160         normalization-tables.h  \
161         null-gc.c               \
162         number-formatter.h      \
163         object-internals.h      \
164         opcodes.c               \
165         socket-io.c             \
166         socket-io.h             \
167         process.c               \
168         process.h               \
169         profiler.c              \
170         profiler-private.h      \
171         rand.h                  \
172         rand.c                  \
173         runtime.c               \
174         security.c              \
175         security.h              \
176         security-core-clr.c     \
177         security-core-clr.h     \
178         security-manager.c      \
179         security-manager.h      \
180         string-icalls.c         \
181         string-icalls.h         \
182         sysmath.h               \
183         sysmath.c               \
184         tabledefs.h             \
185         threads.c               \
186         threads-types.h         \
187         threadpool.c            \
188         threadpool.h            \
189         threadpool-internals.h  \
190         verify.c                \
191         verify-internals.h      \
192         wrapper-types.h
193
194 # These source files have compile time dependencies on GC code
195 gc_dependent_sources = \
196         appdomain.c     \
197         domain.c        \
198         gc.c            \
199         monitor.c       \
200         mono-hash.c     \
201         object.c        \
202         reflection.c
203
204 boehm_sources = \
205         boehm-gc.c
206
207 sgen_sources = \
208         sgen-os-posix.c         \
209         sgen-os-mach.c          \
210         sgen-os-win32.c         \
211         sgen-gc.c               \
212         sgen-internal.c         \
213         sgen-pinned-allocator.c \
214         sgen-marksweep.c        \
215         sgen-marksweep-fixed.c  \
216         sgen-marksweep-par.c    \
217         sgen-marksweep-fixed-par.c      \
218         sgen-major-copying.c    \
219         sgen-los.c              \
220         sgen-protocol.c \
221         sgen-bridge.c           \
222         sgen-bridge.h           \
223         sgen-toggleref.c                \
224         sgen-toggleref.h                \
225         sgen-gc.h               \
226         sgen-conf.h             \
227         sgen-archdep.h          \
228         sgen-cardtable.c        \
229         sgen-cardtable.h        \
230         sgen-ssb.c      \
231         sgen-ssb.h      \
232         sgen-pinning.c  \
233         sgen-pinning.h  \
234         sgen-pinning-stats.c    \
235         sgen-workers.c  \
236         sgen-workers.h  \
237         sgen-gray.c     \
238         sgen-gray.h     \
239         sgen-major-copy-object.h \
240         sgen-minor-copy-object.h \
241         sgen-copy-object.h \
242         sgen-major-scan-object.h \
243         sgen-minor-scan-object.h \
244         sgen-protocol.h         \
245         sgen-scan-object.h      \
246         sgen-nursery-allocator.c        \
247         sgen-hash-table.c       \
248         sgen-hash-table.h       \
249         sgen-descriptor.c               \
250         sgen-descriptor.h               \
251         sgen-alloc.c            \
252         sgen-debug.c            \
253         sgen-simple-nursery.c   \
254         sgen-split-nursery.c    \
255         sgen-memory-governor.c  \
256         sgen-memory-governor.h  \
257         sgen-stw.c                              \
258         sgen-fin-weak-hash.c
259
260 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources) $(boehm_sources)
261 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
262
263 if MOONLIGHT
264 libmonoruntimemoon_la_SOURCES = $(libmonoruntime_la_SOURCES)
265 if MOONLIGHT_BOEHM
266 libmonoruntimemoon_la_CFLAGS = $(MOONLIGHT_DEFINES) $(BOEHM_DEFINES)
267 else
268 libmonoruntimemoon_la_CFLAGS = $(MOONLIGHT_DEFINES) $(SGEN_DEFINES)
269 endif
270 endif
271
272 libmonoruntimesgen_la_SOURCES = $(libmonoruntime_la_SOURCES)
273 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
274
275 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
276 libmonoruntime_static_la_LDFLAGS = -static
277 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
278
279 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
280 libmonoruntimesgen_static_la_LDFLAGS = -static
281 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
282
283 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
284
285 libmonoruntimeinclude_HEADERS = \
286         assembly.h              \
287         attrdefs.h              \
288         appdomain.h             \
289         blob.h                  \
290         class.h                 \
291         debug-helpers.h         \
292         debug-mono-symfile.h    \
293         threads.h               \
294         environment.h           \
295         exception.h             \
296         image.h                 \
297         loader.h                \
298         metadata.h              \
299         mono-config.h           \
300         mono-debug.h            \
301         mono-gc.h               \
302         sgen-bridge.h           \
303         object.h                \
304         opcodes.h               \
305         profiler.h              \
306         reflection.h            \
307         row-indexes.h           \
308         tokentype.h             \
309         verify.h                
310
311 if DTRACE_G_REQUIRED
312
313 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
314
315 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
316         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
317         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
318
319 else
320 PEDUMP_DTRACE_OBJECT = 
321 endif
322
323 if SHARED_MONO
324 if SUPPORT_BOEHM
325 pedump_SOURCES =                \
326         pedump.c
327
328 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
329         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
330
331 if PLATFORM_DARWIN
332 pedump_LDFLAGS=-framework CoreFoundation
333 endif
334 endif
335 endif
336
337 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
338                 tpool-poll.c tpool-epoll.c tpool-kqueue.c
339