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