63a0ab7c3d0124a3a091b5f8f31c50ec500bf1f4
[opencv] / interfaces / swig / python / Makefile.am
1 # opencv/interfaces/swig/python/Makefile.am
2 # 2005-05-07, Mark Asbach <asbach@ient.rwth-aachen.de>
3
4 # depending on the Automake conditionals set by configure, we will build the various
5 # script language interfaces that SWIG is capable of generating wrappers for
6
7 CV_INCLUDES = \
8   -I$(top_srcdir)/cv/include         \
9   -I$(top_srcdir)/cxcore/include     \
10   -I$(top_srcdir)/ml/include         \
11   -I$(top_srcdir)/otherlibs/highgui
12
13 AM_CPPFLAGS = \
14   $(CV_INCLUDES)                     \
15   -DCV_NO_BACKWARD_COMPATIBILITY
16
17 AM_CXXFLAGS = @PY_CXXFLAGS@
18
19 noinst_PYTHON = setup-for-win.py
20
21 EXTRA_DIST = \
22   __init__.py      \
23   \
24   cv.py            \
25   adaptors.py      \
26   highgui.py       \
27   matlab_syntax.py \
28   \
29   cv.i             \
30   cvaliases.i      \
31   cvarr.i          \
32   cvseq.i          \
33   cvshadow.i       \
34   ml.i             \
35   highgui.i        \
36   imagedata.i      \
37   nointpb.i        \
38   pyhelpers.i      \
39   pytypemaps.i     \
40   \
41   cvshadow.h       \
42   error.h          \
43   pycvseq.hpp      \
44   pyhelpers.h      \
45   \
46   _cv.cpp          \
47   _ml.cpp          \
48   _highgui.cpp     \
49   cvshadow.cpp     \
50   error.cpp        \
51   pyhelpers.cpp
52
53
54 # SWIG #######################################################################
55
56 # the following rules keep wrappers up to date, if SWIG is present
57 if UPDATE_SWIG_WRAPPERS
58
59 # this rule creates the Python wrapper sources for cxcore and cv
60 _cv.cpp: cv.i imagedata.i cvarr.i cvaliases.i pyhelpers.i       \
61          nointpb.i pytypemaps.i cvshadow.i cvseq.i              \
62          error.cpp error.h                                      \
63          pyhelpers.h cvshadow.h pycvseq.hpp                     \
64          $(top_srcdir)/interfaces/swig/general/cv.i             \
65          $(top_srcdir)/interfaces/swig/general/memory.i         \
66          $(top_srcdir)/interfaces/swig/general/typemaps.i       \
67          $(top_srcdir)/interfaces/swig/general/extensions.i     \
68          $(top_srcdir)/interfaces/swig/general/doublepointers.i \
69          $(top_srcdir)/interfaces/swig/general/sizeof.i         \
70          $(top_srcdir)/interfaces/swig/general/cvmacros.i       \
71          ../filtered/cv.h            \
72          ../filtered/constants.h     \
73          Makefile.in
74         $(SWIG) $(SWIG_PYTHON_OPT) $(CV_INCLUDES) -o $@ $<
75
76 # this rule creates the Python wrapper sources for ml
77 _ml.cpp: ml.i nointpb.i pytypemaps.i                            \
78               $(top_srcdir)/interfaces/swig/general/typemaps.i  \
79               $(top_srcdir)/interfaces/swig/general/memory.i    \
80               $(top_srcdir)/ml/include/ml.h                     \
81               Makefile.in
82         $(SWIG) $(SWIG_PYTHON_OPT) $(CV_INCLUDES) -DSKIP_INCLUDES -o $@ $<
83
84 # this rule creates the Python wrapper sources for highgui
85 _highgui.cpp: highgui.i nointpb.i pytypemaps.i                  \
86               $(top_srcdir)/interfaces/swig/general/highgui.i   \
87               $(top_srcdir)/interfaces/swig/general/typemaps.i  \
88               $(top_srcdir)/interfaces/swig/general/memory.i    \
89               $(top_srcdir)/otherlibs/highgui/highgui.h         \
90               Makefile.in
91         $(SWIG) $(SWIG_PYTHON_OPT) $(CV_INCLUDES) -DSKIP_INCLUDES -o $@ $<
92
93 CV_HEADER_FILES = \
94   $(top_srcdir)/cxcore/include/cxtypes.h \
95   $(top_srcdir)/cxcore/include/cxcore.h  \
96   $(top_srcdir)/cv/include/cvtypes.h \
97   $(top_srcdir)/cv/include/cv.h
98
99 cvaliases.i: $(CV_HEADER_FILES) Makefile.in
100         $(PYTHON) $(top_srcdir)/utils/extract_aliases.py $(CV_HEADER_FILES) > $@
101
102 endif
103
104
105 # Conditional targets #######################################################
106
107 if BUILD_PYTHON_WRAPPERS
108
109 #pkgpython_LTLIBRARIES = _cv.la _highgui.la
110 pkgpython_LTLIBRARIES = _cv.la _ml.la _highgui.la
111
112 pkgpython_PYTHON = \
113   __init__.py    \
114   cv.py          \
115   ml.py          \
116   highgui.py     \
117   adaptors.py    \
118   matlab_syntax.py
119
120 _cv_la_SOURCES    = _cv.cpp error.cpp error.h pyhelpers.cpp pyhelpers.h \
121                     pycvseq.hpp cvshadow.cpp cvshadow.h \
122                     cv.i imagedata.i cvarr.i nointpb.i pytypemaps.i cvseq.i cvshadow.i
123 _cv_la_CXXFLAGS   = $(PYTHON_CSPEC)
124 _cv_la_LIBADD     = $(top_builddir)/cv/src/libcv.la
125 _cv_la_LDFLAGS    = -module -avoid-version -no-undefined $(PYTHON_LSPEC) \
126                     -L$(SWIG_PYTHON_LIBS)
127
128 _ml_la_SOURCES    = _ml.cpp pyhelpers.cpp pyhelpers.h
129 _ml_la_CXXFLAGS   = $(PYTHON_CSPEC)
130 _ml_la_LIBADD     = $(top_builddir)/ml/src/libml.la
131 _ml_la_LDFLAGS    = -module -avoid-version -no-undefined $(PYTHON_LSPEC) \
132                     -L$(SWIG_PYTHON_LIBS)
133
134 _highgui_la_SOURCES    = _highgui.cpp pyhelpers.cpp pyhelpers.h \
135                          highgui.i
136 _highgui_la_CXXFLAGS     = $(PYTHON_CSPEC)
137 _highgui_la_LIBADD       = $(top_builddir)/otherlibs/highgui/libhighgui.la
138 _highgui_la_LDFLAGS      = -module -avoid-version -no-undefined $(PYTHON_LSPEC) \
139                            -L$(SWIG_PYTHON_LIBS)
140
141 endif