2013-05-24 22:24:16 +02:00
|
|
|
#
|
|
|
|
# When building a package or installing otherwise in the system, make
|
|
|
|
# sure that the variable PREFIX is defined, e.g. make PREFIX=/usr/local
|
|
|
|
#
|
|
|
|
PROGNAME=dump1090
|
|
|
|
|
2015-01-22 14:19:15 +01:00
|
|
|
ifndef DUMP1090_VERSION
|
2015-10-27 14:57:29 +01:00
|
|
|
DUMP1090_VERSION=$(shell git describe --tags --match=v*)
|
2015-01-22 14:19:15 +01:00
|
|
|
endif
|
|
|
|
|
2013-05-24 22:24:16 +02:00
|
|
|
ifdef PREFIX
|
|
|
|
BINDIR=$(PREFIX)/bin
|
|
|
|
SHAREDIR=$(PREFIX)/share/$(PROGNAME)
|
|
|
|
EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)\"
|
|
|
|
endif
|
|
|
|
|
2015-01-22 14:19:15 +01:00
|
|
|
CPPFLAGS+=-DMODES_DUMP1090_VERSION=\"$(DUMP1090_VERSION)\"
|
2015-06-26 18:49:21 +02:00
|
|
|
CFLAGS+=-O2 -g -Wall -Werror -W
|
2015-09-03 05:41:00 +02:00
|
|
|
LIBS=-lpthread -lm
|
2016-03-02 18:32:53 +01:00
|
|
|
ifeq ($(STATIC), yes)
|
2016-02-29 15:20:34 +01:00
|
|
|
LIBS_RTL=-Wl,-Bstatic -lrtlsdr -Wl,-Bdynamic -lusb-1.0
|
2016-03-02 18:32:53 +01:00
|
|
|
else
|
|
|
|
LIBS_RTL=-lrtlsdr -lusb-1.0
|
|
|
|
endif
|
2013-01-05 13:52:25 +01:00
|
|
|
CC=gcc
|
2013-05-24 22:24:16 +02:00
|
|
|
|
2015-09-03 05:41:00 +02:00
|
|
|
UNAME := $(shell uname)
|
|
|
|
|
|
|
|
ifeq ($(UNAME), Linux)
|
|
|
|
LIBS+=-lrt
|
|
|
|
endif
|
|
|
|
ifeq ($(UNAME), Darwin)
|
|
|
|
# TODO: Putting GCC in C11 mode breaks things.
|
2016-03-31 19:38:34 +02:00
|
|
|
CFLAGS+=-std=c11 -DMISSING_GETTIME -DMISSING_NANOSLEEP
|
2015-09-07 13:58:49 +02:00
|
|
|
COMPAT+=compat/clock_gettime/clock_gettime.o compat/clock_nanosleep/clock_nanosleep.o
|
2016-03-31 19:25:32 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(UNAME), OpenBSD)
|
2016-03-31 19:38:34 +02:00
|
|
|
CFLAGS+= -DMISSING_NANOSLEEP
|
2016-03-31 19:25:32 +02:00
|
|
|
COMPAT+= compat/clock_nanosleep/clock_nanosleep.o
|
2015-09-03 05:41:00 +02:00
|
|
|
endif
|
|
|
|
|
2013-10-07 11:59:10 +02:00
|
|
|
all: dump1090 view1090
|
2013-01-05 13:52:25 +01:00
|
|
|
|
2015-02-08 18:58:46 +01:00
|
|
|
%.o: %.c *.h
|
2015-01-20 19:41:44 +01:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRACFLAGS) -c $< -o $@
|
2013-01-05 13:52:25 +01:00
|
|
|
|
2015-06-26 18:49:21 +02:00
|
|
|
dump1090.o: CFLAGS += `pkg-config --cflags librtlsdr`
|
|
|
|
|
2015-09-07 13:58:49 +02:00
|
|
|
dump1090: dump1090.o anet.o interactive.o mode_ac.o mode_s.o net_io.o crc.o demod_2000.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o $(COMPAT)
|
2015-01-20 19:41:44 +01:00
|
|
|
$(CC) -g -o $@ $^ $(LIBS) $(LIBS_RTL) $(LDFLAGS)
|
2013-01-05 13:52:25 +01:00
|
|
|
|
2015-09-07 13:58:49 +02:00
|
|
|
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)
|
2015-01-20 19:41:44 +01:00
|
|
|
$(CC) -g -o $@ $^ $(LIBS) $(LDFLAGS)
|
Implement a remote interactive screen
No changes to dump1090, (except the version number)
Include a sample Linux batch start file called dump1090.sh for use when
running dump1090 headless. This file needs to be copied to the
/etc/init.d/ subdirectory on your raspberry pi, and marked as
executable. Then when you re-start your RPi, dump1090 will start-up
auto-magically and run as a sort of server to allow both local and
remote connection to it's various internet ports.
Modified the Makefile to build a new headless helper application called
view1090
Added view1090. This is an executable that allows you to connect to
dump1090 when it is running and 'see' the interactive screen display.
The default is to try and connect to dump1090 on IP address 127.0.0.1
port 30005. This should work if you are running on the same RPi as
dump1090 and using the default dump1090 port settings. However, if
you're running on a different machine you will have to specify the IP
address of the RPi running dump1090 using the --net-bo-ipaddr switch.
Something like "view1090 --net-bo-ipaddr 192.168.2.65" . You may also
have to sudo it, depending on your privilige settings.
I've also compiled view1090 as a Wiin32 exe, so you should be able to
run it under any 32 bit version of Microsoft Windows - i.e. Win95, Win
2K, Win XP, Win 7 etc. It may work on Win 8 and 64 bit Windows, but I
haven't tried it. The Win32 version is compiled from the same source, so
takes all the same command line switches.
2013-09-24 19:37:54 +02:00
|
|
|
|
2015-09-07 13:58:49 +02:00
|
|
|
faup1090: faup1090.o anet.o mode_ac.o mode_s.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o $(COMPAT)
|
2015-06-26 18:54:23 +02:00
|
|
|
$(CC) -g -o $@ $^ $(LIBS) $(LDFLAGS)
|
|
|
|
|
2013-01-05 13:52:25 +01:00
|
|
|
clean:
|
2015-09-03 05:41:00 +02:00
|
|
|
rm -f *.o compat/clock_gettime/*.o compat/clock_nanosleep/*.o dump1090 view1090 faup1090 cprtests crctests
|
2015-01-20 19:41:44 +01:00
|
|
|
|
|
|
|
test: cprtests
|
2015-02-19 13:03:08 +01:00
|
|
|
./cprtests
|
2015-01-20 19:41:44 +01:00
|
|
|
|
|
|
|
cprtests: cpr.o cprtests.o
|
2015-01-21 00:04:05 +01:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRACFLAGS) -g -o $@ $^ -lm
|
|
|
|
|
|
|
|
crctests: crc.c crc.h
|
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRACFLAGS) -g -DCRCDEBUG -o $@ $<
|