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