aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile_Efl_Mono.am
blob: 4715fff4c6d63cc2d5b86003d46c1dadea480a81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399

efl_custom_exports_mono_files = \
	lib/efl_mono/efl_custom_exports_mono.c

efl_eo_mono_files = \
	bindings/mono/eo_mono/object.cs \
	bindings/mono/eo_mono/iwrapper.cs \
	bindings/mono/eo_mono/workaround.cs

efl_eina_mono_files = \
	bindings/mono/eina_mono/eina_config.cs \
	bindings/mono/eina_mono/eina_array.cs \
	bindings/mono/eina_mono/eina_hash.cs \
	bindings/mono/eina_mono/eina_list.cs \
	bindings/mono/eina_mono/eina_inarray.cs \
	bindings/mono/eina_mono/eina_inlist.cs \
	bindings/mono/eina_mono/eina_iterator.cs \
	bindings/mono/eina_mono/eina_container_common.cs \
	bindings/mono/eina_mono/eina_common.cs \
	bindings/mono/eina_mono/eina_log.cs \
	bindings/mono/eina_mono/eina_binbuf.cs \
	bindings/mono/eina_mono/eina_slice.cs \
	bindings/mono/eina_mono/eina_stringshare.cs \
	bindings/mono/eina_mono/eina_error.cs \
	bindings/mono/eina_mono/eina_value.cs

efl_eldbus_mono_files = \
	bindings/mono/eldbus_mono/eldbus_common.cs \
	bindings/mono/eldbus_mono/eldbus_config.cs \
	bindings/mono/eldbus_mono/eldbus_connection.cs \
	bindings/mono/eldbus_mono/eldbus_message.cs \
	bindings/mono/eldbus_mono/eldbus_object.cs \
	bindings/mono/eldbus_mono/eldbus_pending.cs \
	bindings/mono/eldbus_mono/eldbus_proxy.cs \
	bindings/mono/eldbus_mono/eldbus_service.cs

efl_ecore_evas_mono_files = \
	bindings/mono/ecore_evas_mono/ecore_evas.cs

lib_efl_mono_libefl_mono_dll_sources = \
	bindings/mono/efl_mono/efl_all.cs \
	$(efl_eo_mono_files) \
	$(efl_eina_mono_files) \
	$(efl_eldbus_mono_files) \
	$(efl_ecore_evas_mono_files)

EXTRA_DIST2 += \
bindings/mono/efl_mono/efl_libs.cs.in \
bindings/mono/efl_mono/efl_libs.csv.in

if HAVE_CSHARP

bin_PROGRAMS += bin/eolian_mono/eolian_mono

bin_eolian_mono_eolian_mono_SOURCES = \
	bin/eolian_mono/eolian_mono.cc
bin_eolian_mono_eolian_mono_CXXFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/lib/eolian_cxx/ \
-I$(top_srcdir)/src/bin/eolian_mono/ \
@CHECK_CFLAGS@ @EINA_CFLAGS@ @EINA_CXX_CFLAGS@ @EO_CXX_CFLAGS@ @ECORE_CXX_CFLAGS@ @EO_CFLAGS@ \
-I$(top_srcdir)/src/bindings/cxx/eina_cxx \
@EOLIAN_CXX_CFLAGS@ @EOLIAN_CFLAGS@

bin_eolian_mono_eolian_mono_LDADD = @CHECK_LIBS@ @USE_EOLIAN_LIBS@

bin_eolian_mono_eolian_mono_DEPENDENCIES = @USE_EOLIAN_INTERNAL_LIBS@

# Helper for other modules using Eolian_Mono, include only after Makefile_Eolian_Helper.am
include Makefile_Eolian_Mono_Helper.am

### Efl C Sharp Binding

