1if HOST_WIN32
2win32_sources = \
3	console-win32.c \
4	console-win32-internals.h \
5	cominterop-win32-internals.h \
6	w32file-win32.c \
7	w32file-win32-internals.h \
8	icall-windows.c \
9	icall-windows-internals.h \
10	marshal-windows.c \
11	marshal-windows-internals.h \
12	mono-security-windows.c \
13	mono-security-windows-internals.h \
14	w32mutex-win32.c \
15	w32semaphore-win32.c \
16	w32event-win32.c \
17	w32process-win32.c \
18	w32process-win32-internals.h \
19	w32socket-win32.c \
20	w32error-win32.c
21
22platform_sources = $(win32_sources)
23
24# Use -m here. This will use / as directory separator (C:/WINNT).
25# The files that use MONO_ASSEMBLIES and/or MONO_CFG_DIR replace the
26# / by \ if running under WIN32.
27if CROSS_COMPILING
28assembliesdir = ${libdir}
29confdir = ${sysconfdir}
30else
31assembliesdir = `cygpath -m "${libdir}"`
32confdir = `cygpath -m "${sysconfdir}"`
33endif
34export HOST_CC
35# The mingw math.h has "extern inline" functions that dont appear in libs, so
36# optimisation is required to actually inline them
37AM_CFLAGS = -O
38else
39
40assembliesdir = $(exec_prefix)/lib
41confdir = $(sysconfdir)
42unix_sources = \
43	console-unix.c \
44	w32mutex-unix.c \
45	w32semaphore-unix.c \
46	w32event-unix.c \
47	w32process-unix.c \
48	w32process-unix-internals.h \
49	w32process-unix-osx.c \
50	w32process-unix-bsd.c \
51	w32process-unix-haiku.c \
52	w32process-unix-default.c \
53	w32socket-unix.c \
54	w32file-unix.c \
55	w32file-unix-glob.c \
56	w32file-unix-glob.h \
57	w32error-unix.c
58
59platform_sources = $(unix_sources)
60endif
61
62if HOST_ANDROID
63platform_sources += ../../support/libm/complex.c
64endif
65
66#
67# libtool is not capable of creating static/shared versions of the same
68# convenience lib, so we have to do it ourselves
69#
70if SUPPORT_SGEN
71if DISABLE_EXECUTABLES
72shared_sgen_libraries = libmonoruntimesgen.la
73else
74if SHARED_MONO
75shared_sgen_libraries = libmonoruntimesgen.la
76endif
77endif
78sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la
79endif
80
81if SUPPORT_BOEHM
82if DISABLE_EXECUTABLES
83shared_boehm_libraries = libmonoruntime.la
84else
85if SHARED_MONO
86shared_boehm_libraries = libmonoruntime.la
87endif
88endif
89boehm_libraries = $(shared_boehm_libraries) libmonoruntime-static.la
90endif
91
92if DISABLE_EXECUTABLES
93noinst_LTLIBRARIES = libmonoruntime-config.la $(shared_sgen_libraries) $(shared_boehm_libraries)
94else
95noinst_LTLIBRARIES = libmonoruntime-config.la $(boehm_libraries) $(sgen_libraries)
96endif
97
98AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) $(SHARED_CFLAGS)
99
100#
101# Make sure any prefix changes are updated in the binaries too.
102#
103# This won't result in many more false positives than AC_DEFINEing them
104# in configure.ac.
105#
106mono-config-dirs.lo: Makefile
107
108#
109# This library is used to localize the usage of MONO_BINDIR etc. to just one source file, thus enabling
110# ccache to work even if the value of these defines change. We need to use a convenience library since automake
111# doesn't support per file cflags.
112#
113libmonoruntime_config_la_SOURCES = \
114	mono-config-dirs.h		\
115	mono-config-dirs.c
116libmonoruntime_config_la_CPPFLAGS = $(AM_CPPFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\" -DMONO_RELOC_LIBDIR=\"../$(reloc_libdir)\"
117
118CLEANFILES = mono-bundle.stamp
119
120null_sources = \
121	console-null.c
122
123null_gc_sources = \
124	null-gc.c \
125	null-gc-handles.h \
126	null-gc-handles.c
127
128common_sources = \
129	$(platform_sources)	\
130	appdomain.c	\
131	domain.c	\
132	appdomain-icalls.h	\
133	assembly.c		\
134	assembly-internals.h	\
135	attach.h		\
136	attach.c		\
137	cil-coff.h		\
138	class.c			\
139	class-internals.h	\
140	class-inlines.h		\
141	class-accessors.c	\
142	cominterop.c		\
143	cominterop.h		\
144	console-io.h		\
145	coree.c 		\
146	coree.h 		\
147	coree-internals.h \
148	culture-info.h  	\
149	culture-info-tables.h	\
150	debug-helpers.c		\
151	debug-mono-symfile.h	\
152	debug-mono-symfile.c	\
153	debug-mono-ppdb.h	\
154	debug-mono-ppdb.c	\
155	decimal-ms.c		\
156	decimal-ms.h		\
157	domain-internals.h	\
158	environment.c		\
159	environment.h		\
160	exception.c		\
161	exception.h		\
162	exception-internals.h	\
163	w32file.c		\
164	w32file.h		\
165	w32file-internals.h \
166	filewatcher.c		\
167	filewatcher.h		\
168	gc-internals.h		\
169	icall.c			\
170	icall-internals.h \
171	icall-def.h		\
172	image.c			\
173	image-internals.h	\
174	jit-info.c		\
175	loader.c		\
176	locales.c		\
177	locales.h		\
178	lock-tracer.c		\
179	lock-tracer.h		\
180	marshal.c		\
181	marshal.h		\
182	marshal-internals.h \
183	mempool.c		\
184	mempool.h		\
185	mempool-internals.h	\
186	metadata.c		\
187	metadata-verify.c	\
188	metadata-internals.h	\
189	method-builder.h 	\
190	method-builder.c 	\
191	mono-basic-block.c	\
192	mono-basic-block.h	\
193	mono-config.c		\
194	mono-debug.h		\
195	mono-debug.c		\
196	debug-internals.h	\
197	mono-endian.c		\
198	mono-endian.h		\
199	mono-hash.c		\
200	mono-hash.h		\
201	mono-conc-hash.c		\
202	mono-conc-hash.h		\
203	mono-mlist.c		\
204	mono-mlist.h		\
205	mono-perfcounters.c	\
206	mono-perfcounters.h	\
207	mono-perfcounters-def.h	\
208	mono-ptr-array.h	\
209	mono-route.c		\
210	mono-route.h		\
211	monitor.h		\
212	normalization-tables.h	\
213	number-formatter.h	\
214	number-ms.c		\
215	number-ms.h		\
216	object.c	\
217	object-internals.h	\
218	opcodes.c		\
219	property-bag.h	\
220	property-bag.c	\
221	w32socket.c		\
222	w32socket.h		\
223	w32socket-internals.h		\
224	w32process.c		\
225	w32process.h		\
226	w32process-internals.h		\
227	profiler.c		\
228	profiler-private.h	\
229	rand.h			\
230	rand.c			\
231	remoting.h		\
232	remoting.c		\
233	runtime.c		\
234	mono-security.c		\
235	security.h		\
236	security-core-clr.c	\
237	security-core-clr.h	\
238	security-manager.c	\
239	security-manager.h	\
240	string-icalls.c 	\
241	string-icalls.h 	\
242	sysmath.h		\
243	sysmath.c		\
244	tabledefs.h 		\
245	threads.c		\
246	threads-types.h		\
247	threadpool.c	\
248	threadpool.h	\
249	threadpool-worker-default.c	\
250	threadpool-worker.h	\
251	threadpool-io.c	\
252	threadpool-io.h	\
253	verify.c		\
254	verify-internals.h	\
255	wrapper-types.h	\
256	dynamic-image-internals.h	\
257	dynamic-stream.c	\
258	dynamic-stream-internals.h	\
259	reflection-cache.h	\
260	custom-attrs-internals.h	\
261	sre-internals.h	\
262	reflection-internals.h	\
263	file-mmap-posix.c	\
264	file-mmap-windows.c	\
265	file-mmap.h	\
266	object-offsets.h	\
267	abi-details.h	\
268	metadata-cross-helpers.c	\
269	seq-points-data.h	\
270	seq-points-data.c	\
271	handle.c	\
272	handle.h	\
273	w32mutex.h	\
274	w32semaphore.h	\
275	w32event.h	\
276	w32handle-namespace.h	\
277	w32handle-namespace.c	\
278	w32handle.h	\
279	w32handle.c	\
280	w32error.h	\
281	reflection.c	\
282	dynamic-image.c	\
283	sre.c	\
284	sre-encode.c	\
285	sre-save.c	\
286	custom-attrs.c	\
287	fdhandle.h	\
288	fdhandle.c	\
289	callspec.h	\
290	callspec.c
291
292# These source files have compile time dependencies on GC code
293gc_dependent_sources = \
294	gc-stats.c	\
295	gc.c		\
296	monitor.c
297
298boehm_sources = \
299	boehm-gc.c
300
301sgen_sources = \
302	sgen-bridge.c		\
303	sgen-bridge.h		\
304	sgen-bridge-internals.h	\
305	sgen-old-bridge.c		\
306	sgen-new-bridge.c		\
307	sgen-tarjan-bridge.c		\
308	sgen-toggleref.c		\
309	sgen-toggleref.h		\
310	sgen-stw.c				\
311	sgen-mono.c		\
312	sgen-client-mono.h
313
314libmonoruntime_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(null_gc_sources) $(boehm_sources)
315libmonoruntime_la_CFLAGS = $(BOEHM_DEFINES)
316libmonoruntime_la_LIBADD = libmonoruntime-config.la
317
318libmonoruntimesgen_la_SOURCES = $(common_sources) $(gc_dependent_sources) $(sgen_sources)
319libmonoruntimesgen_la_CFLAGS = $(SGEN_DEFINES)
320libmonoruntimesgen_la_LIBADD = libmonoruntime-config.la
321
322libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
323libmonoruntime_static_la_LDFLAGS = -static
324libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
325libmonoruntime_static_la_LIBADD = $(bundle_obj) libmonoruntime-config.la
326
327libmonoruntimesgen_static_la_SOURCES = $(libmonoruntimesgen_la_SOURCES)
328libmonoruntimesgen_static_la_LDFLAGS = -static
329libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
330libmonoruntimesgen_static_la_LIBADD = libmonoruntime-config.la
331
332libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
333
334libmonoruntimeinclude_HEADERS = \
335	assembly.h		\
336	attrdefs.h		\
337	appdomain.h		\
338	blob.h			\
339	class.h			\
340	debug-helpers.h		\
341	debug-mono-symfile.h	\
342	threads.h		\
343	environment.h		\
344	exception.h		\
345	image.h			\
346	loader.h		\
347	metadata.h		\
348	mono-config.h		\
349	mono-debug.h		\
350	mono-gc.h		\
351	sgen-bridge.h		\
352	object.h		\
353	opcodes.h		\
354	profiler.h		\
355	profiler-events.h	\
356	reflection.h		\
357	row-indexes.h		\
358	tokentype.h		\
359	verify.h
360
361EXTRA_DIST = $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
362		threadpool-io-poll.c threadpool-io-epoll.c threadpool-io-kqueue.c sgen-dynarray.h
363