Build/packaging work for the bladeRF
This commit is contained in:
parent
0a6dc372ad
commit
7700cd90d3
40
Makefile
40
Makefile
|
@ -1,13 +1,11 @@
|
||||||
PROGNAME=dump1090
|
PROGNAME=dump1090
|
||||||
|
|
||||||
|
RTLSDR ?= yes
|
||||||
|
BLADERF ?= yes
|
||||||
|
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CPPFLAGS += -DMODES_DUMP1090_VERSION=\"$(DUMP1090_VERSION)\" -DMODES_DUMP1090_VARIANT=\"dump1090-fa\"
|
CPPFLAGS += -DMODES_DUMP1090_VERSION=\"$(DUMP1090_VERSION)\" -DMODES_DUMP1090_VARIANT=\"dump1090-fa\"
|
||||||
|
|
||||||
ifneq ($(RTLSDR_PREFIX),"")
|
|
||||||
CPPFLAGS += -I$(RTLSDR_PREFIX)/include
|
|
||||||
LDFLAGS += -L$(RTLSDR_PREFIX)/lib
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(HTMLPATH),"")
|
ifneq ($(HTMLPATH),"")
|
||||||
CPPFLAGS += -DHTMLPATH=\"$(HTMLPATH)\"
|
CPPFLAGS += -DHTMLPATH=\"$(HTMLPATH)\"
|
||||||
endif
|
endif
|
||||||
|
@ -16,21 +14,39 @@ DIALECT = -std=c11
|
||||||
CFLAGS += $(DIALECT) -O2 -g -Wall -Werror -W -D_DEFAULT_SOURCE
|
CFLAGS += $(DIALECT) -O2 -g -Wall -Werror -W -D_DEFAULT_SOURCE
|
||||||
LIBS = -lpthread -lm -lrt
|
LIBS = -lpthread -lm -lrt
|
||||||
|
|
||||||
ifeq ($(STATIC), yes)
|
ifeq ($(RTLSDR), yes)
|
||||||
LIBS_RTLSDR = -Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic -lusb-1.0
|
SDR_OBJ += sdr_rtlsdr.o
|
||||||
else
|
CPPFLAGS += -DENABLE_RTLSDR
|
||||||
LIBS_RTLSDR = -lrtlsdr -lusb-1.0
|
|
||||||
|
ifdef RTLSDR_PREFIX
|
||||||
|
CPPFLAGS += -I$(RTLSDR_PREFIX)/include
|
||||||
|
LDFLAGS += -L$(RTLSDR_PREFIX)/lib
|
||||||
|
else
|
||||||
|
CFLAGS += $(shell pkg-config --cflags librtlsdr)
|
||||||
|
LDFLAGS += $(shell pkg-config --libs-only-L librtlsdr)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(STATIC), yes)
|
||||||
|
LIBS_SDR += -Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic -lusb-1.0
|
||||||
|
else
|
||||||
|
LIBS_SDR += -lrtlsdr -lusb-1.0
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LIBS_RTLSDR += -lbladeRF
|
ifeq ($(BLADERF), yes)
|
||||||
|
SDR_OBJ += sdr_bladerf.o
|
||||||
|
CPPFLAGS += -DENABLE_BLADERF
|
||||||
|
CFLAGS += $(shell pkg-config --cflags libbladeRF)
|
||||||
|
LIBS_SDR += $(shell pkg-config --libs libbladeRF)
|
||||||
|
endif
|
||||||
|
|
||||||
all: dump1090 view1090
|
all: dump1090 view1090
|
||||||
|
|
||||||
%.o: %.c *.h
|
%.o: %.c *.h
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o sdr_ifile.o sdr_rtlsdr.o sdr_bladerf.o sdr.o $(COMPAT)
|
dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o sdr_ifile.o sdr.o $(SDR_OBJ) $(COMPAT)
|
||||||
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_RTLSDR) -lncurses
|
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_SDR) -lncurses
|
||||||
|
|
||||||
view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o $(COMPAT)
|
view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o $(COMPAT)
|
||||||
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) -lncurses
|
$(CC) -g -o $@ $^ $(LDFLAGS) $(LIBS) -lncurses
|
||||||
|
|
|
@ -22,7 +22,7 @@ install_rtlsdr:
|
||||||
cd rtl-sdr-build && cmake ../rtl-sdr -DCMAKE_INSTALL_PREFIX=./install && make install
|
cd rtl-sdr-build && cmake ../rtl-sdr -DCMAKE_INSTALL_PREFIX=./install && make install
|
||||||
|
|
||||||
override_dh_auto_build: install_rtlsdr
|
override_dh_auto_build: install_rtlsdr
|
||||||
dh_auto_build -- DIALECT=-std=gnu1x HTMLPATH=/usr/share/$(SRCNAME)/html DUMP1090_VERSION=$(DUMP1090_VERSION) STATIC=yes RTLSDR_PREFIX=rtl-sdr-build/install
|
dh_auto_build -- RTLSDR=yes BLADERF=no DIALECT=-std=gnu1x HTMLPATH=/usr/share/$(SRCNAME)/html DUMP1090_VERSION=$(DUMP1090_VERSION) STATIC=yes RTLSDR_PREFIX=rtl-sdr-build/install
|
||||||
|
|
||||||
override_dh_auto_test:
|
override_dh_auto_test:
|
||||||
dh_auto_test -- DIALECT=-std=gnu1x
|
dh_auto_test -- DIALECT=-std=gnu1x
|
||||||
|
|
4
debian/control
vendored
4
debian/control
vendored
|
@ -2,7 +2,7 @@ Source: dump1090-fa
|
||||||
Section: embedded
|
Section: embedded
|
||||||
Priority: extra
|
Priority: extra
|
||||||
Maintainer: Oliver Jowett <oliver@mutability.co.uk>
|
Maintainer: Oliver Jowett <oliver@mutability.co.uk>
|
||||||
Build-Depends: debhelper(>=9), librtlsdr-dev, libusb-1.0-0-dev, pkg-config, dh-systemd, libncurses5-dev
|
Build-Depends: debhelper(>=9), librtlsdr-dev, libusb-1.0-0-dev, pkg-config, dh-systemd, libncurses5-dev, libbladerf-dev
|
||||||
Standards-Version: 3.9.3
|
Standards-Version: 3.9.3
|
||||||
Homepage: https://github.com/mutability/dump1090
|
Homepage: https://github.com/mutability/dump1090
|
||||||
Vcs-Git: https://github.com/mutability/dump1090.git
|
Vcs-Git: https://github.com/mutability/dump1090.git
|
||||||
|
@ -19,7 +19,7 @@ Description: transitional dummy package for dump1090
|
||||||
|
|
||||||
Package: dump1090-fa
|
Package: dump1090-fa
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser, lighttpd
|
Depends: ${shlibs:Depends}, ${misc:Depends}, libbladerf1(>=2016.06), libbladerf-udev, adduser, lighttpd
|
||||||
Replaces: dump1090 (<< 3.0)
|
Replaces: dump1090 (<< 3.0)
|
||||||
Breaks: dump1090 (<< 3.0)
|
Breaks: dump1090 (<< 3.0)
|
||||||
Description: ADS-B Ground Station System for RTL-SDR
|
Description: ADS-B Ground Station System for RTL-SDR
|
||||||
|
|
3
debian/dump1090-fa.postinst
vendored
3
debian/dump1090-fa.postinst
vendored
|
@ -31,6 +31,9 @@ case "$1" in
|
||||||
adduser --system --home /usr/share/$NAME --no-create-home --quiet "$RUNAS"
|
adduser --system --home /usr/share/$NAME --no-create-home --quiet "$RUNAS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# plugdev required for bladeRF USB access
|
||||||
|
adduser "$RUNAS" plugdev
|
||||||
|
|
||||||
# set up lighttpd
|
# set up lighttpd
|
||||||
echo "Enabling lighttpd integration.." >&2
|
echo "Enabling lighttpd integration.." >&2
|
||||||
lighty-enable-mod dump1090-fa || true
|
lighty-enable-mod dump1090-fa || true
|
||||||
|
|
2
debian/rules
vendored
2
debian/rules
vendored
|
@ -20,7 +20,7 @@ ifeq ($(DEB_HOST_ARCH),armhf)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
override_dh_auto_build:
|
override_dh_auto_build:
|
||||||
dh_auto_build -- HTMLPATH=/usr/share/$(DEB_SOURCE)/html DUMP1090_VERSION=$(DEB_VERSION) RTLSDR_PREFIX=/usr
|
dh_auto_build -- RTLSDR=yes BLADERF=yes HTMLPATH=/usr/share/$(DEB_SOURCE)/html DUMP1090_VERSION=$(DEB_VERSION)
|
||||||
|
|
||||||
override_dh_install:
|
override_dh_install:
|
||||||
dh_install
|
dh_install
|
||||||
|
|
Loading…
Reference in a new issue