evas_eolian_blacklisted_files = \
lib/evas/canvas/efl_canvas_text.eo.cs \
lib/evas/canvas/efl_canvas_scene3d.eo.cs \
lib/evas/canvas/evas_canvas3d_camera.eo.cs \
lib/evas/canvas/evas_canvas3d_light.eo.cs \
lib/evas/canvas/evas_canvas3d_material.eo.cs \
lib/evas/canvas/evas_canvas3d_mesh.eo.cs \
lib/evas/canvas/evas_canvas3d_node.eo.cs \
lib/evas/canvas/evas_canvas3d_object.eo.cs \
lib/evas/canvas/evas_canvas3d_primitive.eo.cs \
lib/evas/canvas/evas_canvas3d_scene.eo.cs \
lib/evas/canvas/evas_canvas3d_texture.eo.cs \
lib/evas/canvas/efl_canvas_vg.eo.cs \
lib/evas/canvas/efl_vg.eo.cs \
lib/evas/canvas/efl_vg_container.eo.cs \
lib/evas/canvas/efl_vg_gradient.eo.cs \
lib/evas/canvas/efl_vg_gradient_radial.eo.cs \
lib/evas/canvas/efl_vg_gradient_linear.eo.cs \
lib/evas/canvas/efl_vg_root_node.eo.cs \
lib/evas/canvas/efl_vg_shape.eo.cs

efl_eolian_blacklisted_files = \
lib/efl/interfaces/efl_io_buffer.eo.cs \
lib/efl/interfaces/efl_io_closer.eo.cs \
lib/efl/interfaces/efl_io_positioner.eo.cs \
lib/efl/interfaces/efl_io_queue.eo.cs \
lib/efl/interfaces/efl_io_reader.eo.cs \
lib/efl/interfaces/efl_io_sizer.eo.cs \
lib/efl/interfaces/efl_io_writer.eo.cs \
lib/efl/interfaces/efl_text_properties.eo.cs \
lib/efl/interfaces/efl_gfx_buffer.eo.cs \
lib/efl/interfaces/efl_gfx_shape.eo.cs \
lib/efl/interfaces/efl_gfx_gradient.eo.cs \
lib/efl/interfaces/efl_gfx_gradient_linear.eo.cs \
lib/efl/interfaces/efl_gfx_gradient_radial.eo.cs

ecore_eolian_blacklisted_files = \
lib/ecore/efl_io_closer_fd.eo.cs \
lib/ecore/efl_io_buffered_stream.eo.cs \
lib/ecore/efl_io_positioner_fd.eo.cs \
lib/ecore/efl_io_reader_fd.eo.cs \
lib/ecore/efl_io_writer_fd.eo.cs \
lib/ecore/efl_io_copier_fd.eo.cs \
lib/ecore/efl_io_sizer_fd.eo.cs \
lib/ecore/efl_io_stdin.eo.cs \
lib/ecore/efl_io_stdout.eo.cs \
lib/ecore/efl_io_stderr.eo.cs \
lib/ecore/efl_io_file.eo.cs \
lib/ecore/efl_io_copier.eo.cs

eo_eolian_blacklisted_files = \
lib/eo/efl_object_override.eo.cs

elementary_eolian_blacklisted_files = \
lib/elementary/elm_web.eo.cs \
lib/elementary/elm_map.eo.cs \
lib/elementary/elm_combobox.eo.cs \
lib/elementary/elm_list.eo.cs \
lib/elementary/elm_genlist.eo.cs \
lib/elementary/elm_view_list.eo.cs \
lib/elementary/elm_genlist_item.eo.cs \
lib/elementary/elm_gengrid.eo.cs \
lib/elementary/elm_glview.eo.cs

