Moved to single generated fusb.h, headers now generated out of lib directory
[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)
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         fusb.h.in                       \
49         usrp_prims.h.in                 \
50         usrp_basic.h.in 
51
52 BUILT_SOURCES =                         \
53         $(abs_top_builddir)/usrp/host/include/usrp/usrp_dbid.h  \
54         fusb.h                                                  \
55         usrp_prims.h                                            \
56         usrp_basic.h
57
58 BUILT_SOURCES += usrp_dbid.cc \
59                  usrp_dbid.py
60
61 # ----------------------------------------------------------------
62 # FUSB_TECH is set at configure time by way of
63 #   usrp/config/usrp_fusb_tech.m4.
64 #   It indicates which fast usb strategy we should be building.
65 #   We currently implement "generic", "darwin", "win32" and "linux"
66
67
68 generic_CODE =                          \
69         fusb_generic.cc                 \
70         fusb_sysconfig_generic.cc       \
71         usrp_prims_libusb0.cc           \
72         usrp_basic_libusb0.cc
73
74 darwin_CODE =                           \
75         fusb_darwin.cc                  \
76         fusb_sysconfig_darwin.cc        \
77         README_OSX                      \
78         circular_buffer.h               \
79         circular_linked_list.h          \
80         darwin_libusb.h                 \
81         mld_threads.h                   
82
83 win32_CODE =                            \
84         fusb_win32.cc                   \
85         fusb_sysconfig_win32.cc         \
86         usrp_prims_libusb0.cc           \
87         usrp_basic_libusb0.cc
88
89
90 linux_CODE =                            \
91         fusb_linux.cc                   \
92         fusb_sysconfig_linux.cc         \
93         usrp_prims_libusb0.cc           \
94         usrp_basic_libusb0.cc
95
96 ra_wb_CODE =                            \
97         fusb_ra_wb.cc                   \
98         fusb_sysconfig_ra_wb.cc         \
99         usrp_prims_libusb0.cc           \
100         usrp_basic_libusb0.cc
101
102 libusb1_CODE =                          \
103         fusb_libusb1.cc                 \
104         fusb_sysconfig_libusb1.cc       \
105         usrp_prims_libusb1.cc           \
106         usrp_basic_libusb1.cc
107
108 #
109 # include each <foo>_CODE entry here...
110 #
111 EXTRA_libusrp_la_SOURCES =              \
112         $(generic_CODE)                 \
113         $(darwin_CODE)                  \
114         $(win32_CODE)                   \
115         $(linux_CODE)                   \
116         $(ra_wb_CODE)                   \
117         $(libusb1_CODE)
118
119 # work around automake deficiency
120 libusrp_la_common_SOURCES =             \
121         fusb.cc                         \
122         md5.c                           \
123         usrp_basic_common.cc            \
124         usrp_config.cc                  \
125         usrp_dbid.cc                    \
126         usrp_local_sighandler.cc        \
127         usrp_prims_common.cc            \
128         usrp_standard.cc                \
129         db_boards.cc                    \
130         db_base.cc                      \
131         db_basic.cc                     \
132         db_tv_rx.cc                     \
133         db_tv_rx_mimo.cc                \
134         db_flexrf.cc                    \
135         db_flexrf_mimo.cc               \
136         db_dbs_rx.cc                    \
137         db_xcvr2450.cc                  \
138         db_dtt754.cc                    \
139         db_dtt768.cc                    \
140         db_util.cc
141
142 if FUSB_TECH_generic
143 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(generic_CODE)
144 endif
145
146 if FUSB_TECH_darwin
147 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(darwin_CODE)
148 endif
149
150 if FUSB_TECH_win32
151 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(win32_CODE)
152 endif
153
154 if FUSB_TECH_linux
155 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(linux_CODE)
156 endif
157
158 if FUSB_TECH_ra_wb
159 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(ra_wb_CODE)
160 endif
161
162 if FUSB_TECH_libusb1
163 libusrp_la_SOURCES = $(libusrp_la_common_SOURCES) $(libusb1_CODE)
164 endif
165
166
167 noinst_HEADERS =                        \
168         ad9862.h                        \
169         db_base_impl.h                  \
170         db_boards.h                     \
171         db_util.h                       \
172         fusb.h                          \
173         fusb_darwin.h                   \
174         fusb_generic.h                  \
175         fusb_linux.h                    \
176         fusb_libusb1.h                  \
177         fusb_ra_wb.h                    \
178         fusb_win32.h                    \
179         md5.h                           \
180         rate_to_regval.h                \
181         usrp_config.h
182
183 if PYTHON
184 usrppython_PYTHON =                     \
185         usrp_dbid.py                    
186
187 noinst_PYTHON =                         \
188         gen_usrp_dbid.py                \
189         check_data.py                   \
190         dump_data.py
191 endif
192
193 # common way for generating sources from templates when using
194 # BUILT_SOURCES, using parallel build protection.
195 gen_sources = $(BUILT_SOURCES)
196 gen_sources_deps = gen_usrp_dbid.py usrp_dbid.dat
197 par_gen_command = PYTHONPATH=$(top_srcdir)/usrp/src srcdir=$(srcdir) $(PYTHON) $(srcdir)/gen_usrp_dbid.py $(srcdir)/usrp_dbid.dat
198 include $(top_srcdir)/Makefile.par.gen
199
200
201 # Generate libusb dependent header files from configure.
202 # These are already defined, but override them here, which throws warnings.
203 # Need to figure out how to separate rules for BUILD_SOURCES.
204 fusb.h: fusb.h.in $(top_srcdir)/config.status
205         cd $(top_srcdir) \
206           && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=fusb.h \
207         $(SHELL) ./config.status
208
209 usrp_prims.h: usrp_prims.h.in $(top_srcdir)/config.status
210         cd $(top_srcdir) \
211           && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=usrp_prims.h \
212         $(SHELL) ./config.status
213
214 usrp_basic.h: usrp_basic.h.in $(top_srcdir)/config.status
215         cd $(top_srcdir) \
216           && CONFIG_FILES= CONFIG_HEADERS= CONFIG_OTHER=usrp_basic.h \
217         $(SHELL) ./config.status
218