Merged r10288:10370 from michaelld/swigpythonargs into trunk. Passes distcheck.
[debian/gnuradio] / gr-radio-astronomy / src / lib / Makefile.am
1 #
2 # Copyright 2004,2005,2006,2008,2009 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 3, 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 so that it ends up as the gnuradio.ra 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 AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) $(WITH_INCLUDES)
32
33 ALL_IFILES =                            \
34         $(LOCAL_IFILES)                 \
35         $(NON_LOCAL_IFILES)             
36
37 NON_LOCAL_IFILES =                      \
38         $(GNURADIO_I)
39
40 LOCAL_IFILES =                          \
41         $(srcdir)/ra.i                          
42
43 # These files are built by SWIG.  The first is the C++ glue.
44 # The second is the python wrapper that loads the _howto shared library
45 # and knows how to call our extensions.
46
47 BUILT_SOURCES =                 \
48         ra.cc                   \
49         ra.py                           
50
51 # This gets ra.py installed in the right place
52 ourpython_PYTHON =                      \
53         ra.py
54
55 ourlib_LTLIBRARIES = _ra.la
56
57 # These are the source files that go into the shared library
58 _ra_la_SOURCES =                \
59         ra.cc                   
60
61 # magic flags
62 _ra_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
63
64 # link the library against some comon swig runtime code and the 
65 # c++ standard library
66 _ra_la_LIBADD =                 \
67         $(PYTHON_LDFLAGS)       \
68         $(GNURADIO_CORE_LA)     \
69         -lstdc++                        
70
71 ra.cc ra.py: $(ALL_IFILES)
72         $(SWIG) $(STD_SWIG_PYTHON_ARGS) -module ra -o ra.cc $(LOCAL_IFILES)
73
74 # These headers get installed in ${prefix}/include/gnuradio
75 grinclude_HEADERS =
76
77 # These swig headers get installed in ${prefix}/include/gnuradio/swig
78 swiginclude_HEADERS =                   \
79         $(LOCAL_IFILES)
80
81
82 MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
83
84 # Don't distribute output of swig
85 dist-hook:
86         @for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done
87         @for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done