efl_eolian_mono_files = \
$(filter-out $(eo_eolian_blacklisted_files),$(eo_eolian_files:%.eo=%.eo.cs)) \
$(filter-out $(ecore_eolian_blacklisted_files),$(ecore_eolian_files_public:%.eo=%.eo.cs)) \
$(ecore_eolian_type_files:%.eot=%.eot.cs) \
$(filter-out $(efl_eolian_blacklisted_files),$(efl_eolian_files:%.eo=%.eo.cs)) \
$(filter-out $(edje_eolian_blacklisted_files),$(edje_eolian_files:%.eo=%.eo.cs)) \
$(filter-out $(elementary_eolian_blacklisted_files),$(elm_public_eolian_files:%.eo=%.eo.cs)) \
$(efl_eolian_type_files:%.eot=%.eot.cs) \
$(edje_eolian_type_files:%.eot=%.eot.cs) \
$(elm_eolian_type_files:%.eot=%.eot.cs) \
$(filter-out $(evas_eolian_blacklisted_files),$(evas_canvas_eolian_pub_files:%.eo=%.eo.cs)) \
lib/evas/canvas/evas_box.eo.cs \
lib/evas/canvas/evas_image.eo.cs \
lib/evas/canvas/efl_canvas_image.eo.cs \
lib/evas/canvas/evas_table.eo.cs \
lib/evas/canvas/evas_text.eo.cs \
lib/efl/interfaces/efl_text_properties.eo.cs \
$(evas_canvas_eolian_type_files:%.eot=%.eot.cs) \
lib/eo/eina_types.eot.cs

efl_mono_files_gen =\
$(lib_efl_mono_libefl_mono_dll_sources) \
$(efl_eolian_mono_files) \
$(builddir)/bindings/mono/efl_mono/efl_libs.cs


installed_eflmonomainheadersdir = $(includedir)/efl-mono-@VMAJ@/
nodist_installed_eflmonomainheaders_DATA = $(efl_eolian_files:%.eo=%.eo.cs) $(builddir)/bindings/mono/efl_mono/efl_libs.csv

CLEANFILES += $(efl_mono_files_gen)

if HAVE_WIN32

MCS_FLAGS := $(MCS_FLAGS)
MCS_FLAGS += -define:WIN32

endif

# Efl Custom Exports Mono auxiliary library

lib_LTLIBRARIES += \
lib/efl_mono/libeflcustomexportsmono.la

lib_efl_mono_libeflcustomexportsmono_la_SOURCES = \
	$(efl_custom_exports_mono_files)

lib_efl_mono_libeflcustomexportsmono_la_CPPFLAGS = \
-DEFL_BETA_API_SUPPORT \
-I$(top_builddir)/src/lib/efl \
@EFL_CUSTOM_EXPORTS_MONO_CFLAGS@
lib_efl_mono_libeflcustomexportsmono_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
lib_efl_mono_libeflcustomexportsmono_la_LIBADD = @EFL_CUSTOM_EXPORTS_MONO_LIBS@
lib_efl_mono_libeflcustomexportsmono_la_DEPENDENCIES = @EFL_CUSTOM_EXPORTS_MONO_INTERNAL_LIBS@

#Efl Mono - C Sharp binding library

lib/efl_mono/libefl_mono.dll: $(efl_mono_files_dist) lib/efl_mono/$(am__dirstamp) $(efl_mono_files_gen) lib/efl_mono/libefl_mono.dll.config
	@rm -f lib/efl_mono/libefl_mono.dll
	$(AM_V_MCS) $(MCS) $(MCS_FLAGS) -out:$@ -t:library $(filter %.cs, $(^))

if HAVE_WIN32
efl_mono_dll_dest = $(DESTDIR)$(bindir)
else
efl_mono_dll_dest = $(DESTDIR)$(libdir)/efl-mono-@VMAJ@
endif

EFL_INSTALL_EXEC_HOOK += \
$(MKDIR_P) $(efl_mono_dll_dest); \
cp -f $(builddir)/lib/efl_mono/libefl_mono.dll $(efl_mono_dll_dest)/libefl_mono.dll; \
$(MKDIR_P) $(DESTDIR)$(datadir)/efl_mono; \
cp -f $(builddir)/bindings/mono/efl_mono/efl_libs.csv $(DESTDIR)$(datadir)/efl_mono/efl_libs.csv;

all-local: lib/efl_mono/libefl_mono.dll


### MSBuild

bin_PROGRAMS += bin/efl_mono_msbuild_gen/efl_mono_msbuild_gen

