Updated gr-howto-write-a-block; mostly the .m4 macros and configure.ac.
[debian/gnuradio] / gr-howto-write-a-block / src / lib / Makefile.am
1 #
2 # Copyright 2004,2005,2006,2008 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.howto 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)
32
33 SWIGPYTHONARGS = $(SWIGPYTHONFLAGS) $(SWIGGRFLAGS)
34
35 ALL_IFILES =                            \
36         $(LOCAL_IFILES)                 \
37         $(NON_LOCAL_IFILES)             
38
39 NON_LOCAL_IFILES =                      \
40         $(GNURADIO_CORE_INCLUDEDIR)/swig/gnuradio.i
41
42
43 LOCAL_IFILES =                          \
44         $(top_srcdir)/src/lib/howto.i                           
45
46 # These files are built by SWIG.  The first is the C++ glue.
47 # The second is the python wrapper that loads the _howto shared library
48 # and knows how to call our extensions.
49
50 BUILT_SOURCES =                         \
51         howto.cc                        \
52         howto.py                                
53
54 # This gets howto.py installed in the right place
55 ourpython_PYTHON =                      \
56         howto.py
57
58 ourlib_LTLIBRARIES = _howto.la
59
60 # These are the source files that go into the shared library
61 _howto_la_SOURCES =                     \
62         howto.cc                        \
63         howto_square_ff.cc              \
64         howto_square2_ff.cc             
65
66 # magic flags
67 _howto_la_LDFLAGS = $(NO_UNDEFINED) -module -avoid-version
68
69 # link the library against some comon swig runtime code and the 
70 # c++ standard library
71 _howto_la_LIBADD =                      \
72         $(PYTHON_LDFLAGS)               \
73         -lstdc++                        
74
75 howto.cc howto.py: $(LOCAL_IFILES) $(ALL_IFILES)
76         $(SWIG) $(SWIGPYTHONARGS) -module howto -o howto.cc $(LOCAL_IFILES)
77
78 # These headers get installed in ${prefix}/include/gnuradio
79 grinclude_HEADERS =                     \
80         howto_square_ff.h               \
81         howto_square2_ff.h              
82
83
84 # These swig headers get installed in ${prefix}/include/gnuradio/swig
85 swiginclude_HEADERS =                   \
86         $(LOCAL_IFILES)
87
88
89 MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc
90
91 # Don't distribute output of swig
92 dist-hook:
93         @for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done
94         @for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done