Makefile revision 1.1 1 1.1 christos #
2 1.1 christos # Makefile: compilation of pyUnbound and documentation, testing
3 1.1 christos #
4 1.1 christos # Copyright (c) 2009, Zdenek Vasicek (vasicek AT fit.vutbr.cz)
5 1.1 christos # Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz)
6 1.1 christos #
7 1.1 christos # This software is open source.
8 1.1 christos #
9 1.1 christos # Redistribution and use in source and binary forms, with or without
10 1.1 christos # modification, are permitted provided that the following conditions
11 1.1 christos # are met:
12 1.1 christos #
13 1.1 christos # * Redistributions of source code must retain the above copyright notice,
14 1.1 christos # this list of conditions and the following disclaimer.
15 1.1 christos #
16 1.1 christos # * Redistributions in binary form must reproduce the above copyright notice,
17 1.1 christos # this list of conditions and the following disclaimer in the documentation
18 1.1 christos # and/or other materials provided with the distribution.
19 1.1 christos #
20 1.1 christos # * Neither the name of the organization nor the names of its
21 1.1 christos # contributors may be used to endorse or promote products derived from this
22 1.1 christos # software without specific prior written permission.
23 1.1 christos #
24 1.1 christos # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 1.1 christos # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26 1.1 christos # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27 1.1 christos # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
28 1.1 christos # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 1.1 christos # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 1.1 christos # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 1.1 christos # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 1.1 christos # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 1.1 christos # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 1.1 christos # POSSIBILITY OF SUCH DAMAGE.
35 1.1 christos
36 1.1 christos help:
37 1.1 christos @echo "Please use \`make <target>' where <target> is one of"
38 1.1 christos @echo " testenv to make test environment and run bash "
39 1.1 christos @echo " useful in case you don't want to install unbound but want to test examples"
40 1.1 christos @echo " doc to make documentation"
41 1.1 christos @echo " clean clean all"
42 1.1 christos
43 1.1 christos .PHONY: testenv clean doc swig
44 1.1 christos
45 1.1 christos #_unbound.so: ../../Makefile
46 1.1 christos #$(MAKE) -C ../..
47 1.1 christos
48 1.1 christos #../../.libs/libunbound.so.0: ../../Makefile
49 1.1 christos #$(MAKE) -C ../..
50 1.1 christos
51 1.1 christos clean:
52 1.1 christos rm -rdf examples/unbound
53 1.1 christos rm -f _unbound.so libunbound_wrap.o
54 1.1 christos $(MAKE) -C ../.. clean
55 1.1 christos
56 1.1 christos testenv: ../../.libs/libunbound.so.2 ../../.libs/_unbound.so
57 1.1 christos rm -rdf examples/unbound
58 1.1 christos cd examples && mkdir unbound && ln -s ../../unbound.py unbound/__init__.py && ln -s ../../_unbound.so unbound/_unbound.so && ln -s ../../../../.libs/libunbound.so.2 unbound/libunbound.so.2 && ls -la
59 1.1 christos cd examples && if test -f ../../../.libs/_unbound.so; then cp ../../../.libs/_unbound.so . ; fi
60 1.1 christos @echo "Run a script by typing ./script_name.py"
61 1.1 christos cd examples && LD_LIBRARY_PATH=unbound bash
62 1.1 christos rm -rdf examples/unbound examples/_unbound.so
63 1.1 christos
64 1.1 christos doc: ../../.libs/libunbound.so.0 _unbound.so
65 1.1 christos $(MAKE) -C docs html
66 1.1 christos
67 1.1 christos #for development only
68 1.1 christos swig: libunbound.i
69 1.1 christos swig -python -o libunbound_wrap.c -I../.. libunbound.i
70 1.1 christos gcc -c libunbound_wrap.c -O9 -fPIC -I../.. -I/usr/include/python2.5 -I. -o libunbound_wrap.o
71 1.1 christos gcc -shared libunbound_wrap.o -L../../.libs -lunbound -o _unbound.so
72 1.1 christos
73