bin_efl_mono_msbuild_gen_efl_mono_msbuild_gen_SOURCES = \
    bin/efl_mono_msbuild_gen/main.cc

bin_efl_mono_msbuild_gen_efl_mono_msbuild_gen_CXXFLAGS = \
    -I$(top_srcdir)/src/lib/efl \
    -I$(top_builddir)/src/lib/efl \
    -I$(top_srcdir)/src/lib/eolian_cxx/ \
    -I$(top_srcdir)/src/bindings/cxx/eina_cxx \
    @EINA_CFLAGS@ @EINA_CXX_CFLAGS@ @EO_CXX_CFLAGS@ \
    @ECORE_CXX_CFLAGS@ @EO_CFLAGS@ @EOLIAN_CXX_CFLAGS@ @EOLIAN_CFLAGS@

bin_efl_mono_msbuild_gen_efl_mono_msbuild_gen_LDADD = @CHECK_LIBS@ @USE_EOLIAN_LIBS@

bin_efl_mono_msbuild_gen_efl_mono_msbuild_gen_DEPENDENCIES = @USE_EOLIAN_INTERNAL_LIBS@

# Helper for other modules using Efl_Mono_MSBuild_Gen
include Makefile_Efl_Mono_MSBuild_Gen_Helper.am

# Efl Mono DLL for MSBuild
../libefl_mono.csproj: $(efl_mono_files_dist) lib/efl_mono/$(am__dirstamp) $(efl_mono_files_gen) $(_EFL_MONO_MSBUILD_GEN_DEP)
	@rm -f $@
	$(EFL_MONO_MSBUILD_GEN) $(MSBUILD_GEN_FLAGS) -o $@ -a libefl_mono.dll -t library $(patsubst %.cs,src/%.cs,$(filter %.cs, $(^)))

CSPROJS_SUBDIRS = \
examples/eina \
examples/efl_mono

msbuildcsprojs: ../libefl_mono.csproj
	@for d in $(CSPROJS_SUBDIRS); do \
	  echo "Making MSBuild C Sharp projects in $$d"; \
	  $(MAKE) $(AM_MAKEFLAGS) -C $$d msbuildcsprojs || exit 1; \
	done

### Some hard-coded runtime dependencies for tests and examples
TEST_PATHS = $(abs_top_builddir)/src/lib/efl_mono:$(abs_top_builddir)/src/lib/efl_mono/.libs:$(abs_top_builddir)/src/lib/eina/.libs:$(abs_top_builddir)/src/lib/ecore/.libs:$(abs_top_builddir)/src/lib/ecore_evas/.libs:$(abs_top_builddir)/src/lib/eo/.libs:$(abs_top_builddir)/src/lib/evas/.libs:$(abs_top_builddir)/src/lib/emile/.libs:$(abs_top_builddir)/src/lib/eet/.libs:$(abs_top_builddir)/src/lib/efl/.libs:$(abs_top_builddir)/src/ecore-file/.libs:$(abs_top_builddir)/src/lib/efl-input/.libs:$(abs_top_builddir)/src/lib/edje/.libs:$(abs_top_builddir)/src/lib/ethumb/.libs:$(abs_top_builddir)/src/lib/ethumb-client/.libs:$(abs_top_builddir)/src/lib/emotion/.libs:$(abs_top_builddir)/src/lib/ecore-imf/.libs:$(abs_top_builddir)/src/lib/ecore-con/.libs:$(abs_top_builddir)/src/lib/eldbus/.libs:$(abs_top_builddir)/src/lib/efreet/.libs:$(abs_top_builddir)/src/lib/efreet-mime/.libs:$(abs_top_builddir)/src/lib/efreet-trash/.libs:$(abs_top_builddir)/src/lib/eio/.libs:$(abs_top_builddir)/src/lib/elocation/.libs:$(abs_top_builddir)/src/lib/elementary/.libs

