Merge pull request #916 from akoeplinger/fix-gac-test
[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         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
195 # These source files have compile time dependencies on GC code
196 gc_dependent_sources = \
197         appdomain.c     \
198         domain.c        \
199         gc.c            \
200         monitor.c       \
201         mono-hash.c     \
202         object.c        \
203         reflection.c
204
205 boehm_sources = \
206         boehm-gc.c
207
208 sgen_sources = \
209         sgen-os-posix.c         \
210         sgen-os-mach.c          \
211         sgen-os-win32.c         \
212         sgen-gc.c               \
213         sgen-internal.c         \
214         sgen-marksweep.c        \
215         sgen-marksweep-fixed.c  \
216         sgen-marksweep-par.c    \
217         sgen-marksweep-fixed-par.c      \
218         sgen-los.c              \
219         sgen-protocol.c \
220         sgen-bridge.c           \
221         sgen-bridge.h           \
222         sgen-old-bridge.c               \
223         sgen-new-bridge.c               \
224         sgen-toggleref.c                \
225         sgen-toggleref.h                \
226         sgen-gc.h               \
227         sgen-conf.h             \
228         sgen-archdep.h          \
229         sgen-cardtable.c        \
230         sgen-cardtable.h        \
231         sgen-pinning.c  \
232         sgen-pinning.h  \
233         sgen-pinning-stats.c    \
234         sgen-workers.c  \
235         sgen-workers.h  \
236         sgen-gray.c     \
237         sgen-gray.h     \
238         sgen-major-copy-object.h \
239         sgen-minor-copy-object.h \
240         sgen-copy-object.h \
241         sgen-major-scan-object.h \
242         sgen-minor-scan-object.h \
243         sgen-protocol.h         \
244         sgen-scan-object.h      \
245         sgen-nursery-allocator.c        \
246         sgen-hash-table.c       \
247         sgen-hash-table.h       \
248         sgen-descriptor.c               \
249         sgen-descriptor.h               \
250         sgen-alloc.c            \
251         sgen-debug.c            \
252         sgen-simple-nursery.c   \
253         sgen-split-nursery.c    \
254         sgen-memory-governor.c  \
255         sgen-memory-governor.h  \
256         sgen-stw.c                              \
257         sgen-fin-weak-hash.c    \
258         sgen-layout-stats.c     \
259         sgen-layout-stats.h     \
260         sgen-qsort.c    \
261         sgen-qsort.h
262
263 libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(boehm_sources)
264 libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
265
266 libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
267 libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
268
269 libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
270 libmonoruntime_static_la_LDFLAGS = -static
271 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
272
273 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
274 libmonoruntimesgen_static_la_LDFLAGS = -static
275 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
276
277 libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
278
279 libmonoruntimeinclude_HEADERS = \
280         assembly.h              \
281         attrdefs.h              \
282         appdomain.h             \
283         blob.h                  \
284         class.h                 \
285         debug-helpers.h         \
286         debug-mono-symfile.h    \
287         threads.h               \
288         environment.h           \
289         exception.h             \
290         image.h                 \
291         loader.h                \
292         metadata.h              \
293         mono-config.h           \
294         mono-debug.h            \
295         mono-gc.h               \
296         sgen-bridge.h           \
297         object.h                \
298         opcodes.h               \
299         profiler.h              \
300         reflection.h            \
301         row-indexes.h           \
302         tokentype.h             \
303         verify.h                
304
305 if DTRACE_G_REQUIRED
306
307 PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
308
309 pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
310         DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
311         --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
312
313 else
314 PEDUMP_DTRACE_OBJECT = 
315 endif
316
317 if SHARED_MONO
318 if SUPPORT_BOEHM
319 pedump_SOURCES =                \
320         pedump.c
321
322 pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
323         $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV) $(PEDUMP_DTRACE_OBJECT)
324
325 if PLATFORM_DARWIN
326 pedump_LDFLAGS=-framework CoreFoundation -framework Foundation
327 endif
328 endif
329 endif
330
331 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
332                 tpool-poll.c tpool-epoll.c tpool-kqueue.c Makefile.am.in
333
334 if HAS_EXTENSION_MODULE
335 else
336 Makefile.am: Makefile.am.in
337         cp $< $@
338 endif