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