Rename configure.in -> configure.ac. Based on PR #976.
[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.ac.
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         gc-memfuncs.c           \
121         icall.c                 \
122         icall-def.h             \
123         image.c                 \
124         loader.c                \
125         locales.c               \
126         locales.h               \
127         lock-tracer.c           \
128         lock-tracer.h           \
129         marshal.c               \
130         marshal.h               \
131         mempool.c               \
132         mempool.h               \
133         mempool-internals.h     \
134         metadata.c              \
135         metadata-verify.c       \
136         metadata-internals.h    \
137         method-builder.h        \
138         method-builder.c        \
139         mono-basic-block.c      \
140         mono-basic-block.h      \
141         mono-config.c           \
142         mono-cq.c               \
143         mono-cq.h               \
144         mono-debug.h            \
145         mono-debug.c            \
146         mono-debug-debugger.h   \
147         mono-debug-debugger.c   \
148         mono-endian.c           \
149         mono-endian.h           \
150         mono-hash.h             \
151         mono-mlist.c            \
152         mono-mlist.h            \
153         mono-perfcounters.c     \
154         mono-perfcounters.h     \
155         mono-perfcounters-def.h \
156         mono-ptr-array.h        \
157         mono-wsq.c              \
158         mono-wsq.h              \
159         monitor.h               \
160         nacl-stub.c             \
161         normalization-tables.h  \
162         null-gc.c               \
163         number-formatter.h      \
164         object-internals.h      \
165         opcodes.c               \
166         socket-io.c             \
167         socket-io.h             \
168         process.c               \
169         process.h               \
170         profiler.c              \
171         profiler-private.h      \
172         rand.h                  \
173         rand.c                  \
174         runtime.c               \
175         security.c              \
176         security.h              \
177         security-core-clr.c     \
178         security-core-clr.h     \
179         security-manager.c      \
180         security-manager.h      \
181         string-icalls.c         \
182         string-icalls.h         \
183         sysmath.h               \
184         sysmath.c               \
185         tabledefs.h             \
186         threads.c               \
187         threads-types.h         \
188         threadpool.c            \
189         threadpool.h            \
190         threadpool-internals.h  \
191         verify.c                \
192         verify-internals.h      \
193         wrapper-types.h \
194         reflection-internals.h
195
196 # These source files have compile time dependencies on GC code
197 gc_dependent_sources = \
198         appdomain.c     \
199         domain.c        \
200         gc.c            \
201         monitor.c       \
202         mono-hash.c     \
203         object.c        \
204         reflection.c
205
206 boehm_sources = \
207         boehm-gc.c
208
209 sgen_sources = \
210         sgen-os-posix.c         \
211         sgen-os-mach.c          \
212         sgen-os-win32.c         \
213         sgen-gc.c               \
214         sgen-internal.c         \
215         sgen-marksweep.c        \
216         sgen-marksweep-fixed.c  \
217         sgen-marksweep-par.c    \
218         sgen-marksweep-fixed-par.c      \
219         sgen-los.c              \
220         sgen-protocol.c \
221         sgen-bridge.c           \
222         sgen-bridge.h           \
223         sgen-old-bridge.c               \
224         sgen-new-bridge.c               \
225         sgen-tarjan-bridge.c            \
226         sgen-toggleref.c                \
227         sgen-toggleref.h                \
228         sgen-gc.h               \
229         sgen-conf.h             \
230         sgen-archdep.h          \
231         sgen-cardtable.c        \
232         sgen-cardtable.h        \
233         sgen-pinning.c  \
234         sgen-pinning.h  \
235         sgen-pinning-stats.c    \
236         sgen-workers.c  \
237         sgen-workers.h  \
238         sgen-gray.c     \
239         sgen-gray.h     \
240         sgen-major-copy-object.h \
241         sgen-minor-copy-object.h \
242         sgen-copy-object.h \
243         sgen-major-scan-object.h \
244         sgen-minor-scan-object.h \
245         sgen-protocol.h         \
246         sgen-scan-object.h      \
247         sgen-nursery-allocator.c        \
248         sgen-hash-table.c       \
249         sgen-hash-table.h       \
250         sgen-descriptor.c               \
251         sgen-descriptor.h               \
252         sgen-alloc.c            \
253         sgen-debug.c            \
254         sgen-simple-nursery.c   \
255         sgen-split-nursery.c    \
256         sgen-memory-governor.c  \
257         sgen-memory-governor.h  \
258         sgen-stw.c                              \
259         sgen-fin-weak-hash.c    \
260         sgen-layout-stats.c     \
261         sgen-layout-stats.h     \
262         sgen-qsort.c    \
263         sgen-qsort.h
264
265 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(boehm_sources)
266 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
267
268 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
269 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
270
271 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
272 libmonoruntime_static_la_LDFLAGS = -static
273 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
274
275 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
276 libmonoruntimesgen_static_la_LDFLAGS = -static
277 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
278
279 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
280
281 libmonoruntimeinclude_HEADERS = \
282         assembly.h              \
283         attrdefs.h              \
284         appdomain.h             \
285         blob.h                  \
286         class.h                 \
287         debug-helpers.h         \
288         debug-mono-symfile.h    \
289         threads.h               \
290         environment.h           \
291         exception.h             \
292         image.h                 \
293         loader.h                \
294         metadata.h              \
295         mono-config.h           \
296         mono-debug.h            \
297         mono-gc.h               \
298         sgen-bridge.h           \
299         object.h                \
300         opcodes.h               \
301         profiler.h              \
302         reflection.h            \
303         row-indexes.h           \
304         tokentype.h             \
305         verify.h                
306
307 if DTRACE_G_REQUIRED
308
309 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
310
311 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
312         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
313         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
314
315 else
316 PEDUMP_DTRACE_OBJECT = 
317 endif
318
319 if SHARED_MONO
320 if SUPPORT_BOEHM
321 pedump_SOURCES =                \
322         pedump.c
323
324 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
325         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
326
327 if PLATFORM_DARWIN
328 pedump_LDFLAGS=-framework CoreFoundation -framework Foundation
329 endif
330 endif
331 endif
332
333 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
334                 tpool-poll.c tpool-epoll.c tpool-kqueue.c Makefile.am.in
335
336 if HAS_EXTENSION_MODULE
337 else
338 Makefile.am: Makefile.am.in
339         cp $< $@
340 endif