1d5321f0378bca0e11dafa1c85cf096d7bc5809a
[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-gray.c             \
65         sgen-pinning.c          \
66         sgen-pinning-stats.c    \
67         sgen-los.c              \
68         sgen-protocol.c         \
69         sgen-workers.c
70
71 libmonoruntime_la_SOURCES = \
72         $(platform_sources)     \
73         appdomain.c             \
74         assembly.c              \
75         attach.h                \
76         attach.c                \
77         boehm-gc.c              \
78         char-conversions.h      \
79         cil-coff.h              \
80         class.c                 \
81         class-internals.h       \
82         cominterop.c            \
83         cominterop.h            \
84         console-io.h            \
85         coree.c                 \
86         coree.h                 \
87         culture-info.h          \
88         culture-info-tables.h   \
89         debug-helpers.c         \
90         debug-mono-symfile.h    \
91         debug-mono-symfile.c    \
92         decimal.c               \
93         decimal.h               \
94         domain.c                \
95         domain-internals.h      \
96         environment.c           \
97         environment.h           \
98         exception.c             \
99         exception.h             \
100         file-io.c               \
101         file-io.h               \
102         filewatcher.c           \
103         filewatcher.h           \
104         gc.c                    \
105         gc-internal.h           \
106         icall.c                 \
107         icall-def.h             \
108         image.c                 \
109         loader.c                \
110         locales.c               \
111         locales.h               \
112         lock-tracer.c           \
113         lock-tracer.h           \
114         marshal.c               \
115         marshal.h               \
116         mempool.c               \
117         mempool.h               \
118         mempool-internals.h     \
119         metadata.c              \
120         metadata-verify.c       \
121         metadata-internals.h    \
122         method-builder.h        \
123         method-builder.c        \
124         mono-basic-block.c      \
125         mono-basic-block.h      \
126         mono-config.c           \
127         mono-debug.h            \
128         mono-debug.c            \
129         mono-debug-debugger.h   \
130         mono-debug-debugger.c   \
131         mono-endian.c           \
132         mono-endian.h           \
133         mono-hash.c             \
134         mono-hash.h             \
135         mono-mlist.c            \
136         mono-mlist.h            \
137         mono-perfcounters.c     \
138         mono-perfcounters.h     \
139         mono-perfcounters-def.h \
140         mono-ptr-array.h        \
141         mono-wsq.c              \
142         mono-wsq.h              \
143         monitor.c               \
144         monitor.h               \
145         normalization-tables.h  \
146         null-gc.c               \
147         number-formatter.h      \
148         object.c                \
149         object-internals.h      \
150         opcodes.c               \
151         socket-io.c             \
152         socket-io.h             \
153         process.c               \
154         process.h               \
155         profiler.c              \
156         profiler-private.h      \
157         rand.h                  \
158         rand.c                  \
159         runtime.c               \
160         reflection.c            \
161         security.c              \
162         security.h              \
163         security-core-clr.c     \
164         security-core-clr.h     \
165         security-manager.c      \
166         security-manager.h      \
167         sgen-os-posix.c         \
168         sgen-os-mach.c          \
169         sgen-gc.c               \
170         sgen-internal.c         \
171         sgen-marksweep.c        \
172         sgen-marksweep-fixed.c  \
173         sgen-marksweep-par.c    \
174         sgen-marksweep-fixed-par.c      \
175         sgen-major-copying.c    \
176         sgen-gc.h               \
177         sgen-archdep.h          \
178         sgen-major-copy-object.h \
179         sgen-major-scan-object.h \
180         sgen-protocol.h         \
181         sgen-scan-object.h      \
182         string-icalls.c         \
183         string-icalls.h         \
184         sysmath.h               \
185         sysmath.c               \
186         tabledefs.h             \
187         threads.c               \
188         threads-types.h         \
189         threadpool.c            \
190         threadpool.h            \
191         threadpool-internals.h  \
192         verify.c                \
193         verify-internals.h      \
194         wrapper-types.h
195
196 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
197
198 libmonoruntimesgen_la_SOURCES = $(libmonoruntime_la_SOURCES)
199 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
200
201 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
202 libmonoruntime_static_la_LDFLAGS = -static
203 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
204
205 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
206 libmonoruntimesgen_static_la_LDFLAGS = -static
207 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
208
209 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
210
211 libmonoruntimeinclude_HEADERS = \
212         assembly.h              \
213         attrdefs.h              \
214         appdomain.h             \
215         blob.h                  \
216         class.h                 \
217         debug-helpers.h         \
218         debug-mono-symfile.h    \
219         threads.h               \
220         environment.h           \
221         exception.h             \
222         image.h                 \
223         loader.h                \
224         metadata.h              \
225         mono-config.h           \
226         mono-debug.h            \
227         mono-gc.h               \
228         object.h                \
229         opcodes.h               \
230         profiler.h              \
231         reflection.h            \
232         row-indexes.h           \
233         tokentype.h             \
234         verify.h                
235
236 if DTRACE_G_REQUIRED
237
238 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
239
240 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
241         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
242         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
243
244 else
245 PEDUMP_DTRACE_OBJECT = 
246 endif
247
248 pedump_SOURCES =                \
249         pedump.c
250
251 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
252         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(PEDUMP_DTRACE_OBJECT)
253
254 if PLATFORM_DARWIN
255 pedump_LDFLAGS=-framework CoreFoundation
256 endif
257
258 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) $(sgen_sources) runtime.h
259