From 5fa039a2d4bddbcd430486e1471449956cd05516 Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Fri, 26 Jun 2015 17:49:21 +0100 Subject: [PATCH] Only require librtlsdr headers while we're compiling dump1090, not the other helpers that don't use the dongle. --- Makefile | 4 +++- dump1090.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3106403..bc69f67 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ EXTRACFLAGS=-DHTMLPATH=\"$(SHAREDIR)\" endif CPPFLAGS+=-DMODES_DUMP1090_VERSION=\"$(DUMP1090_VERSION)\" -CFLAGS+=-O2 -g -Wall -Werror -W `pkg-config --cflags librtlsdr` +CFLAGS+=-O2 -g -Wall -Werror -W LIBS=-lpthread -lm -lrt LIBS_RTL=`pkg-config --libs librtlsdr` CC=gcc @@ -25,6 +25,8 @@ all: dump1090 view1090 %.o: %.c *.h $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRACFLAGS) -c $< -o $@ +dump1090.o: CFLAGS += `pkg-config --cflags librtlsdr` + 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 $(CC) -g -o $@ $^ $(LIBS) $(LIBS_RTL) $(LDFLAGS) diff --git a/dump1090.c b/dump1090.c index 781fc2d..756ba7a 100644 --- a/dump1090.c +++ b/dump1090.c @@ -49,6 +49,8 @@ #include "dump1090.h" +#include + #include #include