WIN_ADD_TEST_PATHS = $(abs_top_builddir)/src/lib/evil/.libs:$(abs_top_builddir)/src/lib/ecore_win32/.libs:$(abs_top_builddir)/src/lib/ector/.libs:$(abs_top_builddir)/src/lib/ecore_con/.libs:$(abs_top_builddir)/src/lib/ecore_imf/.libs:$(abs_top_builddir)/src/lib/ecore_file/.libs:$(abs_top_builddir)/src/lib/ecore_input/.libs:$(abs_top_builddir)/src/ethumb_client/.libs:$(abs_top_builddir)/src/tests/efl_mono/.libs


### Rules for generating the .cs files

if HAVE_WIN32
ALL_EO_REFS = -r $(top_builddir)/src/bindings/mono/efl_mono/efl_libs.csv
else
ALL_EO_REFS=
endif

lib/eo/%.eo.cs: lib/eo/%.eo $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport eo -o $@ $(ALL_EO_REFS) $<

lib/ecore/%.eo.cs: lib/ecore/%.eo $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport ecore -o $@ $(ALL_EO_REFS) $<

lib/evas/%.eo.cs: lib/evas/%.eo $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport evas -o $@ $(ALL_EO_REFS) $<

lib/efl/%.eo.cs: lib/efl/%.eo $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport efl -o $@ $(ALL_EO_REFS) $<

lib/edje/%.eo.cs: lib/edje/%.eo $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport edje -o $@ $(ALL_EO_REFS) $<

lib/elementary/%.eo.cs: lib/elementary/%.eo $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport elementary -o $@ $(ALL_EO_REFS) $<

lib/ecore/%.eot.cs: lib/ecore/%.eot $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport ecore -o $@ $(ALL_EO_REFS) $<

lib/eo/%.eot.cs: lib/eo/%.eot $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport eo -o $@ $(ALL_EO_REFS) $<

lib/evas/%.eot.cs: lib/evas/%.eot $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport evas -o $@ $(ALL_EO_REFS) $<

lib/efl/%.eot.cs: lib/efl/%.eot $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport efl -o $@ $(ALL_EO_REFS) $<

lib/edje/%.eot.cs: lib/edje/%.eot $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport edje -o $@ $(ALL_EO_REFS) $<

lib/elementary/%.eot.cs: lib/elementary/%.eot $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport elementary -o $@ $(ALL_EO_REFS) $<


### Tests

if EFL_ENABLE_TESTS

# Intermediate C test native library
check_LTLIBRARIES += tests/efl_mono/libefl_mono_native_test.la

tests_efl_mono_libefl_mono_native_test_la_SOURCES = tests/efl_mono/libefl_mono_native_test.c
tests_efl_mono_libefl_mono_native_test_la_CPPFLAGS =  \
-I$(builddir)/tests/efl_mono \
@CHECK_CFLAGS@ @EINA_CFLAGS@ @EO_CFLAGS@ @ECORE_CFLAGS@ @ELDBUS_CFLAGS@
tests_efl_mono_libefl_mono_native_test_la_LIBADD = \
@CHECK_LIBS@ @USE_EINA_LIBS@ @USE_EO_LIBS@ @USE_ECORE_LIBS@ @USE_ELDBUS_LIBS@
tests_efl_mono_libefl_mono_native_test_la_LDFLAGS = -rpath $(abs_top_builddir)/tests/efl_mono @EFL_LTLIBRARY_FLAGS@
tests_efl_mono_libefl_mono_native_test_la_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_EO_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ELDBUS_INTERNAL_LIBS@
tests_efl_mono_libefl_mono_native_test_la_LIBTOOLFLAGS = --tag=disable-static

tests/efl_mono/libefl_mono_native_test.c: tests/efl_mono/test_testing.eo.h tests/efl_mono/test_testing.eo.c tests/efl_mono/test_numberwrapper.eo.h tests/efl_mono/test_numberwrapper.eo.c

# Intermediate C Sharp test DLL
efl_mono_test_eolian_mono_files = tests/efl_mono/test_testing.eo.cs \
tests/efl_mono/test_numberwrapper.eo.cs

