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