Merge branch 'master' of github.com:mono/mono into masterwork
[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
86 libmonoruntime_la_SOURCES = \
87         $(platform_sources)     \
88         appdomain.c             \
89         assembly.c              \
90         attach.h                \
91         attach.c                \
92         boehm-gc.c              \
93         char-conversions.h      \
94         cil-coff.h              \
95         class.c                 \
96         class-internals.h       \
97         cominterop.c            \
98         cominterop.h            \
99         console-io.h            \
100         coree.c                 \
101         coree.h                 \
102         culture-info.h          \
103         culture-info-tables.h   \
104         debug-helpers.c         \
105         debug-mono-symfile.h    \
106         debug-mono-symfile.c    \
107         decimal.c               \
108         decimal.h               \
109         domain.c                \
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.c                    \
120         gc-internal.h           \
121         icall.c                 \
122         icall-def.h             \
123         image.c                 \
124         loader.c                \
125         locales.c               \
126         locales.h               \
127         lock-tracer.c           \
128         lock-tracer.h           \
129         marshal.c               \
130         marshal.h               \
131         mempool.c               \
132         mempool.h               \
133         mempool-internals.h     \
134         metadata.c              \
135         metadata-verify.c       \
136         metadata-internals.h    \
137         method-builder.h        \
138         method-builder.c        \
139         mono-basic-block.c      \
140         mono-basic-block.h      \
141         mono-config.c           \
142         mono-debug.h            \
143         mono-debug.c            \
144         mono-debug-debugger.h   \
145         mono-debug-debugger.c   \
146         mono-endian.c           \
147         mono-endian.h           \
148         mono-hash.c             \
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.c               \
159         monitor.h               \
160         nacl-stub.c             \
161         normalization-tables.h  \
162         null-gc.c               \
163         number-formatter.h      \
164         object.c                \
165         object-internals.h      \
166         opcodes.c               \
167         socket-io.c             \
168         socket-io.h             \
169         process.c               \
170         process.h               \
171         profiler.c              \
172         profiler-private.h      \
173         rand.h                  \
174         rand.c                  \
175         runtime.c               \
176         reflection.c            \
177         security.c              \
178         security.h              \
179         security-core-clr.c     \
180         security-core-clr.h     \
181         security-manager.c      \
182         security-manager.h      \
183         sgen-os-posix.c         \
184         sgen-os-mach.c          \
185         sgen-gc.c               \
186         sgen-internal.c         \
187         sgen-marksweep.c        \
188         sgen-marksweep-fixed.c  \
189         sgen-marksweep-par.c    \
190         sgen-marksweep-fixed-par.c      \
191         sgen-major-copying.c    \
192         sgen-los.c              \
193         sgen-protocol.c \
194         sgen-gc.h               \
195         sgen-archdep.h          \
196         sgen-cardtable.h        \
197         sgen-major-copy-object.h \
198         sgen-major-scan-object.h \
199         sgen-protocol.h         \
200         sgen-scan-object.h      \
201         string-icalls.c         \
202         string-icalls.h         \
203         sysmath.h               \
204         sysmath.c               \
205         tabledefs.h             \
206         threads.c               \
207         threads-types.h         \
208         threadpool.c            \
209         threadpool.h            \
210         threadpool-internals.h  \
211         verify.c                \
212         verify-internals.h      \
213         wrapper-types.h
214
215 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
216
217 libmonoruntimemoon_la_SOURCES = $(libmonoruntime_la_SOURCES)
218 libmonoruntimemoon_la_CFLAGS = $(MOONLIGHT_DEFINES) $(BOEHM_DEFINES)
219
220 libmonoruntimesgen_la_SOURCES = $(libmonoruntime_la_SOURCES)
221 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
222
223 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
224 libmonoruntime_static_la_LDFLAGS = -static
225 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
226
227 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
228 libmonoruntimesgen_static_la_LDFLAGS = -static
229 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
230
231 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
232
233 libmonoruntimeinclude_HEADERS = \
234         assembly.h              \
235         attrdefs.h              \
236         appdomain.h             \
237         blob.h                  \
238         class.h                 \
239         debug-helpers.h         \
240         debug-mono-symfile.h    \
241         threads.h               \
242         environment.h           \
243         exception.h             \
244         image.h                 \
245         loader.h                \
246         metadata.h              \
247         mono-config.h           \
248         mono-debug.h            \
249         mono-gc.h               \
250         object.h                \
251         opcodes.h               \
252         profiler.h              \
253         reflection.h            \
254         row-indexes.h           \
255         tokentype.h             \
256         verify.h                
257
258 if DTRACE_G_REQUIRED
259
260 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
261
262 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
263         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
264         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
265
266 else
267 PEDUMP_DTRACE_OBJECT = 
268 endif
269
270 if SHARED_MONO
271 pedump_SOURCES =                \
272         pedump.c
273
274 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
275         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(PEDUMP_DTRACE_OBJECT)
276
277 if PLATFORM_DARWIN
278 pedump_LDFLAGS=-framework CoreFoundation
279 endif
280 endif
281
282 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) $(sgen_sources) runtime.h
283