Merge branch 'master' into sync
[debian/gnuradio] / usrp / host / lib / Makefile.am
1 #
2 #  USRP - Universal Software Radio Peripheral
3
4 #  Copyright (C) 2003,2004,2006,2007,2008,2009 Free Software Foundation, Inc.
5
6 #  This program 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 of the License, or
9 #  (at your option) any later version.
10
11 #  This program 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 this program; if not, write to the Free Software
18 #  Foundation, Inc., 51 Franklin Street, Boston, MA  02110-1301  USA
19
20
21 include $(top_srcdir)/Makefile.common
22
23 common_INCLUDES = $(USRP_INCLUDES) $(USB_INCLUDES)
24
25 lib_LTLIBRARIES = libusrp.la
26
27 libusrp_la_common_LDFLAGS = $(NO_UNDEFINED) -version-info 0:0:0 $(BOOST_LDFLAGS)
28
29 libusrp_la_common_LIBADD =              \
30         $(USB_LIBS)                     \
31         $(BOOST_THREAD_LIB)             \
32         ../misc/libmisc.la
33
34 # darwin fusb requires omnithreads
35 if FUSB_TECH_darwin
36 AM_CPPFLAGS = $(common_INCLUDES) $(OMNITHREAD_INCLUDES) $(BOOST_CPPFLAGS) $(WITH_INCLUDES)
37 libusrp_la_LIBADD = $(libusrp_la_common_LIBADD) $(OMNITHREAD_LA)
38 libusrp_la_LDFLAGS = $(libusrp_la_common_LDFLAGS) -framework CoreFoundation
39 else
40 AM_CPPFLAGS = $(common_INCLUDES) $(BOOST_CPPFLAGS) $(WITH_INCLUDES)
41 libusrp_la_LIBADD = $(libusrp_la_common_LIBADD)
42 libusrp_la_LDFLAGS = $(libusrp_la_common_LDFLAGS)
43 endif
44
45 EXTRA_DIST =                            \
46         std_paths.h.in                  \
47         usrp_dbid.dat
48
49 BUILT_SOURCES = $(abs_top_builddir)/usrp/host/include/usrp/usrp_dbid.h
50
51 BUILT_SOURCES += usrp_dbid.cc \
52                  usrp_dbid.py
53
54 # ----------------------------------------------------------------
55 # FUSB_TECH is set at configure time by way of
56 #   usrp/config/usrp_fusb_tech.m4.
57 #   It indicates which fast usb strategy we should be building.
58 #   We currently implement "generic", "darwin", "win32" and "linux"
59
60
61 generic_CODE =                          \
62         fusb_generic.cc                 \
63         fusb_sysconfig_generic.cc       \
64         usrp_prims_libusb0.cc           \
65         usrp_basic_libusb0.cc
66
67 darwin_CODE =                           \
68         fusb_darwin.cc                  \
69         fusb_sysconfig_darwin.cc        \
70         README_OSX                      \
71         circular_buffer.h               \
72         circular_linked_list.h          \
73         darwin_libusb.h                 \
74         mld_threads.h                   \
75         usrp_prims_libusb0.cc           \
76         usrp_basic_libusb0.cc
77
78
79 win32_CODE =                            \
80         fusb_win32.cc                   \
81         fusb_sysconfig_win32.cc         \
82         usrp_prims_libusb0.cc           \
83         usrp_basic_libusb0.cc
84
85
86 linux_CODE =                            \
87         fusb_linux.cc                   \
88         fusb_sysconfig_linux.cc         \
89         usrp_prims_libusb0.cc           \
90         usrp_basic_libusb0.cc
91
92 ra_wb_CODE =                            \
93         fusb_ra_wb.cc                   \
94         fusb_sysconfig_ra_wb.cc         \
95         usrp_prims_libusb0.cc           \
96         usrp_basic_libusb0.cc
97
98 libusb1_CODE =                          \
99         fusb_libusb1.cc                 \
100         fusb_sysconfig_libusb1.cc       \
101         usrp_prims_libusb1.cc           \
102         usrp_basic_libusb1.cc
103
104 #
105 # include each <foo>_CODE entry here...
106 #
107 EXTRA_libusrp_la_SOURCES =              \
108         $(generic_CODE)                 \
109         $(darwin_CODE)                  \
110         $(win32_CODE)                   \
111         $(linux_CODE)                   \
112         $(ra_wb_CODE)                   \
113         $(libusb1_CODE)
114
115 # work around automake deficiency
116 libusrp_la_common_SOURCES =             \
117         fusb.cc                         \
118         md5.c                           \
119         usrp_basic_common.cc            \
120         usrp_config.cc                  \
121         usrp_dbid.cc                    \
122         usrp_local_sighandler.cc        \
123         usrp_prims_common.cc            \
124         usrp_standard.cc                \
125         db_boards.cc                    \
126         db_base.cc                      \
127         db_basic.cc                     \
128         db_tv_rx.cc                     \
129         db_tv_rx_mimo.cc                \
130         db_flexrf.cc                    \
131         db_flexrf_mimo.cc               \
132         db_dbs_rx.cc                    \
133         db_xcvr2450.cc                  \
134         db_dtt754.cc                    \
135         db_dtt768.cc                    \
136         db_util.cc
137
138 if FUSB_TECH_generic
139 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(generic_CODE)
140 endif
141
142 if FUSB_TECH_darwin
143 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(darwin_CODE)
144 endif
145
146 if FUSB_TECH_win32
147 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(win32_CODE)
148 endif
149
150 if FUSB_TECH_linux
151 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(linux_CODE)
152 endif
153
154 if FUSB_TECH_ra_wb
155 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(ra_wb_CODE)
156 endif
157
158 if FUSB_TECH_libusb1
159 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(libusb1_CODE)
160 endif
161
162
163 noinst_HEADERS =                        \
164         ad9862.h                        \
165         db_base_impl.h                  \
166         db_boards.h                     \
167         db_util.h                       \
168         fusb.h                          \
169         fusb_darwin.h                   \
170         fusb_generic.h                  \
171         fusb_linux.h                    \
172         fusb_libusb1.h                  \
173         fusb_ra_wb.h                    \
174         fusb_win32.h                    \
175         md5.h                           \
176         rate_to_regval.h                \
177         usrp_config.h                   \
178         usrp_primsi.h
179
180 if PYTHON
181 usrppython_PYTHON =                     \
182         usrp_dbid.py                    
183
184 noinst_PYTHON =                         \
185         gen_usrp_dbid.py                \
186         check_data.py                   \
187         dump_data.py
188 endif
189
190 # common way for generating sources from templates when using
191 # BUILT_SOURCES, using parallel build protection.
192 gen_sources = $(BUILT_SOURCES)
193 gen_sources_deps = gen_usrp_dbid.py usrp_dbid.dat
194 par_gen_command = PYTHONPATH=$(top_srcdir)/usrp/src srcdir=$(srcdir) $(PYTHON) $(srcdir)/gen_usrp_dbid.py $(srcdir)/usrp_dbid.dat
195 include $(top_srcdir)/Makefile.par.gen