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