Merge pull request #186 from QuickJack/master
[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 MOONLIGHT
49 moonlight_libraries = libmonoruntimemoon.la
50 moon-do-build: libmonoruntime-static.la libmonoruntimemoon.la
51 moon-do-clean:
52         -test -z "libmonoruntime-static.la" || rm -f libmonoruntime-static.la
53         -test -z "libmonoruntimemoon.la" || rm -f libmonoruntimemoon.la
54 endif
55
56 if SHARED_MONO
57 if SUPPORT_BOEHM
58 shared_libraries = libmonoruntime.la
59 endif
60 endif
61 noinst_LTLIBRARIES =  $(shared_libraries) libmonoruntime-static.la $(sgen_libraries) $(moonlight_libraries)
62
63 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
64
65 #
66 # Make sure any prefix changes are updated in the binaries too.
67 #
68 #  assembly.c uses MONO_ASSEMBLIES
69 #  mono-config.c uses MONO_CFG_DIR
70 #
71 # This won't result in many more false positives than AC_DEFINEing them
72 # in configure.in.
73 #
74 assembly.lo mono-config.lo: Makefile
75
76 CLEANFILES = mono-bundle.stamp
77
78 libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
79
80 null_sources = \
81         console-null.c
82
83 sgen_sources = \
84         sgen-cardtable.c        \
85         sgen-gray.c             \
86         sgen-pinning.c          \
87         sgen-pinning-stats.c    \
88         sgen-workers.c          \
89         sgen-fin-weak-hash.c
90
91 libmonoruntime_la_SOURCES = \
92         $(platform_sources)     \
93         appdomain.c             \
94         assembly.c              \
95         attach.h                \
96         attach.c                \
97         boehm-gc.c              \
98         char-conversions.h      \
99         cil-coff.h              \
100         class.c                 \
101         class-internals.h       \
102         cominterop.c            \
103         cominterop.h            \
104         console-io.h            \
105         coree.c                 \
106         coree.h                 \
107         culture-info.h          \
108         culture-info-tables.h   \
109         debug-helpers.c         \
110         debug-mono-symfile.h    \
111         debug-mono-symfile.c    \
112         decimal.c               \
113         decimal.h               \
114         domain.c                \
115         domain-internals.h      \
116         environment.c           \
117         environment.h           \
118         exception.c             \
119         exception.h             \
120         file-io.c               \
121         file-io.h               \
122         filewatcher.c           \
123         filewatcher.h           \
124         gc.c                    \
125         gc-internal.h           \
126         icall.c                 \
127         icall-def.h             \
128         image.c                 \
129         loader.c                \
130         locales.c               \
131         locales.h               \
132         lock-tracer.c           \
133         lock-tracer.h           \
134         marshal.c               \
135         marshal.h               \
136         mempool.c               \
137         mempool.h               \
138         mempool-internals.h     \
139         metadata.c              \
140         metadata-verify.c       \
141         metadata-internals.h    \
142         method-builder.h        \
143         method-builder.c        \
144         mono-basic-block.c      \
145         mono-basic-block.h      \
146         mono-config.c           \
147         mono-cq.c               \
148         mono-cq.h               \
149         mono-debug.h            \
150         mono-debug.c            \
151         mono-debug-debugger.h   \
152         mono-debug-debugger.c   \
153         mono-endian.c           \
154         mono-endian.h           \
155         mono-hash.c             \
156         mono-hash.h             \
157         mono-mlist.c            \
158         mono-mlist.h            \
159         mono-perfcounters.c     \
160         mono-perfcounters.h     \
161         mono-perfcounters-def.h \
162         mono-ptr-array.h        \
163         mono-wsq.c              \
164         mono-wsq.h              \
165         monitor.c               \
166         monitor.h               \
167         nacl-stub.c             \
168         normalization-tables.h  \
169         null-gc.c               \
170         number-formatter.h      \
171         object.c                \
172         object-internals.h      \
173         opcodes.c               \
174         socket-io.c             \
175         socket-io.h             \
176         process.c               \
177         process.h               \
178         profiler.c              \
179         profiler-private.h      \
180         rand.h                  \
181         rand.c                  \
182         runtime.c               \
183         reflection.c            \
184         security.c              \
185         security.h              \
186         security-core-clr.c     \
187         security-core-clr.h     \
188         security-manager.c      \
189         security-manager.h      \
190         sgen-os-posix.c         \
191         sgen-os-mach.c          \
192         sgen-os-win32.c         \
193         sgen-gc.c               \
194         sgen-internal.c         \
195         sgen-pinned-allocator.c \
196         sgen-marksweep.c        \
197         sgen-marksweep-fixed.c  \
198         sgen-marksweep-par.c    \
199         sgen-marksweep-fixed-par.c      \
200         sgen-major-copying.c    \
201         sgen-los.c              \
202         sgen-protocol.c \
203         sgen-bridge.c           \
204         sgen-bridge.h           \
205         sgen-toggleref.c                \
206         sgen-toggleref.h                \
207         sgen-gc.h               \
208         sgen-archdep.h          \
209         sgen-cardtable.h        \
210         sgen-major-copy-object.h \
211         sgen-major-scan-object.h \
212         sgen-protocol.h         \
213         sgen-scan-object.h      \
214         sgen-nursery-allocator.c        \
215         sgen-hash-table.c       \
216         string-icalls.c         \
217         string-icalls.h         \
218         sysmath.h               \
219         sysmath.c               \
220         tabledefs.h             \
221         threads.c               \
222         threads-types.h         \
223         threadpool.c            \
224         threadpool.h            \
225         threadpool-internals.h  \
226         verify.c                \
227         verify-internals.h      \
228         wrapper-types.h
229
230 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
231
232 if MOONLIGHT
233 libmonoruntimemoon_la_SOURCES = $(libmonoruntime_la_SOURCES)
234 if MOONLIGHT_BOEHM
235 libmonoruntimemoon_la_CFLAGS = $(MOONLIGHT_DEFINES) $(BOEHM_DEFINES)
236 else
237 libmonoruntimemoon_la_CFLAGS = $(MOONLIGHT_DEFINES) $(SGEN_DEFINES)
238 endif
239 endif
240
241 libmonoruntimesgen_la_SOURCES = $(libmonoruntime_la_SOURCES)
242 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
243
244 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
245 libmonoruntime_static_la_LDFLAGS = -static
246 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
247
248 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
249 libmonoruntimesgen_static_la_LDFLAGS = -static
250 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
251
252 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
253
254 libmonoruntimeinclude_HEADERS = \
255         assembly.h              \
256         attrdefs.h              \
257         appdomain.h             \
258         blob.h                  \
259         class.h                 \
260         debug-helpers.h         \
261         debug-mono-symfile.h    \
262         threads.h               \
263         environment.h           \
264         exception.h             \
265         image.h                 \
266         loader.h                \
267         metadata.h              \
268         mono-config.h           \
269         mono-debug.h            \
270         mono-gc.h               \
271         sgen-bridge.h           \
272         object.h                \
273         opcodes.h               \
274         profiler.h              \
275         reflection.h            \
276         row-indexes.h           \
277         tokentype.h             \
278         verify.h                
279
280 if DTRACE_G_REQUIRED
281
282 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
283
284 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
285         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
286         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
287
288 else
289 PEDUMP_DTRACE_OBJECT = 
290 endif
291
292 if SHARED_MONO
293 if SUPPORT_BOEHM
294 pedump_SOURCES =                \
295         pedump.c
296
297 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
298         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
299
300 if PLATFORM_DARWIN
301 pedump_LDFLAGS=-framework CoreFoundation
302 endif
303 endif
304 endif
305
306 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) $(sgen_sources) runtime.h \
307                 tpool-poll.c tpool-epoll.c tpool-kqueue.c
308