2009-05-26 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mono / metadata / CMakeLists.txt
1 if(PLATFORM_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
22 else()
23
24 # FIXME:
25 set(assembliesdir ${CMAKE_INSTALL_PREFIX}/lib)
26 set(sysconfdir ${CMAKE_INSTALL_PREFIX}/etc)
27 set(confdir ${sysconfdir})
28 ###assembliesdir = $(exec_prefix)/lib
29 ###confdir = $(sysconfdir)
30
31 set(unix_sources
32   console-unix.c)
33
34 set(platform_sources ${unix_sources})
35
36 endif(PLATFORM_WIN32)
37
38 ###bin_PROGRAMS = pedump
39
40 #
41 #### libtool is not capable of creating static/shared versions of the same
42 #### convenience lib, so we have to do it ourselves
43 #
44 ###noinst_LTLIBRARIES = libmonoruntime.la libmonoruntime-static.la
45
46 set(top_srcdir ../../)
47 INCLUDE_DIRECTORIES(${top_srcdir} ${top_srcdir}/mono ${GLIB2_INCLUDE_DIRS})
48 ADD_DEFINITIONS("-DMONO_BINDIR=\"${CMAKE_BINARY_DIR}\"")
49 ADD_DEFINITIONS("-DMONO_ASSEMBLIES=\"${assembliesdir}\"")
50 ADD_DEFINITIONS("-DMONO_CFG_DIR=\"${confdir}\"")
51 ADD_DEFINITIONS(${CFLAGS} ${LIBGC_CFLAGS} ${CPPFLAGS})
52
53 #
54 #### Make sure any prefix changes are updated in the binaries too.
55 #
56 ####  assembly.c uses MONO_ASSEMBLIES
57 ####  mono-config.c uses MONO_CFG_DIR
58 #
59 #### This won't result in many more false positives than AC_DEFINEing them
60 #### in configure.in.
61 #
62 ###assembly.lo mono-config.lo: Makefile
63
64 ###CLEANFILES = mono-bundle.stamp
65
66 ###libmonoruntime_static_la_LIBADD = $(bundle_obj) $(libmonoruntime_la_LIBADD)
67
68 set(null_sources
69   console-null.c)
70
71 set(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         generic-sharing.c
107         icall.c         
108         icall-def.h     
109         image.c         
110         loader.c        
111         locales.c       
112         locales.h       
113         lock-tracer.c   
114         lock-tracer.h   
115         marshal.c       
116         marshal.h       
117         mempool.c       
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-config.c   
125         mono-debug.h    
126         mono-debug.c    
127         mono-debug-debugger.h
128         mono-debug-debugger.c
129         mono-endian.c   
130         mono-endian.h   
131         mono-mlist.c    
132         mono-mlist.h    
133         mono-perfcounters.c
134         mono-perfcounters.h
135         mono-perfcounters-def.h
136         monitor.c       
137         monitor.h       
138         normalization-tables.h
139         null-gc.c       
140         number-formatter.h
141         object.c        
142         object-internals.h
143         opcodes.c       
144         socket-io.c     
145         socket-io.h     
146         process.c       
147         process.h       
148         profiler.c      
149         profiler-private.h
150         rand.h          
151         rand.c          
152         reflection.c    
153         security.c      
154         security.h      
155         security-core-clr.c
156         security-core-clr.h
157         security-manager.c
158         security-manager.h
159         sgen-gc.c       
160         sgen-gc.h       
161         string-icalls.c 
162         string-icalls.h 
163         sysmath.h       
164         sysmath.c       
165         tabledefs.h     
166         threads.c       
167         threads-types.h 
168         threadpool.c    
169         threadpool.h    
170         threadpool-internals.h
171         verify.c        
172         verify-internals.h
173         wrapper-types.h)
174
175 set(libmonoruntime_static_la_SOURCES ${libmonoruntime_la_SOURCES})
176
177 ###libmonoruntimeincludedir = $(includedir)/mono-$(API_VER)/mono/metadata
178
179 ###libmonoruntimeinclude_HEADERS = \
180 ###     assembly.h              \
181 ###     attrdefs.h              \
182 ###     appdomain.h             \
183 ###     blob.h                  \
184 ###     class.h                 \
185 ###     debug-helpers.h         \
186 ###     debug-mono-symfile.h    \
187 ###     threads.h               \
188 ###     environment.h           \
189 ###     exception.h             \
190 ###     image.h                 \
191 ###     loader.h                \
192 ###     mempool.h               \
193 ###     metadata.h              \
194 ###     mono-config.h           \
195 ###     mono-debug.h            \
196 ###     mono-gc.h               \
197 ###     object.h                \
198 ###     opcodes.h               \
199 ###     profiler.h              \
200 ###     reflection.h            \
201 ###     row-indexes.h           \
202 ###     tokentype.h             \
203 ###     verify.h                
204
205 #ADD_LIBRARY(libmonoruntime SHARED ${libmonoruntime_la_SOURCES})
206
207 ###if DTRACE_G_REQUIRED
208
209 ###PEDUMP_DTRACE_OBJECT = pedump-dtrace.$(OBJEXT)
210
211 ###pedump-dtrace.$(OBJEXT): $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
212 ###     DTRACE="$(DTRACE)" DTRACEFLAGS="$(DTRACEFLAGS)" AR="$(AR)" $(SHELL) $(top_srcdir)/data/dtrace-prelink.sh \
213 ###     --pic pedump-dtrace.$(OBJEXT) $(top_srcdir)/data/mono.d libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
214
215 ###else
216 ###PEDUMP_DTRACE_OBJECT = 
217 ###endif
218
219 add_library(monoruntime-static STATIC ${libmonoruntime_static_la_SOURCES})
220 #add_library(monoruntime SHARED ${libmonoruntime_static_la_SOURCES})
221 #target_link_libraries(monoruntime wapi monoutils monogc ${GLIB2_LIBRARIES} ${LIBS})
222
223 # FIXME:
224 link_directories(../../libgc/.libs)
225 add_executable(pedump pedump.c)
226 target_link_libraries(pedump monoruntime-static wapi monoutils monogc-static ${GLIB2_LIBRARIES} ${LIBS})
227
228 ###pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
229 ###     $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(PEDUMP_DTRACE_OBJECT)
230
231 ###EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources)
232