Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
249 lines (208 sloc) 6.38 KB
# 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
Something went wrong with that request. Please try again.