Merge pull request #1936 from esdrubal/DotNetRelativeOrAbsolute
[mono.git] / mono / metadata / Makefile.am
1 if HOST_WIN32
2 win32_sources = \
3         console-win32.c
4
5 platform_sources = $(win32_sources)
6
7 # Use -m here. This will use / as directory separator (C:/WINNT).
8 # The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
9 # / by \ if running under WIN32.
10 if CROSS_COMPILING
11 assembliesdir = ${libdir}
12 confdir = ${sysconfdir}
13 else
14 assembliesdir = `cygpath -m "${libdir}"`
15 confdir = `cygpath -m "${sysconfdir}"`
16 endif
17 export HOST_CC
18 # The mingw math.h has "extern inline" functions that dont appear in libs, so
19 # optimisation is required to actually inline them
20 AM_CFLAGS = -O
21 else
22
23 assembliesdir = $(exec_prefix)/lib
24 confdir = $(sysconfdir)
25 unix_sources = \
26         console-unix.c
27
28 platform_sources = $(unix_sources)
29 endif
30
31 if PLATFORM_ANDROID
32 platform_sources += ../../support/libm/complex.c
33 endif
34
35 if SHARED_MONO
36 if SUPPORT_BOEHM
37 bin_PROGRAMS = pedump
38 endif
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         file-io.c               \
129         file-io.h               \
130         filewatcher.c           \
131         filewatcher.h           \
132         gc-internal.h           \
133         icall.c                 \
134         icall-def.h             \
135         image.c                 \
136         jit-info.c              \
137         loader.c                \
138         locales.c               \
139         locales.h               \
140         lock-tracer.c           \
141         lock-tracer.h           \
142         marshal.c               \
143         marshal.h               \
144         mempool.c               \
145         mempool.h               \
146         mempool-internals.h     \
147         metadata.c              \
148         metadata-verify.c       \
149         metadata-internals.h    \
150         method-builder.h        \
151         method-builder.c        \
152         mono-basic-block.c      \
153         mono-basic-block.h      \
154         mono-config.c           \
155         mono-debug.h            \
156         mono-debug.c            \
157         mono-debug-debugger.h   \
158         mono-endian.c           \
159         mono-endian.h           \
160         mono-hash.h             \
161         mono-mlist.c            \
162         mono-mlist.h            \
163         mono-perfcounters.c     \
164         mono-perfcounters.h     \
165         mono-perfcounters-def.h \
166         mono-ptr-array.h        \
167         mono-route.c            \
168         mono-route.h            \
169         monitor.h               \
170         nacl-stub.c             \
171         normalization-tables.h  \
172         number-formatter.h      \
173         number-ms.c             \
174         number-ms.h             \
175         object-internals.h      \
176         opcodes.c               \
177         socket-io.c             \
178         socket-io.h             \
179         process.c               \
180         process.h               \
181         profiler.c              \
182         profiler-private.h      \
183         rand.h                  \
184         rand.c                  \
185         remoting.h              \
186         remoting.c              \
187         runtime.c               \
188         mono-security.c         \
189         security.h              \
190         security-core-clr.c     \
191         security-core-clr.h     \
192         security-manager.c      \
193         security-manager.h      \
194         string-icalls.c         \
195         string-icalls.h         \
196         sysmath.h               \
197         sysmath.c               \
198         tabledefs.h             \
199         threads.c               \
200         threads-types.h         \
201         threadpool-ms.c \
202         threadpool-ms.h \
203         threadpool-ms-io.c      \
204         threadpool-ms-io.h      \
205         verify.c                \
206         verify-internals.h      \
207         wrapper-types.h \
208         reflection-internals.h  \
209         file-mmap-posix.c       \
210         file-mmap-windows.c     \
211         file-mmap.h     \
212         object-offsets.h        \
213         abi-details.h   \
214         metadata-cross-helpers.c        \
215         seq-points-data.h       \
216         seq-points-data.c
217
218
219 # These source files have compile time dependencies on GC code
220 gc_dependent_sources = \
221         appdomain.c     \
222         domain.c        \
223         gc-stats.c      \
224         gc.c            \
225         monitor.c       \
226         mono-hash.c     \
227         object.c        \
228         reflection.c
229
230 boehm_sources = \
231         boehm-gc.c
232
233 sgen_sources = \
234         sgen-os-posix.c         \
235         sgen-os-mach.c          \
236         sgen-os-win32.c         \
237         sgen-os-coop.c          \
238         sgen-bridge.c           \
239         sgen-bridge.h           \
240         sgen-bridge-internal.h  \
241         sgen-old-bridge.c               \
242         sgen-new-bridge.c               \
243         sgen-tarjan-bridge.c            \
244         sgen-toggleref.c                \
245         sgen-toggleref.h                \
246         sgen-stw.c                              \
247         sgen-mono.c             \
248         sgen-client-mono.h
249
250 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
251 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
252 libmonoruntime_la_LIBADD = libmonoruntime-config.la
253
254 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
255 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
256 libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
257
258 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
259 libmonoruntime_static_la_LDFLAGS = -static
260 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
261 libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
262
263 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
264 libmonoruntimesgen_static_la_LDFLAGS = -static
265 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
266 libmonoruntimesgen_static_la_LIBADD = $(libmonoruntimesgen_la_LIBADD)
267
268 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
269
270 libmonoruntimeinclude_HEADERS = \
271         assembly.h              \
272         attrdefs.h              \
273         appdomain.h             \
274         blob.h                  \
275         class.h                 \
276         debug-helpers.h         \
277         debug-mono-symfile.h    \
278         threads.h               \
279         environment.h           \
280         exception.h             \
281         image.h                 \
282         loader.h                \
283         metadata.h              \
284         mono-config.h           \
285         mono-debug.h            \
286         mono-gc.h               \
287         sgen-bridge.h           \
288         object.h                \
289         opcodes.h               \
290         profiler.h              \
291         reflection.h            \
292         row-indexes.h           \
293         tokentype.h             \
294         verify.h                
295
296 if DTRACE_G_REQUIRED
297
298 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
299
300 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
301         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
302         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
303
304 else
305 PEDUMP_DTRACE_OBJECT = 
306 endif
307
308 if SHARED_MONO
309 if SUPPORT_BOEHM
310 pedump_SOURCES =                \
311         pedump.c
312
313 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
314         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
315
316 if PLATFORM_DARWIN
317 pedump_LDFLAGS=-framework CoreFoundation -framework Foundation
318 endif
319 endif
320 endif
321
322 EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
323                 threadpool-ms-io-poll.c threadpool-ms-io-epoll.c threadpool-ms-io-kqueue.c