Merge "Patch to synchronize with bug fixes done in Tizen 2.4 MCD branch." into devel...
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / Makefile.am
1 # Copyright (c) 2016 Samsung Electronics Co., Ltd.
2
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6
7 # http://www.apache.org/licenses/LICENSE-2.0
8
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 CLEANFILES = cpp/dali_wrap.* csharp/*.cs *.so *.dll \
16              examples/*.so examples/*.dll examples/*.exe
17
18 BUILT_SOURCES = cpp/dali_wrap.cpp cpp/dali_wrap.h
19
20 if HAVE_MCS
21 if BUILD_MCS
22
23 all-local: libNDalic.so NDali.dll
24
25 libNDalic.so: cpp/dali_wrap.o
26         g++ -shared cpp/dali_wrap.o -o libNDalic.so $(DALICORE_LIBS) $(DALIADAPTOR_LIBS) $(DALITOOLKIT_LIBS)
27
28 cpp/dali_wrap.o: $(BUILT_SOURCES)
29         g++ -c -fpic $(CXXFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) cpp/dali_wrap.cpp -o cpp/dali_wrap.o
30
31 NDali.dll: $(BUILT_SOURCES)
32         $(MCS) -nologo -target:library -out:NDali.dll csharp/*.cs
33
34 check-local: examples/dali-test.exe \
35              examples/hello-world.exe \
36              examples/scroll-view.exe \
37              examples/libNDalic.so examples/NDali.dll
38
39 examples/%.exe: examples/%.cs
40         $(MCS) -nologo -target:exe -out:$@ -reference:NDali.dll $<
41
42 examples/libNDalic.so: libNDalic.so
43         cd examples && ln -sf ../libNDalic.so
44
45 examples/NDali.dll: NDali.dll
46         cd examples && ln -sf ../NDali.dll
47
48 endif
49 endif
50
51 # use swig to generate the CS wrapper code
52 # then call our property-wrapper to inject DALi property getters / setters
53 $(BUILT_SOURCES): SWIG/*.i
54         rm -f csharp/*.cs
55         $(SWIG) -csharp -c++ -outdir csharp \
56             $(DALI_CFLAGS) $(DALICORE_CFLAGS) $(DALIADAPTOR_CFLAGS) $(DALITOOLKIT_CFLAGS) -namespace Dali -o cpp/dali_wrap.cpp SWIG/dali.i
57         ./property-wrapper.rb
58         ./constructor-generator.rb
59
60 dist-hook: $(BUILT_SOURCES)
61         mkdir -p $(distdir)/cpp
62         cp ./cpp/dali_wrap.cpp $(distdir)/cpp
63         cp ./cpp/dali_wrap.h $(distdir)/cpp
64         cp ./cpp/DaliWrapper.h ./cpp/DaliWrapper.cpp $(distdir)/cpp
65         cp ./cpp/stdafx.h $(distdir)/cpp
66         mkdir -p $(distdir)/csharp
67         cp ./csharp/*.csproj $(distdir)/csharp
68         cp ./csharp/*.cs $(distdir)/csharp
69         mkdir -p $(distdir)/examples
70         cp ./examples/*.csproj $(distdir)/examples
71         cp ./examples/*.cs $(distdir)/examples
72
73 EXTRA_DIST = \
74     swig.cmd
75