-
Notifications
You must be signed in to change notification settings - Fork 26
/
makefile.in
248 lines (208 loc) · 6.38 KB
/
makefile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# Copyright (c) 2009, 2010, 2011, 2013 Joseph Gaeddert
# Copyright (c) 2009, 2010, 2011, 2013 Virginia Polytechnic
# Institute & State University
#
# This file is part of liquid.
#
# liquid is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# liquid is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with liquid. If not, see <http://www.gnu.org/licenses/>.
#
# Makefile for liquid SDR libraries, USRP applications
#
# Targets:
# all : build library and all example programs
# install : install the dynamic shared library object and
# header file(s)
# uninstall : uninstall the library and header file(s)
# clean : clean all targets (bench, check, examples, etc)
# examples : build all examples
# help : print list of makefile targets to stdout
#
# paths
srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
VPATH = @srcdir@
include_dirs := . include
vpath %.h $(include_dirs)
# programs
CC := @CC@
CXX := @CXX@
MV := mv -f
RM := rm -f
SED := sed
GREP := @GREP@
AR := ar
RANLIB := ranlib
# temporary placeholder for 'all' target (later overwritten)
all:
##
## TARGET : help - print list of makefile targets
##
# look for all occurences of '## TARGET : ' and print rest of line to screen
help:
@echo "Targets for liquid-usrp makefile:"
@$(GREP) -E "^## TARGET : " [Mm]akefile | $(SED) 's/## TARGET : / /'
# flags
INCLUDE_CFLAGS = -I./ -I./include/
CFLAGS += $(INCLUDE_CFLAGS) -g -O2 -Wall -fPIC
CPPFLAGS += $(INCLUDE_CFLAGS) -g -O2 -Wall -fPIC
LDFLAGS += @LIBS@
ARFLAGS = r
#
# liquid headers
#
headers_install := ofdmtxrx.h
headers := $(headers_install)
include_headers := $(addprefix include/,$(headers))
# library source files
library_src := \
lib/multichannelrx.cc \
lib/multichanneltx.cc \
lib/multichanneltxrx.cc \
lib/ofdmtxrx.cc \
lib/timer.cc \
# library header files
library_headers := \
include/multichannelrx.h \
include/multichanneltx.h \
include/multichanneltxrx.h \
include/ofdmtxrx.h \
include/timer.h \
# example programs
example_src := \
src/asgram_rx.cc \
src/flexframe_tx.cc \
src/flexframe_rx.cc \
src/fullduplex_txrx.cc \
src/gmskframe_tx.cc \
src/gmskframe_rx.cc \
src/halfduplex_txrx.cc \
src/multichannel_rx.cc \
src/multichannel_tx.cc \
src/multichannel_txrx.cc \
src/narrowband_tx.cc \
src/ofdmflexframe_rx.cc \
src/ofdmflexframe_tx.cc \
src/packet_rx.cc \
src/packet_tx.cc \
src/rssi.cc \
# src/wlanframe_tx.cc
# src/crdemo.cc
# src/usrp_init_test.cc
# src/usrp_io_test.cc
# src/fmtx.cc
# src/framestats_rx.cc
# src/framestats_tx.cc
# src/gmsk_rx.cc
# src/gmsk_tx.cc
# src/jammer.cc
# src/tx_rrc.cc
# src/ofdmoqamframe_tx.cc
# src/ofdmoqamframe_rx.cc
# src/packetstream_rx.cc
# src/packetstream_tx.cc
# src/usrp_rx_gain_correction_test.cc
# src/dsa_ofdmoqam.cc
# src/firpfbch_tx.cc
# src/tx_ofdmoqam.cc
# src/cr.cc
# src/test_usrp_standard_tx.cc
# src/gr_usrp_rx_test.cc
# src/ofdmoqamframe64_tx.cc
# src/ofdmoqamframe64_rx.cc
# src/gr_usrp_tx_test.cc
# src/ofdm_rx.cc
# src/ofdm_tx.cc
##
## TARGET : all - build shared library and examples (default)
##
all : libraries examples
library_objs = $(patsubst %.cc,%.o,$(library_src))
$(library_objs) : %.o : %.cc $(library_headers)
# Shared library
SHARED_LIB = @SH_LIB@
.PHONY: libraries
libraries: libliquidusrp.a $(SHARED_LIB)
# liquid library definition
# TODO: link from module libraries, not object files (for compactness)
libliquidusrp.a: $(library_objs)
$(AR) $(ARFLAGS) $@ $^
$(RANLIB) $@
# darwin
#
# gcc -dynamiclib -install_name libliquidusrp.dylib -o libliquidusrp.dylib libmodem.a libutility.a
libliquidusrp.dylib: $(library_objs)
$(CXX) -dynamiclib -install_name $@ -o $@ $^ $(LDFLAGS)
# linux, et al
libliquidusrp.so: $(library_objs)
$(CXX) -shared -Xlinker -soname=$@ -o $@ -Wl,-whole-archive $^ -Wl,-no-whole-archive $(LDFLAGS)
##
## TARGET : install - installs the libraries and header files in the host system
##
install:
@echo "installing..."
mkdir -p $(DESTDIR)$(exec_prefix)/lib
install -m 644 -p $(SHARED_LIB) libliquidusrp.a $(DESTDIR)$(exec_prefix)/lib
mkdir -p $(DESTDIR)$(prefix)/include
mkdir -p $(DESTDIR)$(prefix)/include/liquid
install -m 644 -p $(addprefix include/,$(headers_install)) $(DESTDIR)$(prefix)/include/liquid
@echo ""
@echo "---------------------------------------------------------"
@echo " liquid-usrp was successfully installed. "
@echo ""
@echo " On some machines (e.g. Linux) you should rebind your"
@echo " libraries by running 'ldconfig' to make the shared"
@echo " object available. You might also need to modify your"
@echo " LD_LIBRARY_PATH environment variable to include the"
@echo " directory $(DESTDIR)$(exec_prefix)"
@echo "---------------------------------------------------------"
@echo ""
##
## TARGET : uninstall - uninstalls the libraries and header files in the host system
##
uninstall:
@echo "uninstalling..."
$(RM) $(addprefix $(DESTDIR)$(prefix)/include/liquid/, $(headers_install))
$(RM) $(DESTDIR)$(exec_prefix)/lib/libliquidusrp.a
$(RM) $(DESTDIR)$(exec_prefix)/lib/$(SHARED_LIB)
@echo "done."
##
## TARGET : examples - build all examples binaries
##
example_objs = $(patsubst %.cc,%.o,$(example_src))
example_progs = $(patsubst %.cc,%, $(example_src))
$(example_objs) : %.o : %.cc
$(CXX) $(CPPFLAGS) -c $< -o $@
$(example_progs) : % : %.o libliquidusrp.a
$(CXX) $(CPPFLAGS) $^ -o $@ $(LDFLAGS)
examples: $(example_progs)
clean-examples:
$(RM) $(example_objs)
$(RM) $(example_progs)
##
## TARGET : clean - clean build (objects, dependencies, libraries, etc.)
##
clean: clean-examples
$(RM) $(library_objs)
$(RM) libliquidusrp.a
$(RM) $(SHARED_LIB)
##
## TARGET : distclean - clean everything but the originally-distributed files
##
distclean: clean
@echo "cleaning distribution..."
$(RM) octave-core *.m
$(RM) configure config.h config.h.in config.h.in~ config.log config.status
$(RM) -r autom4te.cache
$(RM) makefile