tests/efl_mono/libefl_mono_test.dll: $(efl_mono_test_eolian_mono_files) tests/efl_mono/$(am__dirstamp) lib/efl_mono/libefl_mono.dll tests/efl_mono/libefl_mono_native_test.la
	@rm -f tests/efl_mono/libefl_mono_test.dll
	$(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_builddir)/lib/efl_mono/libefl_mono.dll -out:$@ -t:library $(filter %.cs, $(^))

# C Sharp test executable
AM_TESTS_ENVIRONMENT += MONO='mono'; export MONO;
AM_TESTS_ENVIRONMENT += MONO_BUILDPATH='$(abs_top_builddir)'; export MONO_BUILDPATH;
AM_TESTS_ENVIRONMENT += MONO_PATH='$(TEST_PATHS)'; export MONO_PATH;
AM_TESTS_ENVIRONMENT += EXEEXT='$(EXEEXT)'; export EXEEXT;
if HAVE_WIN32
AM_TESTS_ENVIRONMENT += PATH='$(PATH):$(TEST_PATHS):$(WIN_ADD_TEST_PATHS)'; export PATH;
else
AM_TESTS_ENVIRONMENT += LD_LIBRARY_PATH='$(LD_LIBRARY_PATH):$(TEST_PATHS)'; export LD_LIBRARY_PATH;
endif

check_PROGRAMS += tests/efl_mono/efl_mono
TESTS += tests/efl_mono/mono_test_driver.sh

tests_efl_mono_efl_mono_SOURCES = \
     tests/efl_mono/Main.cs \
     tests/efl_mono/Eina.cs \
     tests/efl_mono/Eldbus.cs \
     tests/efl_mono/Eo.cs \
     tests/efl_mono/Errors.cs \
     tests/efl_mono/Evas.cs \
     tests/efl_mono/Events.cs \
     tests/efl_mono/FunctionPointers.cs \
     tests/efl_mono/Strings.cs \
     tests/efl_mono/Structs.cs \
     tests/efl_mono/TestUtils.cs \
     tests/efl_mono/Value.cs \
     tests/efl_mono/ValueEolian.cs

lib/efl_mono/libefl_mono.dll.config:
	echo "<configuration>" > $@
	echo "  <dllmap dll=\"eina\" target=\"$(abs_top_builddir)/src/lib/eina/.libs/libeina.so\"/>" >> $@
	echo "  <dllmap dll=\"eo\" target=\"$(abs_top_builddir)/src/lib/eo/.libs/libeo.so\"/>" >> $@
	echo "  <dllmap dll=\"evas\" target=\"$(abs_top_builddir)/src/lib/evas/.libs/libevas.so\"/>" >> $@
	echo "  <dllmap dll=\"elementary\" target=\"$(abs_top_builddir)/src/lib/elementary/.libs/libelementary.so\"/>" >> $@
	echo "</configuration>" >> $@

tests/efl_mono/efl_mono$(EXEEXT): $(tests_efl_mono_efl_mono_SOURCES) tests/efl_mono/$(am__dirstamp) lib/efl_mono/libefl_mono.dll tests/efl_mono/libefl_mono_test.dll
	@rm -f $@
	$(AM_V_MCS) $(MCS) $(MCS_FLAGS) -r:$(abs_top_builddir)/src/lib/efl_mono/libefl_mono.dll -r:$(abs_top_builddir)/src/tests/efl_mono/libefl_mono_test.dll -out:$@ $(filter %.cs, $(^))

# Rule for generating the .cs files
tests/efl_mono/%.eo.cs: tests/efl_mono/%.eo $(_EOLIAN_MONO_DEP)
	$(AM_V_EOLMONO) \
	$(MKDIR_P) $(dir $@); \
	$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport "@DLIB_PREFIX_MONO@efl_mono_native_test@DLIB_SUFFIX_MONO@" -o $@ $(ALL_EO_REFS) $<

endif
endif