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