Merge pull request #5317 from alexrp/master
[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 if SUPPORT_SGEN
67 if DISABLE_EXECUTABLES
68 shared_sgen_libraries = libmonoruntimesgen.la 
69 else
70 if SHARED_MONO
71 shared_sgen_libraries = libmonoruntimesgen.la 
72 endif
73 endif
74 sgen_libraries = $(shared_sgen_libraries)
75 endif
76
77 if SUPPORT_BOEHM
78 if DISABLE_EXECUTABLES
79 shared_boehm_libraries = libmonoruntime.la
80 else
81 if SHARED_MONO
82 shared_boehm_libraries = libmonoruntime.la
83 endif
84 endif
85 boehm_libraries = $(shared_boehm_libraries)
86 endif
87
88 if DISABLE_EXECUTABLES
89 noinst_LTLIBRARIES = libmonoruntime-config.la $(shared_sgen_libraries) $(shared_boehm_libraries)
90 else
91 noinst_LTLIBRARIES = libmonoruntime-config.la $(boehm_libraries) $(sgen_libraries)
92 endif
93
94 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS)
95
96 #
97 # Make sure any prefix changes are updated in the binaries too.
98 #
99 # This won't result in many more false positives than AC_DEFINEing them
100 # in configure.ac.
101 #
102 mono-config-dirs.lo: Makefile
103
104 #
105 # This library is used to localize the usage of MONO_BINDIR etc. to just one source file, thus enabling
106 # ccache to work even if the value of these defines change. We need to use a convenience library since automake
107 # doesn't support per file cflags.
108 #
109 libmonoruntime_config_la_SOURCES = \
110         mono-config-dirs.h              \
111         mono-config-dirs.c
112 libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" -DMONO_RELOC_LIBDIR=\"../$(reloc_libdir)\"
113
114 CLEANFILES = mono-bundle.stamp
115
116 null_sources = \
117         console-null.c
118
119 null_gc_sources = \
120         null-gc.c \
121         null-gc-handles.h \
122         null-gc-handles.c
123
124 common_sources = \
125         $(platform_sources)     \
126         appdomain.c     \
127         domain.c        \
128         appdomain-icalls.h      \
129         assembly.c              \
130         assembly-internals.h    \
131         attach.h                \
132         attach.c                \
133         cil-coff.h              \
134         class.c                 \
135         class-internals.h       \
136         class-inlines.h         \
137         class-accessors.c       \
138         cominterop.c            \
139         cominterop.h            \
140         console-io.h            \
141         coree.c                 \
142         coree.h                 \
143         coree-internals.h \
144         culture-info.h          \
145         culture-info-tables.h   \
146         debug-helpers.c         \
147         debug-mono-symfile.h    \
148         debug-mono-symfile.c    \
149         debug-mono-ppdb.h       \
150         debug-mono-ppdb.c       \
151         decimal-ms.c            \
152         decimal-ms.h            \
153         domain-internals.h      \
154         environment.c           \
155         environment.h           \
156         exception.c             \
157         exception.h             \
158         exception-internals.h   \
159         w32file.c               \
160         w32file.h               \
161         w32file-internals.h \
162         filewatcher.c           \
163         filewatcher.h           \
164         gc-internals.h          \
165         icall.c                 \
166         icall-internals.h \
167         icall-def.h             \
168         image.c                 \
169         image-internals.h       \
170         jit-info.c              \
171         loader.c                \
172         locales.c               \
173         locales.h               \
174         lock-tracer.c           \
175         lock-tracer.h           \
176         marshal.c               \
177         marshal.h               \
178         marshal-internals.h \
179         mempool.c               \
180         mempool.h               \
181         mempool-internals.h     \
182         metadata.c              \
183         metadata-verify.c       \
184         metadata-internals.h    \
185         method-builder.h        \
186         method-builder.c        \
187         mono-basic-block.c      \
188         mono-basic-block.h      \
189         mono-config.c           \
190         mono-debug.h            \
191         mono-debug.c            \
192         debug-internals.h       \
193         mono-endian.c           \
194         mono-endian.h           \
195         mono-hash.h             \
196         mono-conc-hash.h                \
197         mono-mlist.c            \
198         mono-mlist.h            \
199         mono-perfcounters.c     \
200         mono-perfcounters.h     \
201         mono-perfcounters-def.h \
202         mono-ptr-array.h        \
203         mono-route.c            \
204         mono-route.h            \
205         monitor.h               \
206         normalization-tables.h  \
207         number-formatter.h      \
208         number-ms.c             \
209         number-ms.h             \
210         object.c        \
211         object-internals.h      \
212         opcodes.c               \
213         property-bag.h  \
214         property-bag.c  \
215         w32socket.c             \
216         w32socket.h             \
217         w32socket-internals.h           \
218         w32process.c            \
219         w32process.h            \
220         w32process-internals.h          \
221         profiler.c              \
222         profiler-private.h      \
223         rand.h                  \
224         rand.c                  \
225         remoting.h              \
226         remoting.c              \
227         runtime.c               \
228         mono-security.c         \
229         security.h              \
230         security-core-clr.c     \
231         security-core-clr.h     \
232         security-manager.c      \
233         security-manager.h      \
234         string-icalls.c         \
235         string-icalls.h         \
236         sysmath.h               \
237         sysmath.c               \
238         tabledefs.h             \
239         threads.c               \
240         threads-types.h         \
241         threadpool.c    \
242         threadpool.h    \
243         threadpool-worker-default.c     \
244         threadpool-worker.h     \
245         threadpool-io.c \
246         threadpool-io.h \
247         verify.c                \
248         verify-internals.h      \
249         wrapper-types.h \
250         dynamic-image-internals.h       \
251         dynamic-stream.c        \
252         dynamic-stream-internals.h      \
253         reflection-cache.h      \
254         custom-attrs-internals.h        \
255         sre-internals.h \
256         reflection-internals.h  \
257         file-mmap-posix.c       \
258         file-mmap-windows.c     \
259         file-mmap.h     \
260         object-offsets.h        \
261         abi-details.h   \
262         metadata-cross-helpers.c        \
263         seq-points-data.h       \
264         seq-points-data.c       \
265         handle.c        \
266         handle.h        \
267         w32mutex.h      \
268         w32semaphore.h  \
269         w32event.h      \
270         w32handle-namespace.h   \
271         w32handle-namespace.c   \
272         w32handle.h     \
273         w32handle.c     \
274         w32error.h      \
275         reflection.c    \
276         dynamic-image.c \
277         sre.c   \
278         sre-encode.c    \
279         sre-save.c      \
280         custom-attrs.c  \
281         fdhandle.h      \
282         fdhandle.c
283
284 # These source files have compile time dependencies on GC code
285 gc_dependent_sources = \
286         gc-stats.c      \
287         gc.c            \
288         monitor.c       \
289         mono-hash.c     \
290         mono-conc-hash.c
291
292 boehm_sources = \
293         boehm-gc.c
294
295 sgen_sources = \
296         sgen-bridge.c           \
297         sgen-bridge.h           \
298         sgen-bridge-internals.h \
299         sgen-old-bridge.c               \
300         sgen-new-bridge.c               \
301         sgen-tarjan-bridge.c            \
302         sgen-toggleref.c                \
303         sgen-toggleref.h                \
304         sgen-stw.c                              \
305         sgen-mono.c             \
306         sgen-client-mono.h
307
308 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
309 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
310 libmonoruntime_la_LIBADD = libmonoruntime-config.la
311
312 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
313 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
314 libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
315
316 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
317
318 libmonoruntimeinclude_HEADERS = \
319         assembly.h              \
320         attrdefs.h              \
321         appdomain.h             \
322         blob.h                  \
323         class.h                 \
324         debug-helpers.h         \
325         debug-mono-symfile.h    \
326         threads.h               \
327         environment.h           \
328         exception.h             \
329         image.h                 \
330         loader.h                \
331         metadata.h              \
332         mono-config.h           \
333         mono-debug.h            \
334         mono-gc.h               \
335         sgen-bridge.h           \
336         object.h                \
337         opcodes.h               \
338         profiler.h              \
339         profiler-events.h       \
340         reflection.h            \
341         row-indexes.h           \
342         tokentype.h             \
343         verify.h                
344
345 EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
346                 threadpool-io-poll.c threadpool-io-epoll.c threadpool-io-kqueue.c sgen-dynarray.h