Merge pull request #220 from metanest/includeproblem_2012Jan_spike
[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_CPPFLAGS) $(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-fin-weak-hash.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-cq.c               \
143         mono-cq.h               \
144         mono-debug.h            \
145         mono-debug.c            \
146         mono-debug-debugger.h   \
147         mono-debug-debugger.c   \
148         mono-endian.c           \
149         mono-endian.h           \
150         mono-hash.c             \
151         mono-hash.h             \
152         mono-mlist.c            \
153         mono-mlist.h            \
154         mono-perfcounters.c     \
155         mono-perfcounters.h     \
156         mono-perfcounters-def.h \
157         mono-ptr-array.h        \
158         mono-wsq.c              \
159         mono-wsq.h              \
160         monitor.c               \
161         monitor.h               \
162         nacl-stub.c             \
163         normalization-tables.h  \
164         null-gc.c               \
165         number-formatter.h      \
166         object.c                \
167         object-internals.h      \
168         opcodes.c               \
169         socket-io.c             \
170         socket-io.h             \
171         process.c               \
172         process.h               \
173         profiler.c              \
174         profiler-private.h      \
175         rand.h                  \
176         rand.c                  \
177         runtime.c               \
178         reflection.c            \
179         security.c              \
180         security.h              \
181         security-core-clr.c     \
182         security-core-clr.h     \
183         security-manager.c      \
184         security-manager.h      \
185         sgen-os-posix.c         \
186         sgen-os-mach.c          \
187         sgen-os-win32.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-toggleref.c                \
201         sgen-toggleref.h                \
202         sgen-gc.h               \
203         sgen-conf.h             \
204         sgen-archdep.h          \
205         sgen-cardtable.c        \
206         sgen-cardtable.h        \
207         sgen-pinning.c  \
208         sgen-pinning.h  \
209         sgen-pinning-stats.c    \
210         sgen-workers.c  \
211         sgen-workers.h  \
212         sgen-gray.c     \
213         sgen-gray.h     \
214         sgen-major-copy-object.h \
215         sgen-major-scan-object.h \
216         sgen-protocol.h         \
217         sgen-scan-object.h      \
218         sgen-nursery-allocator.c        \
219         sgen-hash-table.c       \
220         sgen-descriptor.c               \
221         sgen-descriptor.h               \
222         sgen-alloc.c            \
223         sgen-debug.c            \
224         string-icalls.c         \
225         string-icalls.h         \
226         sysmath.h               \
227         sysmath.c               \
228         tabledefs.h             \
229         threads.c               \
230         threads-types.h         \
231         threadpool.c            \
232         threadpool.h            \
233         threadpool-internals.h  \
234         verify.c                \
235         verify-internals.h      \
236         wrapper-types.h
237
238 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
239
240 if MOONLIGHT
241 libmonoruntimemoon_la_SOURCES = $(libmonoruntime_la_SOURCES)
242 if MOONLIGHT_BOEHM
243 libmonoruntimemoon_la_CFLAGS = $(MOONLIGHT_DEFINES) $(BOEHM_DEFINES)
244 else
245 libmonoruntimemoon_la_CFLAGS = $(MOONLIGHT_DEFINES) $(SGEN_DEFINES)
246 endif
247 endif
248
249 libmonoruntimesgen_la_SOURCES = $(libmonoruntime_la_SOURCES)
250 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
251
252 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
253 libmonoruntime_static_la_LDFLAGS = -static
254 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
255
256 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
257 libmonoruntimesgen_static_la_LDFLAGS = -static
258 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
259
260 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
261
262 libmonoruntimeinclude_HEADERS = \
263         assembly.h              \
264         attrdefs.h              \
265         appdomain.h             \
266         blob.h                  \
267         class.h                 \
268         debug-helpers.h         \
269         debug-mono-symfile.h    \
270         threads.h               \
271         environment.h           \
272         exception.h             \
273         image.h                 \
274         loader.h                \
275         metadata.h              \
276         mono-config.h           \
277         mono-debug.h            \
278         mono-gc.h               \
279         sgen-bridge.h           \
280         object.h                \
281         opcodes.h               \
282         profiler.h              \
283         reflection.h            \
284         row-indexes.h           \
285         tokentype.h             \
286         verify.h                
287
288 if DTRACE_G_REQUIRED
289
290 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
291
292 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
293         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
294         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
295
296 else
297 PEDUMP_DTRACE_OBJECT = 
298 endif
299
300 if SHARED_MONO
301 if SUPPORT_BOEHM
302 pedump_SOURCES =                \
303         pedump.c
304
305 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
306         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
307
308 if PLATFORM_DARWIN
309 pedump_LDFLAGS=-framework CoreFoundation
310 endif
311 endif
312 endif
313
314 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) $(sgen_sources) runtime.h \
315                 tpool-poll.c tpool-epoll.c tpool-kqueue.c
316