Merge pull request #3602 from henricm/fix-configuration-symlink-removed
[mono.git] / mono / metadata / Makefile.am
1 if HOST_WIN32
2 win32_sources = \
3         console-win32.c \
4         w32mutex-win32.c \
5         w32semaphore-win32.c \
6         w32event-win32.c
7
8 platform_sources = $(win32_sources)
9
10 # Use -m here. This will use / as directory separator (C:/WINNT).
11 # The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
12 # / by \ if running under WIN32.
13 if CROSS_COMPILING
14 assembliesdir = ${libdir}
15 confdir = ${sysconfdir}
16 else
17 assembliesdir = `cygpath -m "${libdir}"`
18 confdir = `cygpath -m "${sysconfdir}"`
19 endif
20 export HOST_CC
21 # The mingw math.h has "extern inline" functions that dont appear in libs, so
22 # optimisation is required to actually inline them
23 AM_CFLAGS = -O
24 else
25
26 assembliesdir = $(exec_prefix)/lib
27 confdir = $(sysconfdir)
28 unix_sources = \
29         console-unix.c \
30         w32mutex-unix.c \
31         w32semaphore-unix.c \
32         w32event-unix.c
33
34 platform_sources = $(unix_sources)
35 endif
36
37 if PLATFORM_ANDROID
38 platform_sources += ../../support/libm/complex.c
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         dynamic-image-internals.h       \
211         dynamic-stream.c        \
212         dynamic-stream-internals.h      \
213         reflection-cache.h      \
214         custom-attrs-internals.h        \
215         sre-internals.h \
216         reflection-internals.h  \
217         file-mmap-posix.c       \
218         file-mmap-windows.c     \
219         file-mmap.h     \
220         object-offsets.h        \
221         abi-details.h   \
222         metadata-cross-helpers.c        \
223         seq-points-data.h       \
224         seq-points-data.c       \
225         handle.c        \
226         handle.h        \
227         w32mutex.h      \
228         w32mutex-utils.h        \
229         w32semaphore.h  \
230         w32event.h      \
231         w32handle-namespace.h   \
232         w32handle-namespace.c
233
234 # These source files have compile time dependencies on GC code
235 gc_dependent_sources = \
236         appdomain.c     \
237         domain.c        \
238         gc-stats.c      \
239         gc.c            \
240         monitor.c       \
241         mono-hash.c     \
242         object.c        \
243         dynamic-image.c \
244         sre.c   \
245         sre-encode.c    \
246         sre-save.c      \
247         custom-attrs.c  \
248         reflection.c
249
250
251 boehm_sources = \
252         boehm-gc.c
253
254 sgen_sources = \
255         sgen-os-posix.c         \
256         sgen-os-mach.c          \
257         sgen-os-win32.c         \
258         sgen-os-coop.c          \
259         sgen-bridge.c           \
260         sgen-bridge.h           \
261         sgen-bridge-internals.h \
262         sgen-old-bridge.c               \
263         sgen-new-bridge.c               \
264         sgen-tarjan-bridge.c            \
265         sgen-toggleref.c                \
266         sgen-toggleref.h                \
267         sgen-stw.c                              \
268         sgen-mono.c             \
269         sgen-client-mono.h
270
271 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
272 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
273 libmonoruntime_la_LIBADD = libmonoruntime-config.la
274
275 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
276 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
277 libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
278
279 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
280 libmonoruntime_static_la_LDFLAGS = -static
281 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
282 libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
283
284 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
285 libmonoruntimesgen_static_la_LDFLAGS = -static
286 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
287 libmonoruntimesgen_static_la_LIBADD = $(libmonoruntimesgen_la_LIBADD)
288
289 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
290
291 libmonoruntimeinclude_HEADERS = \
292         assembly.h              \
293         attrdefs.h              \
294         appdomain.h             \
295         blob.h                  \
296         class.h                 \
297         debug-helpers.h         \
298         debug-mono-symfile.h    \
299         threads.h               \
300         environment.h           \
301         exception.h             \
302         image.h                 \
303         loader.h                \
304         metadata.h              \
305         mono-config.h           \
306         mono-debug.h            \
307         mono-gc.h               \
308         sgen-bridge.h           \
309         object.h                \
310         opcodes.h               \
311         profiler.h              \
312         reflection.h            \
313         row-indexes.h           \
314         tokentype.h             \
315         verify.h                
316
317 EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
318                 threadpool-ms-io-poll.c threadpool-ms-io-epoll.c threadpool-ms-io-kqueue.c sgen-dynarray.h