Merge pull request #5288 from lambdageek/bug-58454
[mono.git] / mono / metadata / Makefile.am
1 if HOST_WIN32
2 win32_sources = \
3         console-win32.c \
4         console-win32-internals.h \
5         cominterop-win32-internals.h \
6         w32file-win32.c \
7         w32file-win32-internals.h \
8         icall-windows.c \
9         icall-windows-internals.h \
10         marshal-windows.c \
11         marshal-windows-internals.h \
12         mono-security-windows.c \
13         mono-security-windows-internals.h \
14         w32mutex-win32.c \
15         w32semaphore-win32.c \
16         w32event-win32.c \
17         w32process-win32.c \
18         w32process-win32-internals.h \
19         w32socket-win32.c \
20         w32error-win32.c
21
22 platform_sources = $(win32_sources)
23
24 # Use -m here. This will use / as directory separator (C:/WINNT).
25 # The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
26 # / by \ if running under WIN32.
27 if CROSS_COMPILING
28 assembliesdir = ${libdir}
29 confdir = ${sysconfdir}
30 else
31 assembliesdir = `cygpath -m "${libdir}"`
32 confdir = `cygpath -m "${sysconfdir}"`
33 endif
34 export HOST_CC
35 # The mingw math.h has "extern inline" functions that dont appear in libs, so
36 # optimisation is required to actually inline them
37 AM_CFLAGS = -O
38 else
39
40 assembliesdir = $(exec_prefix)/lib
41 confdir = $(sysconfdir)
42 unix_sources = \
43         console-unix.c \
44         w32mutex-unix.c \
45         w32semaphore-unix.c \
46         w32event-unix.c \
47         w32process-unix.c \
48         w32process-unix-internals.h \
49         w32process-unix-osx.c \
50         w32process-unix-bsd.c \
51         w32process-unix-haiku.c \
52         w32process-unix-default.c \
53         w32socket-unix.c \
54         w32file-unix.c \
55         w32file-unix-glob.c \
56         w32file-unix-glob.h \
57         w32error-unix.c
58
59 platform_sources = $(unix_sources)
60 endif
61
62 if PLATFORM_ANDROID
63 platform_sources += ../../support/libm/complex.c
64 endif
65
66 #
67 # libtool is not capable of creating static/shared versions of the same
68 # convenience lib, so we have to do it ourselves
69 #
70 if SUPPORT_SGEN
71 if DISABLE_EXECUTABLES
72 shared_sgen_libraries = libmonoruntimesgen.la 
73 else
74 if SHARED_MONO
75 shared_sgen_libraries = libmonoruntimesgen.la 
76 endif
77 endif
78 sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la 
79 endif
80
81 if SUPPORT_BOEHM
82 if DISABLE_EXECUTABLES
83 shared_boehm_libraries = libmonoruntime.la
84 else
85 if SHARED_MONO
86 shared_boehm_libraries = libmonoruntime.la
87 endif
88 endif
89 boehm_libraries = $(shared_boehm_libraries) libmonoruntime-static.la
90 endif
91
92 if DISABLE_EXECUTABLES
93 noinst_LTLIBRARIES = libmonoruntime-config.la $(shared_sgen_libraries) $(shared_boehm_libraries)
94 else
95 noinst_LTLIBRARIES = libmonoruntime-config.la $(boehm_libraries) $(sgen_libraries)
96 endif
97
98 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS)
99
100 #
101 # Make sure any prefix changes are updated in the binaries too.
102 #
103 # This won't result in many more false positives than AC_DEFINEing them
104 # in configure.ac.
105 #
106 mono-config-dirs.lo: Makefile
107
108 #
109 # This library is used to localize the usage of MONO_BINDIR etc. to just one source file, thus enabling
110 # ccache to work even if the value of these defines change. We need to use a convenience library since automake
111 # doesn't support per file cflags.
112 #
113 libmonoruntime_config_la_SOURCES = \
114         mono-config-dirs.h              \
115         mono-config-dirs.c
116 libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" -DMONO_RELOC_LIBDIR=\"../$(reloc_libdir)\"
117
118 CLEANFILES = mono-bundle.stamp
119
120 null_sources = \
121         console-null.c
122
123 null_gc_sources = \
124         null-gc.c \
125         null-gc-handles.h \
126         null-gc-handles.c
127
128 common_sources = \
129         $(platform_sources)     \
130         appdomain.c     \
131         domain.c        \
132         appdomain-icalls.h      \
133         assembly.c              \
134         assembly-internals.h    \
135         attach.h                \
136         attach.c                \
137         cil-coff.h              \
138         class.c                 \
139         class-internals.h       \
140         class-inlines.h         \
141         class-accessors.c       \
142         cominterop.c            \
143         cominterop.h            \
144         console-io.h            \
145         coree.c                 \
146         coree.h                 \
147         coree-internals.h \
148         culture-info.h          \
149         culture-info-tables.h   \
150         debug-helpers.c         \
151         debug-mono-symfile.h    \
152         debug-mono-symfile.c    \
153         debug-mono-ppdb.h       \
154         debug-mono-ppdb.c       \
155         decimal-ms.c            \
156         decimal-ms.h            \
157         domain-internals.h      \
158         environment.c           \
159         environment.h           \
160         exception.c             \
161         exception.h             \
162         exception-internals.h   \
163         w32file.c               \
164         w32file.h               \
165         w32file-internals.h \
166         filewatcher.c           \
167         filewatcher.h           \
168         gc-internals.h          \
169         icall.c                 \
170         icall-internals.h \
171         icall-def.h             \
172         image.c                 \
173         image-internals.h       \
174         jit-info.c              \
175         loader.c                \
176         locales.c               \
177         locales.h               \
178         lock-tracer.c           \
179         lock-tracer.h           \
180         marshal.c               \
181         marshal.h               \
182         marshal-internals.h \
183         mempool.c               \
184         mempool.h               \
185         mempool-internals.h     \
186         metadata.c              \
187         metadata-verify.c       \
188         metadata-internals.h    \
189         method-builder.h        \
190         method-builder.c        \
191         mono-basic-block.c      \
192         mono-basic-block.h      \
193         mono-config.c           \
194         mono-debug.h            \
195         mono-debug.c            \
196         debug-internals.h       \
197         mono-endian.c           \
198         mono-endian.h           \
199         mono-hash.h             \
200         mono-conc-hash.h                \
201         mono-mlist.c            \
202         mono-mlist.h            \
203         mono-perfcounters.c     \
204         mono-perfcounters.h     \
205         mono-perfcounters-def.h \
206         mono-ptr-array.h        \
207         mono-route.c            \
208         mono-route.h            \
209         monitor.h               \
210         normalization-tables.h  \
211         number-formatter.h      \
212         number-ms.c             \
213         number-ms.h             \
214         object.c        \
215         object-internals.h      \
216         opcodes.c               \
217         property-bag.h  \
218         property-bag.c  \
219         w32socket.c             \
220         w32socket.h             \
221         w32socket-internals.h           \
222         w32process.c            \
223         w32process.h            \
224         w32process-internals.h          \
225         profiler.c              \
226         profiler-events.h       \
227         profiler-private.h      \
228         rand.h                  \
229         rand.c                  \
230         remoting.h              \
231         remoting.c              \
232         runtime.c               \
233         mono-security.c         \
234         security.h              \
235         security-core-clr.c     \
236         security-core-clr.h     \
237         security-manager.c      \
238         security-manager.h      \
239         string-icalls.c         \
240         string-icalls.h         \
241         sysmath.h               \
242         sysmath.c               \
243         tabledefs.h             \
244         threads.c               \
245         threads-types.h         \
246         threadpool.c    \
247         threadpool.h    \
248         threadpool-worker-default.c     \
249         threadpool-worker.h     \
250         threadpool-io.c \
251         threadpool-io.h \
252         verify.c                \
253         verify-internals.h      \
254         wrapper-types.h \
255         dynamic-image-internals.h       \
256         dynamic-stream.c        \
257         dynamic-stream-internals.h      \
258         reflection-cache.h      \
259         custom-attrs-internals.h        \
260         sre-internals.h \
261         reflection-internals.h  \
262         file-mmap-posix.c       \
263         file-mmap-windows.c     \
264         file-mmap.h     \
265         object-offsets.h        \
266         abi-details.h   \
267         metadata-cross-helpers.c        \
268         seq-points-data.h       \
269         seq-points-data.c       \
270         handle.c        \
271         handle.h        \
272         w32mutex.h      \
273         w32semaphore.h  \
274         w32event.h      \
275         w32handle-namespace.h   \
276         w32handle-namespace.c   \
277         w32handle.h     \
278         w32handle.c     \
279         w32error.h      \
280         reflection.c    \
281         dynamic-image.c \
282         sre.c   \
283         sre-encode.c    \
284         sre-save.c      \
285         custom-attrs.c
286
287 # These source files have compile time dependencies on GC code
288 gc_dependent_sources = \
289         gc-stats.c      \
290         gc.c            \
291         monitor.c       \
292         mono-hash.c     \
293         mono-conc-hash.c
294
295 boehm_sources = \
296         boehm-gc.c
297
298 sgen_sources = \
299         sgen-bridge.c           \
300         sgen-bridge.h           \
301         sgen-bridge-internals.h \
302         sgen-old-bridge.c               \
303         sgen-new-bridge.c               \
304         sgen-tarjan-bridge.c            \
305         sgen-toggleref.c                \
306         sgen-toggleref.h                \
307         sgen-stw.c                              \
308         sgen-mono.c             \
309         sgen-client-mono.h
310
311 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
312 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
313 libmonoruntime_la_LIBADD = libmonoruntime-config.la
314
315 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
316 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
317 libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
318
319 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
320 libmonoruntime_static_la_LDFLAGS = -static
321 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
322 libmonoruntime_static_la_LIBADD = $(bundle_obj) libmonoruntime-config.la
323
324 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
325 libmonoruntimesgen_static_la_LDFLAGS = -static
326 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
327 libmonoruntimesgen_static_la_LIBADD = libmonoruntime-config.la
328
329 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
330
331 libmonoruntimeinclude_HEADERS = \
332         assembly.h              \
333         attrdefs.h              \
334         appdomain.h             \
335         blob.h                  \
336         class.h                 \
337         debug-helpers.h         \
338         debug-mono-symfile.h    \
339         threads.h               \
340         environment.h           \
341         exception.h             \
342         image.h                 \
343         loader.h                \
344         metadata.h              \
345         mono-config.h           \
346         mono-debug.h            \
347         mono-gc.h               \
348         sgen-bridge.h           \
349         object.h                \
350         opcodes.h               \
351         profiler.h              \
352         reflection.h            \
353         row-indexes.h           \
354         tokentype.h             \
355         verify.h                
356
357 EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
358                 threadpool-io-poll.c threadpool-io-epoll.c threadpool-io-kqueue.c sgen-dynarray.h