More fixes for ticket:35, which was reopened.
[debian/gnuradio] / gr-ezdop / src / lib / Makefile.am
1 #
2 # Copyright 2004,2005,2006 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., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
20
21
22 include $(top_srcdir)/Makefile.common
23
24 # Install this stuff so that it ends up as the gnuradio.ezdop module
25 # This usually ends up at:
26 #   ${prefix}/lib/python${python_version}/site-packages/gnuradio
27
28 ourpythondir = $(grpythondir)
29 ourlibdir    = $(grpyexecdir)
30
31 EZDOP_INCLUDES = \
32     -I$(top_srcdir)/ezdop/src/firmware \
33     -I$(top_srcdir)/ezdop/src/host/ezdop
34
35 EZDOP_LIBS = -L$(top_builddir)/ezdop/src/host/ezdop/ -lezdop
36
37 INCLUDES = \
38     $(STD_DEFINES_AND_INCLUDES) \
39     $(PYTHON_CPPFLAGS) \
40     $(EZDOP_INCLUDES)
41
42 SWIGPYTHONARGS = $(SWIGPYTHONFLAGS) $(STD_DEFINES_AND_INCLUDES)
43
44 ALL_IFILES =                            \
45         $(LOCAL_IFILES)                 \
46         $(NON_LOCAL_IFILES)             
47
48 NON_LOCAL_IFILES =                      \
49         $(GNURADIO_I)
50
51
52 LOCAL_IFILES =                          \
53         $(top_srcdir)/gr-ezdop/src/lib/ezdop.i                          
54
55 # These files are built by SWIG.  The first is the C++ glue.
56 # The second is the python wrapper that loads the _ezdop shared library
57 # and knows how to call our extensions.
58
59 BUILT_SOURCES =                         \
60         ezdop.cc                        \
61         ezdop.py                                
62
63 # This gets ezdop.py installed in the right place
64 ourpython_PYTHON =                      \
65         ezdop.py
66
67 ourlib_LTLIBRARIES = _ezdop.la
68
69 # These are the source files that go into the shared library
70 _ezdop_la_SOURCES =                     \
71         ezdop.cc                        \
72         ezdop_source_c.cc               
73
74 # magic flags
75 _ezdop_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
76
77 # link the library against some comon swig runtime code and the 
78 # c++ standard library
79 _ezdop_la_LIBADD =                      \
80         $(PYTHON_LDFLAGS)               \
81         $(GNURADIO_CORE_LIBS)           \
82         $(EZDOP_LIBS)                   \
83         -lstdc++                        
84
85 ezdop.cc ezdop.py: $(ALL_IFILES)
86         $(SWIG) $(SWIGPYTHONARGS) -module ezdop -o ezdop.cc $(LOCAL_IFILES)
87
88 # These headers get installed in ${prefix}/include/gnuradio
89 grinclude_HEADERS =                     \
90         ezdop_source_c.h
91
92
93 # These swig headers get installed in ${prefix}/include/gnuradio/swig
94 swiginclude_HEADERS =                   \
95         $(LOCAL_IFILES)
96
97 MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
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