Merge pull request #260 from pcc/topmost
[mono.git] / mono / metadata / Makefile.am.in
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 SHARED_MONO
32 if SUPPORT_BOEHM
33 bin_PROGRAMS = pedump
34 endif
35 endif
36
37 #
38 # libtool is not capable of creating static/shared versions of the same
39 # convenience lib, so we have to do it ourselves
40 #
41 if SUPPORT_SGEN
42 if DISABLE_EXECUTABLES
43 shared_sgen_libraries = libmonoruntimesgen.la 
44 else
45 if SHARED_MONO
46 shared_sgen_libraries = libmonoruntimesgen.la 
47 endif
48 endif
49 sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la 
50 endif
51
52 if SUPPORT_BOEHM
53 if DISABLE_EXECUTABLES
54 shared_boehm_libraries = libmonoruntime.la
55 else
56 if SHARED_MONO
57 shared_boehm_libraries = libmonoruntime.la
58 endif
59 endif
60 boehm_libraries = $(shared_boehm_libraries) libmonoruntime-static.la
61 endif
62
63 if DISABLE_EXECUTABLES
64 noinst_LTLIBRARIES = $(shared_sgen_libraries) $(shared_boehm_libraries)
65 else
66 noinst_LTLIBRARIES = $(boehm_libraries) $(sgen_libraries)
67 endif
68
69 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
70
71 #
72 # Make sure any prefix changes are updated in the binaries too.
73 #
74 #  assembly.c uses MONO_ASSEMBLIES
75 #  mono-config.c uses MONO_CFG_DIR
76 #
77 # This won't result in many more false positives than AC_DEFINEing them
78 # in configure.in.
79 #
80 assembly.lo mono-config.lo: Makefile
81
82 CLEANFILES = mono-bundle.stamp
83
84 libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
85
86 null_sources = \
87         console-null.c
88
89 common_sources = \
90         $(platform_sources)     \
91         assembly.c              \
92         attach.h                \
93         attach.c                \
94         char-conversions.h      \
95         cil-coff.h              \
96         class.c                 \
97         class-internals.h       \
98         cominterop.c            \
99         cominterop.h            \
100         console-io.h            \
101         coree.c                 \
102         coree.h                 \
103         culture-info.h          \
104         culture-info-tables.h   \
105         debug-helpers.c         \
106         debug-mono-symfile.h    \
107         debug-mono-symfile.c    \
108         decimal.c               \
109         decimal.h               \
110         domain-internals.h      \
111         environment.c           \
112         environment.h           \
113         exception.c             \
114         exception.h             \
115         file-io.c               \
116         file-io.h               \
117         filewatcher.c           \
118         filewatcher.h           \
119         gc-internal.h           \
120         icall.c                 \
121         icall-def.h             \
122         image.c                 \
123         loader.c                \
124         locales.c               \
125         locales.h               \
126         lock-tracer.c           \
127         lock-tracer.h           \
128         marshal.c               \
129         marshal.h               \
130         mempool.c               \
131         mempool.h               \
132         mempool-internals.h     \
133         metadata.c              \
134         metadata-verify.c       \
135         metadata-internals.h    \
136         method-builder.h        \
137         method-builder.c        \
138         mono-basic-block.c      \
139         mono-basic-block.h      \
140         mono-config.c           \
141         mono-cq.c               \
142         mono-cq.h               \
143         mono-debug.h            \
144         mono-debug.c            \
145         mono-debug-debugger.h   \
146         mono-debug-debugger.c   \
147         mono-endian.c           \
148         mono-endian.h           \
149         mono-hash.h             \
150         mono-mlist.c            \
151         mono-mlist.h            \
152         mono-perfcounters.c     \
153         mono-perfcounters.h     \
154         mono-perfcounters-def.h \
155         mono-ptr-array.h        \
156         mono-wsq.c              \
157         mono-wsq.h              \
158         monitor.h               \
159         nacl-stub.c             \
160         normalization-tables.h  \
161         null-gc.c               \
162         number-formatter.h      \
163         object-internals.h      \
164         opcodes.c               \
165         socket-io.c             \
166         socket-io.h             \
167         process.c               \
168         process.h               \
169         profiler.c              \
170         profiler-private.h      \
171         rand.h                  \
172         rand.c                  \
173         runtime.c               \
174         security.c              \
175         security.h              \
176         security-core-clr.c     \
177         security-core-clr.h     \
178         security-manager.c      \
179         security-manager.h      \
180         string-icalls.c         \
181         string-icalls.h         \
182         sysmath.h               \
183         sysmath.c               \
184         tabledefs.h             \
185         threads.c               \
186         threads-types.h         \
187         threadpool.c            \
188         threadpool.h            \
189         threadpool-internals.h  \
190         verify.c                \
191         verify-internals.h      \
192         wrapper-types.h
193
194 # These source files have compile time dependencies on GC code
195 gc_dependent_sources = \
196         appdomain.c     \
197         domain.c        \
198         gc.c            \
199         monitor.c       \
200         mono-hash.c     \
201         object.c        \
202         reflection.c
203
204 boehm_sources = \
205         boehm-gc.c
206
207 sgen_sources = \
208         sgen-os-posix.c         \
209         sgen-os-mach.c          \
210         sgen-os-win32.c         \
211         sgen-gc.c               \
212         sgen-internal.c         \
213         sgen-marksweep.c        \
214         sgen-marksweep-fixed.c  \
215         sgen-marksweep-par.c    \
216         sgen-marksweep-fixed-par.c      \
217         sgen-los.c              \
218         sgen-protocol.c \
219         sgen-bridge.c           \
220         sgen-bridge.h           \
221         sgen-toggleref.c                \
222         sgen-toggleref.h                \
223         sgen-gc.h               \
224         sgen-conf.h             \
225         sgen-archdep.h          \
226         sgen-cardtable.c        \
227         sgen-cardtable.h        \
228         sgen-pinning.c  \
229         sgen-pinning.h  \
230         sgen-pinning-stats.c    \
231         sgen-workers.c  \
232         sgen-workers.h  \
233         sgen-gray.c     \
234         sgen-gray.h     \
235         sgen-major-copy-object.h \
236         sgen-minor-copy-object.h \
237         sgen-copy-object.h \
238         sgen-major-scan-object.h \
239         sgen-minor-scan-object.h \
240         sgen-protocol.h         \
241         sgen-scan-object.h      \
242         sgen-nursery-allocator.c        \
243         sgen-hash-table.c       \
244         sgen-hash-table.h       \
245         sgen-descriptor.c               \
246         sgen-descriptor.h               \
247         sgen-alloc.c            \
248         sgen-debug.c            \
249         sgen-simple-nursery.c   \
250         sgen-split-nursery.c    \
251         sgen-memory-governor.c  \
252         sgen-memory-governor.h  \
253         sgen-stw.c                              \
254         sgen-fin-weak-hash.c    \
255         sgen-layout-stats.c     \
256         sgen-layout-stats.h
257
258 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(boehm_sources)
259 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
260
261 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
262 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
263
264 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
265 libmonoruntime_static_la_LDFLAGS = -static
266 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
267
268 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
269 libmonoruntimesgen_static_la_LDFLAGS = -static
270 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
271
272 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
273
274 libmonoruntimeinclude_HEADERS = \
275         assembly.h              \
276         attrdefs.h              \
277         appdomain.h             \
278         blob.h                  \
279         class.h                 \
280         debug-helpers.h         \
281         debug-mono-symfile.h    \
282         threads.h               \
283         environment.h           \
284         exception.h             \
285         image.h                 \
286         loader.h                \
287         metadata.h              \
288         mono-config.h           \
289         mono-debug.h            \
290         mono-gc.h               \
291         sgen-bridge.h           \
292         object.h                \
293         opcodes.h               \
294         profiler.h              \
295         reflection.h            \
296         row-indexes.h           \
297         tokentype.h             \
298         verify.h                
299
300 if DTRACE_G_REQUIRED
301
302 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
303
304 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
305         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
306         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
307
308 else
309 PEDUMP_DTRACE_OBJECT = 
310 endif
311
312 if SHARED_MONO
313 if SUPPORT_BOEHM
314 pedump_SOURCES =                \
315         pedump.c
316
317 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
318         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
319
320 if PLATFORM_DARWIN
321 pedump_LDFLAGS=-framework CoreFoundation
322 endif
323 endif
324 endif
325
326 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
327                 tpool-poll.c tpool-epoll.c tpool-kqueue.c Makefile.am.in
328
329 if HAS_EXTENSION_MODULE
330 else
331 Makefile.am: Makefile.am.in
332         cp $< $@
333 endif