Merge pull request #1345 from mattleibow/websocket-continuation-frame-fix
[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 PLATFORM_ANDROID
32 platform_sources += ../../support/libm/complex.c
33 endif
34
35 if SHARED_MONO
36 if SUPPORT_BOEHM
37 bin_PROGRAMS = pedump
38 endif
39 endif
40
41 #
42 # libtool is not capable of creating static/shared versions of the same
43 # convenience lib, so we have to do it ourselves
44 #
45 if SUPPORT_SGEN
46 if DISABLE_EXECUTABLES
47 shared_sgen_libraries = libmonoruntimesgen.la 
48 else
49 if SHARED_MONO
50 shared_sgen_libraries = libmonoruntimesgen.la 
51 endif
52 endif
53 sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la 
54 endif
55
56 if SUPPORT_BOEHM
57 if DISABLE_EXECUTABLES
58 shared_boehm_libraries = libmonoruntime.la
59 else
60 if SHARED_MONO
61 shared_boehm_libraries = libmonoruntime.la
62 endif
63 endif
64 boehm_libraries = $(shared_boehm_libraries) libmonoruntime-static.la
65 endif
66
67 if DISABLE_EXECUTABLES
68 noinst_LTLIBRARIES = libmonoruntime-config.la $(shared_sgen_libraries) $(shared_boehm_libraries)
69 else
70 noinst_LTLIBRARIES = libmonoruntime-config.la $(boehm_libraries) $(sgen_libraries)
71 endif
72
73 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS)
74
75 #
76 # Make sure any prefix changes are updated in the binaries too.
77 #
78 # This won't result in many more false positives than AC_DEFINEing them
79 # in configure.ac.
80 #
81 mono-config-dirs.lo: Makefile
82
83 #
84 # This library is used to localize the usage of MONO_BINDIR etc. to just one source file, thus enabling
85 # ccache to work even if the value of these defines change. We need to use a convenience library since automake
86 # doesn't support per file cflags.
87 #
88 libmonoruntime_config_la_SOURCES = \
89         mono-config-dirs.h              \
90         mono-config-dirs.c
91 libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
92
93 CLEANFILES = mono-bundle.stamp
94
95 null_sources = \
96         console-null.c
97
98 null_gc_sources = \
99         null-gc.c
100
101 common_sources = \
102         $(platform_sources)     \
103         assembly.c              \
104         attach.h                \
105         attach.c                \
106         cil-coff.h              \
107         class.c                 \
108         class-internals.h       \
109         cominterop.c            \
110         cominterop.h            \
111         console-io.h            \
112         coree.c                 \
113         coree.h                 \
114         culture-info.h          \
115         culture-info-tables.h   \
116         debug-helpers.c         \
117         debug-mono-symfile.h    \
118         debug-mono-symfile.c    \
119         debug-mono-ppdb.h       \
120         debug-mono-ppdb.c       \
121         decimal-ms.c            \
122         decimal-ms.h            \
123         domain-internals.h      \
124         environment.c           \
125         environment.h           \
126         exception.c             \
127         exception.h             \
128         exception-internals.h   \
129         file-io.c               \
130         file-io.h               \
131         filewatcher.c           \
132         filewatcher.h           \
133         gc-internals.h          \
134         icall.c                 \
135         icall-def.h             \
136         image.c                 \
137         image-internals.h       \
138         jit-info.c              \
139         loader.c                \
140         locales.c               \
141         locales.h               \
142         lock-tracer.c           \
143         lock-tracer.h           \
144         marshal.c               \
145         marshal.h               \
146         mempool.c               \
147         mempool.h               \
148         mempool-internals.h     \
149         metadata.c              \
150         metadata-verify.c       \
151         metadata-internals.h    \
152         method-builder.h        \
153         method-builder.c        \
154         mono-basic-block.c      \
155         mono-basic-block.h      \
156         mono-config.c           \
157         mono-debug.h            \
158         mono-debug.c            \
159         mono-debug-debugger.h   \
160         mono-endian.c           \
161         mono-endian.h           \
162         mono-hash.h             \
163         mono-mlist.c            \
164         mono-mlist.h            \
165         mono-perfcounters.c     \
166         mono-perfcounters.h     \
167         mono-perfcounters-def.h \
168         mono-ptr-array.h        \
169         mono-route.c            \
170         mono-route.h            \
171         monitor.h               \
172         nacl-stub.c             \
173         normalization-tables.h  \
174         number-formatter.h      \
175         number-ms.c             \
176         number-ms.h             \
177         object-internals.h      \
178         opcodes.c               \
179         socket-io.c             \
180         socket-io.h             \
181         process.c               \
182         process.h               \
183         profiler.c              \
184         profiler-private.h      \
185         rand.h                  \
186         rand.c                  \
187         remoting.h              \
188         remoting.c              \
189         runtime.c               \
190         mono-security.c         \
191         security.h              \
192         security-core-clr.c     \
193         security-core-clr.h     \
194         security-manager.c      \
195         security-manager.h      \
196         string-icalls.c         \
197         string-icalls.h         \
198         sysmath.h               \
199         sysmath.c               \
200         tabledefs.h             \
201         threads.c               \
202         threads-types.h         \
203         threadpool-ms.c \
204         threadpool-ms.h \
205         threadpool-ms-io.c      \
206         threadpool-ms-io.h      \
207         verify.c                \
208         verify-internals.h      \
209         wrapper-types.h \
210         reflection-internals.h  \
211         file-mmap-posix.c       \
212         file-mmap-windows.c     \
213         file-mmap.h     \
214         object-offsets.h        \
215         abi-details.h   \
216         metadata-cross-helpers.c        \
217         seq-points-data.h       \
218         seq-points-data.c       \
219         handle.c        \
220         handle.h
221
222
223 # These source files have compile time dependencies on GC code
224 gc_dependent_sources = \
225         appdomain.c     \
226         domain.c        \
227         gc-stats.c      \
228         gc.c            \
229         monitor.c       \
230         mono-hash.c     \
231         object.c        \
232         reflection.c
233
234 boehm_sources = \
235         boehm-gc.c
236
237 sgen_sources = \
238         sgen-os-posix.c         \
239         sgen-os-mach.c          \
240         sgen-os-win32.c         \
241         sgen-os-coop.c          \
242         sgen-bridge.c           \
243         sgen-bridge.h           \
244         sgen-bridge-internals.h \
245         sgen-old-bridge.c               \
246         sgen-new-bridge.c               \
247         sgen-tarjan-bridge.c            \
248         sgen-toggleref.c                \
249         sgen-toggleref.h                \
250         sgen-stw.c                              \
251         sgen-mono.c             \
252         sgen-client-mono.h
253
254 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
255 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
256 libmonoruntime_la_LIBADD = libmonoruntime-config.la
257
258 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
259 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
260 libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
261
262 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
263 libmonoruntime_static_la_LDFLAGS = -static
264 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
265 libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
266
267 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
268 libmonoruntimesgen_static_la_LDFLAGS = -static
269 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
270 libmonoruntimesgen_static_la_LIBADD = $(libmonoruntimesgen_la_LIBADD)
271
272 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
273
274 libmonoruntimeinclude_HEADERS = \
275         assembly.h              \
276         attrdefs.h              \
277         appdomain.h             \
278         blob.h                  \
279         class.h                 \
280         debug-helpers.h         \
281         debug-mono-symfile.h    \
282         threads.h               \
283         environment.h           \
284         exception.h             \
285         image.h                 \
286         loader.h                \
287         metadata.h              \
288         mono-config.h           \
289         mono-debug.h            \
290         mono-gc.h               \
291         sgen-bridge.h           \
292         object.h                \
293         opcodes.h               \
294         profiler.h              \
295         reflection.h            \
296         row-indexes.h           \
297         tokentype.h             \
298         verify.h                
299
300 if DTRACE_G_REQUIRED
301
302 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
303
304 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
305         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
306         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
307
308 else
309 PEDUMP_DTRACE_OBJECT = 
310 endif
311
312 if SHARED_MONO
313 if SUPPORT_BOEHM
314 pedump_SOURCES =                \
315         pedump.c
316
317 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
318         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
319
320 if PLATFORM_DARWIN
321 pedump_LDFLAGS=-framework CoreFoundation -framework Foundation
322 endif
323 endif
324 endif
325
326 EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
327                 threadpool-ms-io-poll.c threadpool-ms-io-epoll.c threadpool-ms-io-kqueue.c