Merge branch 'master' of github.com:mono/mono
[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 bin_PROGRAMS = pedump
32
33 #
34 # libtool is not capable of creating static/shared versions of the same
35 # convenience lib, so we have to do it ourselves
36 #
37 if SUPPORT_SGEN
38 sgen_libraries = libmonoruntimesgen.la libmonoruntimesgen-static.la 
39 endif
40
41 noinst_LTLIBRARIES = libmonoruntime.la libmonoruntime-static.la $(sgen_libraries)
42
43 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
44
45 #
46 # Make sure any prefix changes are updated in the binaries too.
47 #
48 #  assembly.c uses MONO_ASSEMBLIES
49 #  mono-config.c uses MONO_CFG_DIR
50 #
51 # This won't result in many more false positives than AC_DEFINEing them
52 # in configure.in.
53 #
54 assembly.lo mono-config.lo: Makefile
55
56 CLEANFILES = mono-bundle.stamp
57
58 libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
59
60 null_sources = \
61         console-null.c
62
63 sgen_sources = \
64         sgen-cardtable.c        \
65         sgen-gray.c             \
66         sgen-pinning.c          \
67         sgen-pinning-stats.c    \
68         sgen-los.c              \
69         sgen-protocol.c         \
70         sgen-workers.c
71
72 libmonoruntime_la_SOURCES = \
73         $(platform_sources)     \
74         appdomain.c             \
75         assembly.c              \
76         attach.h                \
77         attach.c                \
78         boehm-gc.c              \
79         char-conversions.h      \
80         cil-coff.h              \
81         class.c                 \
82         class-internals.h       \
83         cominterop.c            \
84         cominterop.h            \
85         console-io.h            \
86         coree.c                 \
87         coree.h                 \
88         culture-info.h          \
89         culture-info-tables.h   \
90         debug-helpers.c         \
91         debug-mono-symfile.h    \
92         debug-mono-symfile.c    \
93         decimal.c               \
94         decimal.h               \
95         domain.c                \
96         domain-internals.h      \
97         environment.c           \
98         environment.h           \
99         exception.c             \
100         exception.h             \
101         file-io.c               \
102         file-io.h               \
103         filewatcher.c           \
104         filewatcher.h           \
105         gc.c                    \
106         gc-internal.h           \
107         icall.c                 \
108         icall-def.h             \
109         image.c                 \
110         loader.c                \
111         locales.c               \
112         locales.h               \
113         lock-tracer.c           \
114         lock-tracer.h           \
115         marshal.c               \
116         marshal.h               \
117         mempool.c               \
118         mempool.h               \
119         mempool-internals.h     \
120         metadata.c              \
121         metadata-verify.c       \
122         metadata-internals.h    \
123         method-builder.h        \
124         method-builder.c        \
125         mono-basic-block.c      \
126         mono-basic-block.h      \
127         mono-config.c           \
128         mono-debug.h            \
129         mono-debug.c            \
130         mono-debug-debugger.h   \
131         mono-debug-debugger.c   \
132         mono-endian.c           \
133         mono-endian.h           \
134         mono-hash.c             \
135         mono-hash.h             \
136         mono-mlist.c            \
137         mono-mlist.h            \
138         mono-perfcounters.c     \
139         mono-perfcounters.h     \
140         mono-perfcounters-def.h \
141         mono-ptr-array.h        \
142         mono-wsq.c              \
143         mono-wsq.h              \
144         monitor.c               \
145         monitor.h               \
146         nacl-stub.c             \
147         normalization-tables.h  \
148         null-gc.c               \
149         number-formatter.h      \
150         object.c                \
151         object-internals.h      \
152         opcodes.c               \
153         socket-io.c             \
154         socket-io.h             \
155         process.c               \
156         process.h               \
157         profiler.c              \
158         profiler-private.h      \
159         rand.h                  \
160         rand.c                  \
161         runtime.c               \
162         reflection.c            \
163         security.c              \
164         security.h              \
165         security-core-clr.c     \
166         security-core-clr.h     \
167         security-manager.c      \
168         security-manager.h      \
169         sgen-os-posix.c         \
170         sgen-os-mach.c          \
171         sgen-gc.c               \
172         sgen-internal.c         \
173         sgen-marksweep.c        \
174         sgen-marksweep-fixed.c  \
175         sgen-marksweep-par.c    \
176         sgen-marksweep-fixed-par.c      \
177         sgen-major-copying.c    \
178         sgen-gc.h               \
179         sgen-archdep.h          \
180         sgen-major-copy-object.h \
181         sgen-major-scan-object.h \
182         sgen-protocol.h         \
183         sgen-scan-object.h      \
184         string-icalls.c         \
185         string-icalls.h         \
186         sysmath.h               \
187         sysmath.c               \
188         tabledefs.h             \
189         threads.c               \
190         threads-types.h         \
191         threadpool.c            \
192         threadpool.h            \
193         threadpool-internals.h  \
194         verify.c                \
195         verify-internals.h      \
196         wrapper-types.h
197
198 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
199
200 libmonoruntimesgen_la_SOURCES = $(libmonoruntime_la_SOURCES)
201 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
202
203 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
204 libmonoruntime_static_la_LDFLAGS = -static
205 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
206
207 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
208 libmonoruntimesgen_static_la_LDFLAGS = -static
209 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
210
211 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
212
213 libmonoruntimeinclude_HEADERS = \
214         assembly.h              \
215         attrdefs.h              \
216         appdomain.h             \
217         blob.h                  \
218         class.h                 \
219         debug-helpers.h         \
220         debug-mono-symfile.h    \
221         threads.h               \
222         environment.h           \
223         exception.h             \
224         image.h                 \
225         loader.h                \
226         metadata.h              \
227         mono-config.h           \
228         mono-debug.h            \
229         mono-gc.h               \
230         object.h                \
231         opcodes.h               \
232         profiler.h              \
233         reflection.h            \
234         row-indexes.h           \
235         tokentype.h             \
236         verify.h                
237
238 if DTRACE_G_REQUIRED
239
240 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
241
242 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
243         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
244         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
245
246 else
247 PEDUMP_DTRACE_OBJECT = 
248 endif
249
250 pedump_SOURCES =                \
251         pedump.c
252
253 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
254         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(PEDUMP_DTRACE_OBJECT)
255
256 if PLATFORM_DARWIN
257 pedump_LDFLAGS=-framework CoreFoundation
258 endif
259
260 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) $(sgen_sources) runtime.h
261