2fbf826ceece5a6338eadd77b1deb9d5267801e0
[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 HOST_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-private.h      \
227         rand.h                  \
228         rand.c                  \
229         remoting.h              \
230         remoting.c              \
231         runtime.c               \
232         mono-security.c         \
233         security.h              \
234         security-core-clr.c     \
235         security-core-clr.h     \
236         security-manager.c      \
237         security-manager.h      \
238         string-icalls.c         \
239         string-icalls.h         \
240         sysmath.h               \
241         sysmath.c               \
242         tabledefs.h             \
243         threads.c               \
244         threads-types.h         \
245         threadpool.c    \
246         threadpool.h    \
247         threadpool-worker-default.c     \
248         threadpool-worker.h     \
249         threadpool-io.c \
250         threadpool-io.h \
251         verify.c                \
252         verify-internals.h      \
253         wrapper-types.h \
254         dynamic-image-internals.h       \
255         dynamic-stream.c        \
256         dynamic-stream-internals.h      \
257         reflection-cache.h      \
258         custom-attrs-internals.h        \
259         sre-internals.h \
260         reflection-internals.h  \
261         file-mmap-posix.c       \
262         file-mmap-windows.c     \
263         file-mmap.h     \
264         object-offsets.h        \
265         abi-details.h   \
266         metadata-cross-helpers.c        \
267         seq-points-data.h       \
268         seq-points-data.c       \
269         handle.c        \
270         handle.h        \
271         w32mutex.h      \
272         w32semaphore.h  \
273         w32event.h      \
274         w32handle-namespace.h   \
275         w32handle-namespace.c   \
276         w32handle.h     \
277         w32handle.c     \
278         w32error.h      \
279         reflection.c    \
280         dynamic-image.c \
281         sre.c   \
282         sre-encode.c    \
283         sre-save.c      \
284         custom-attrs.c  \
285         fdhandle.h      \
286         fdhandle.c
287
288 # These source files have compile time dependencies on GC code
289 gc_dependent_sources = \
290         gc-stats.c      \
291         gc.c            \
292         monitor.c       \
293         mono-hash.c     \
294         mono-conc-hash.c
295
296 boehm_sources = \
297         boehm-gc.c
298
299 sgen_sources = \
300         sgen-bridge.c           \
301         sgen-bridge.h           \
302         sgen-bridge-internals.h \
303         sgen-old-bridge.c               \
304         sgen-new-bridge.c               \
305         sgen-tarjan-bridge.c            \
306         sgen-toggleref.c                \
307         sgen-toggleref.h                \
308         sgen-stw.c                              \
309         sgen-mono.c             \
310         sgen-client-mono.h
311
312 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
313 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
314 libmonoruntime_la_LIBADD = libmonoruntime-config.la
315
316 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
317 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
318 libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
319
320 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
321 libmonoruntime_static_la_LDFLAGS = -static
322 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
323 libmonoruntime_static_la_LIBADD = $(bundle_obj) libmonoruntime-config.la
324
325 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
326 libmonoruntimesgen_static_la_LDFLAGS = -static
327 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
328 libmonoruntimesgen_static_la_LIBADD = libmonoruntime-config.la
329
330 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
331
332 libmonoruntimeinclude_HEADERS = \
333         assembly.h              \
334         attrdefs.h              \
335         appdomain.h             \
336         blob.h                  \
337         class.h                 \
338         debug-helpers.h         \
339         debug-mono-symfile.h    \
340         threads.h               \
341         environment.h           \
342         exception.h             \
343         image.h                 \
344         loader.h                \
345         metadata.h              \
346         mono-config.h           \
347         mono-debug.h            \
348         mono-gc.h               \
349         sgen-bridge.h           \
350         object.h                \
351         opcodes.h               \
352         profiler.h              \
353         profiler-events.h       \
354         reflection.h            \
355         row-indexes.h           \
356         tokentype.h             \
357         verify.h                
358
359 EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
360                 threadpool-io-poll.c threadpool-io-epoll.c threadpool-io-kqueue.c sgen-dynarray.h