1 # Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 CLEANFILES = cpp/dali_wrap.* csharp/*.cs *.so *.dll \
16 examples/*.so examples/*.dll examples/*.exe
18 BUILT_SOURCES = cpp/dali_wrap.cpp cpp/dali_wrap.h
23 all-local: libNDalic.so NDali.dll
25 libNDalic.so: cpp/dali_wrap.o
26 g++ -shared cpp/dali_wrap.o -o libNDalic.so $(DALICORE_LIBS) $(DALIADAPTOR_LIBS) $(DALITOOLKIT_LIBS)
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
31 NDali.dll: $(BUILT_SOURCES)
32 $(MCS) -nologo -target:library -out:NDali.dll csharp/*.cs
34 check-local: examples/dali-test.exe \
35 examples/hello-world.exe \
36 examples/scroll-view.exe \
37 examples/libNDalic.so examples/NDali.dll
39 examples/%.exe: examples/%.cs
40 $(MCS) -nologo -target:exe -out:$@ -reference:NDali.dll $<
42 examples/libNDalic.so: libNDalic.so
43 cd examples && ln -sf ../libNDalic.so
45 examples/NDali.dll: NDali.dll
46 cd examples && ln -sf ../NDali.dll
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
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
58 ./constructor-generator.rb
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