da626d594b59041776756e14b708f296f1913f12
[debian/gnuradio] / gr-usrp2 / src / 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 # ----------------------------------------------------------------------
25 # C++ block API interface librar(ies)
26 #
27 # libgr-usrp.so
28 # ----------------------------------------------------------------------
29 AM_CPPFLAGS = \
30         $(STD_DEFINES_AND_INCLUDES)  \
31         $(GRUEL_INCLUDES) \
32         $(PYTHON_CPPFLAGS) \
33         $(USRP2_INCLUDES) \
34         $(WITH_INCLUDES)
35
36 lib_LTLIBRARIES = libgr-usrp2.la
37
38 libgr_usrp2_la_SOURCES = \
39         rx_16sc_handler.cc \
40         rx_32fc_handler.cc \
41         usrp2_source_base.cc \
42         usrp2_source_16sc.cc \
43         usrp2_source_32fc.cc
44 #       usrp2_source_16sc.cc
45 #       usrp2_sink_base.cc
46 #       usrp2_sink_32fc.cc
47 #       usrp2_sink_16sc.cc
48
49 libgr_usrp2_la_LIBADD = \
50         $(USRP2_LA) \
51         $(GNURADIO_CORE_LA) 
52
53 grinclude_HEADERS = \
54         usrp2_source_base.h \
55         usrp2_source_32fc.h \
56         usrp2_source_16sc.h
57 #       usrp2_sink_base.h \
58 #       usrp2_sink_32fc.h \
59 #       usrp2_sink_16sc.h
60
61 noinst_HEADERS = \
62         rx_16sc_handler.h \
63         rx_32fc_handler.h
64
65 # ----------------------------------------------------------------------
66 # Python SWIG wrapper around C++ library
67 #
68 # usrp2.py
69 # _usrp2.so
70 # ----------------------------------------------------------------------
71
72 # Python installation locations
73 ourpythondir = $(grpythondir)
74 ourlibdir    = $(grpyexecdir)
75
76 # SWIG interface files
77 LOCAL_IFILES = $(srcdir)/usrp2.i
78 NON_LOCAL_IFILES = $(GNURADIO_I)
79 ALL_IFILES = $(LOCAL_IFILES) $(NON_LOCAL_IFILES)                
80
81 # Install the SWIG interface files
82 swiginclude_HEADERS = $(LOCAL_IFILES)
83
84 # Generated by SWIG wrapper generator
85 BUILT_SOURCES = usrp2.cc usrp2.py                       
86
87 # Install the SWIG python output
88 ourpython_PYTHON = usrp2.py
89
90 # Arguments to the swig wrapper generator
91 SWIGPYTHONARGS = \
92         $(STD_DEFINES_AND_INCLUDES) \
93         $(SWIGPYTHONFLAGS) \
94         $(USRP2_INCLUDES) \
95         $(WITH_INCLUDES) \
96         $(WITH_SWIG_INCLUDES)
97
98 # Invoke SWIG wrapper generator
99 usrp2.cc usrp2.py: $(ALL_IFILES)
100         $(SWIG) $(SWIGPYTHONARGS) -module usrp2 -o usrp2.cc $(LOCAL_IFILES)
101
102 # Create the Python shared library
103 ourlib_LTLIBRARIES = _usrp2.la
104 _usrp2_la_SOURCES = usrp2.cc
105 _usrp2_la_CXXFLAGS = @swig_CXXFLAGS@
106 _usrp2_la_LDFLAGS = $(swig_CXXFLAGS) $(NO_UNDEFINED) -module -avoid-version
107
108 # Link the library as needed
109 _usrp2_la_LIBADD = \
110         $(PYTHON_LDFLAGS) \
111         libgr-usrp2.la \
112         $(GNURADIO_CORE_LA) \
113         $(USRP2_LIBS) \
114         -lstdc++
115
116 # Don't distribute output of swig
117 dist-hook:
118         @for file in $(BUILT_SOURCES); do echo $(RM) $(distdir)/$$file; done
119         @for file in $(BUILT_SOURCES); do $(RM) $(distdir)/$$file; done
120
121 # ----------------------------------------------------------------------
122 # Local Python files, not installed
123 #
124 # qa_usrp2.py
125 # ----------------------------------------------------------------------
126
127 noinst_PYTHON = qa_usrp2.py                     
128
129
130 # ----------------------------------------------------------------------
131 # Miscellaneous build operations
132 # ----------------------------------------------------------------------
133
134 EXTRA_DIST = run_tests.in
135 TESTS = run_tests
136 MOSTLYCLEANFILES = $(BUILT_SOURCES) *.pyc