Imported Upstream version 3.0.3
[debian/gnuradio] / gnuradio-core / src / lib / swig / Makefile.am
1 #
2 # Copyright 2001,2003,2004,2005 Free Software Foundation, Inc.
3
4 # This file is part of GNU Radio
5
6 # GNU Radio is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10
11 # GNU Radio is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Radio; see the file COPYING.  If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street,
19 # Boston, MA 02110-1301, USA.
20
21
22 include $(top_srcdir)/Makefile.common
23
24 # Install this stuff in the gr subdirectory of the python pkg dir.
25 # This usually ends up at:
26 #   ${prefix}/lib/python${python_version}/site-packages/gnuradio/gr
27
28 grgrpythondir = $(grpythondir)/gr
29 grgrlibdir    = $(grpyexecdir)/gr
30
31
32 INCLUDES = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) -I$(srcdir)
33
34
35 EXTRA_DIST = gen-swig-bug-fix
36
37
38 LOCAL_IFILES =                          \
39         gnuradio.i                      \
40         shared_ptr.i                                    
41
42 ALL_IFILES =                            \
43         $(LOCAL_IFILES)                 
44
45
46 BUILT_SOURCES =                         \
47         gnuradio_swig_python.cc         \
48         gnuradio_swig_python.py         \
49         gnuradio_swig_python.h          \
50         gnuradio_swig_bug_workaround.h  
51
52 grgrpython_PYTHON =                     \
53         gnuradio_swig_python.py         
54
55
56 SWIGPYTHONARGS = $(SWIGPYTHONFLAGS) $(INCLUDES)
57
58
59 # ----------------------------------------------------------------
60 # _gnuradio_swig_python contains all the glue that implements
61 # the gnuradio.gr python package
62
63 grgrlib_LTLIBRARIES =                                   \
64         _gnuradio_swig_python.la
65
66 _gnuradio_swig_python_la_SOURCES =                      \
67         gnuradio_swig_python.cc         
68
69
70 _gnuradio_swig_python_la_LIBADD  =                      \
71         $(GNURADIO_CORE_LA)                             \
72         $(PYTHON_LDFLAGS)                               \
73         -lstdc++
74
75 _gnuradio_swig_python_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED)
76
77
78 # KLUDGE: Force runtime include of gnuradio_swig_python.d dependency file.
79 # This is not guaranteed to be portable, but will probably work.
80 # If it works, we have accurate dependencies for our swig stuff, which is good.
81 @am__include@ @am__quote@./gnuradio_swig_python.d@am__quote@
82
83 gnuradio_swig_python.py gnuradio_swig_python.h: gnuradio_swig_python.cc
84
85 gnuradio_swig_python.cc : gnuradio.i
86         if $(SWIG) $(SWIGPYTHONARGS) -MMD -MF gnuradio_swig_python.Td -module gnuradio_swig_python -o gnuradio_swig_python.cc gnuradio.i ;\
87         then if test $(host_os) = mingw32; \
88              then sed 's,\\\\,/,g' <gnuradio_swig_python.Td >gnuradio_swig_python.d; rm -f gnuradio_swig_python.Td; \
89              else mv -f gnuradio_swig_python.Td gnuradio_swig_python.d; fi \
90         else rm -f gnuradio_swig_python.Td; exit 1; fi 
91
92
93 gnuradio_swig_bug_workaround.h : gnuradio_swig_python.cc $(srcdir)/gen-swig-bug-fix
94         $(PYTHON) $(srcdir)/gen-swig-bug-fix gnuradio_swig_python.cc $@
95
96
97 # ----------------------------------------------------------------
98
99 # Don't distribute output of swig
100 dist-hook:
101         @for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done
102         @for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done
103
104
105 grinclude_HEADERS =                             \
106         gnuradio_swig_bug_workaround.h
107
108 swiginclude_HEADERS =                           \
109         $(LOCAL_IFILES)                 
110
111 MOSTLYCLEANFILES = \
112         $(BUILT_SOURCES) *~ *.pyc 
113
114 DISTCLEANFILES = gnuradio_swig_python.d