2015-07-27 00:35:07 +00:00
|
|
|
#
|
|
|
|
# Makefile for Linux version of Dire Wolf.
|
|
|
|
#
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
APPS := direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_packets ttcalc
|
|
|
|
|
|
|
|
all : $(APPS) direwolf.desktop direwolf.conf
|
2015-07-27 01:17:23 +00:00
|
|
|
@echo " "
|
|
|
|
@echo "Next step - install with:"
|
|
|
|
@echo " "
|
|
|
|
@echo " sudo make install"
|
|
|
|
@echo " "
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
CC := gcc
|
|
|
|
CFLAGS := -O3 -pthread -Igeotranz
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
LDFLAGS := -lm -lpthread -lrt
|
|
|
|
|
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The DSP filters spend a lot of time spinning around in little
|
|
|
|
# loops multiplying and adding arrays of numbers. The Intel "SSE"
|
|
|
|
# instructions, introduced in 1999 with the Pentium III series,
|
|
|
|
# can speed this up considerably.
|
2015-07-27 00:35:07 +00:00
|
|
|
#
|
|
|
|
# SSE2 instructions, added in 2000, don't seem to offer any advantage.
|
|
|
|
#
|
|
|
|
#
|
2015-07-27 01:17:23 +00:00
|
|
|
# Let's take a look at the effect of the compile options.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Times are elapsed time to process Track 2 of the TNC test CD.
|
|
|
|
#
|
|
|
|
# i.e. "./atest 02_Track_2.wav"
|
|
|
|
# Default demodulator type is new "E" added for version 1.2.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# ---------- x86 (32 bit) ----------
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# gcc 4.6.3 running on Ubuntu 12.04.05.
|
2015-07-27 00:35:07 +00:00
|
|
|
# Intel(R) Celeron(R) CPU 2.53GHz. Appears to have only 32 bit instructions.
|
2015-07-27 01:17:23 +00:00
|
|
|
# Probably from around 2004 or 2005.
|
|
|
|
#
|
|
|
|
# When gcc is generating code for a 32 bit x86 target, it assumes the ancient
|
|
|
|
# i386 processor. This is good for portability but bad for performance.
|
|
|
|
#
|
|
|
|
# The code can run considerably faster by taking advantage of the SSE instructions
|
|
|
|
# available in the Pentium 3 or later.
|
|
|
|
#
|
|
|
|
# seconds options comments
|
|
|
|
# ------ ------- --------
|
|
|
|
# 524
|
|
|
|
# 183 -O2
|
|
|
|
# 182 -O3
|
|
|
|
# 183 -O3 -ffast-math (should be same as -Ofast)
|
|
|
|
# 184 -Ofast
|
|
|
|
# 189 -O3 -ffast-math -march=pentium
|
|
|
|
# 122 -O3 -ffast-math -msse
|
|
|
|
# 122 -O3 -ffast-math -march=pentium -msse
|
|
|
|
# 121 -O3 -ffast-math -march=pentium3 (this implies -msse)
|
|
|
|
# 120 -O3 -ffast-math -march=native
|
|
|
|
#
|
|
|
|
# Note that "-march=native" is essentially the same as "-march=pentium3."
|
|
|
|
#
|
|
|
|
|
|
|
|
# If the compiler is generating code for the i386 target, we can
|
|
|
|
# get much better results by telling it we have at least a Pentium 3.
|
|
|
|
|
|
|
|
arch := $(shell echo | gcc -E -dM - | grep __i386__)
|
|
|
|
ifneq ($(arch),)
|
|
|
|
CFLAGS += -march=pentium3
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# ---------- x86_64 ----------
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# gcc 4.8.2 running on Ubuntu 14.04.1.
|
|
|
|
# Intel Core 2 Duo from around 2007 or 2008.
|
2015-07-27 00:35:07 +00:00
|
|
|
#
|
2015-07-27 01:17:23 +00:00
|
|
|
# 64 bit target implies that we have SSE and probably even better vector instructions.
|
2015-07-27 00:35:07 +00:00
|
|
|
#
|
2015-07-27 01:17:23 +00:00
|
|
|
# seconds options comments
|
|
|
|
# ------ ------- --------
|
|
|
|
# 245
|
|
|
|
# 75 -01
|
|
|
|
# 72 -02
|
|
|
|
# 71 -03
|
|
|
|
# 73 -O3 -march=native
|
|
|
|
# 42 -O3 -ffast-math
|
|
|
|
# 42 -Ofast (note below)
|
|
|
|
# 40 -O3 -ffast-math -march=native
|
|
|
|
#
|
2015-07-27 00:35:07 +00:00
|
|
|
#
|
2015-07-27 01:17:23 +00:00
|
|
|
# Note that "-Ofast" is a newer option roughly equivalent to "-O3 -ffast-math".
|
|
|
|
# I use the longer form because it is compatible with older compilers.
|
|
|
|
#
|
|
|
|
# Why don't I don't have "-march=native?"
|
|
|
|
# Older compilers don't recognize "native" as one of the valid options.
|
|
|
|
# One article said it was added with gcc 4.2 but I haven't verified that.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Add -ffastmath in only if compiler version recognizes it.
|
|
|
|
|
|
|
|
useffast := $(shell gcc --help -v 2>/dev/null | grep ffast-math)
|
|
|
|
ifneq ($(useffast),)
|
|
|
|
CFLAGS += -ffast-math
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# ---------- ARM - Raspberry Pi 1 models ----------
|
|
|
|
#
|
|
|
|
# Raspberry Pi (before RPi model 2), ARM11 (ARMv6 + VFP2)
|
2015-07-27 00:35:07 +00:00
|
|
|
# gcc (Debian 4.6.3-14+rpi1) 4.6.3
|
|
|
|
#
|
2015-07-27 01:17:23 +00:00
|
|
|
#
|
|
|
|
# seconds options comments
|
|
|
|
# ------ ------- ---------
|
|
|
|
# 892 -O3
|
|
|
|
# 887 -O3 -ffast-math
|
|
|
|
# x -O3 -ffast-math -march=native (error: bad value for -march switch)
|
|
|
|
# 887 -O3 -ffast-math -mfpu=vfp
|
|
|
|
# 890 -O3 -ffast-math -march=armv6zk -mcpu=arm1176jzf-s -mfloat-abi=hard -mfpu=vfp
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# The compiler, supplied with Raspbian, is configured with these options which are
|
|
|
|
# good for the pre version 2 models.
|
|
|
|
# --with-arch=armv6 --with-fpu=vfp --with-float=hard
|
2015-07-27 00:35:07 +00:00
|
|
|
#
|
2015-07-27 01:17:23 +00:00
|
|
|
# Run "gcc --help -v 2" and look near the end.
|
|
|
|
#
|
2015-07-27 00:35:07 +00:00
|
|
|
#
|
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
#
|
|
|
|
# ---------- ARM - Raspberry Pi 2 ----------
|
|
|
|
#
|
|
|
|
# Besides the higher clock speed, the Raspberry Pi 2 has the NEON instruction set
|
|
|
|
# which which should make things considerably faster.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# seconds options comments
|
|
|
|
# ------ ------- ---------
|
|
|
|
# 426 -O3 -ffast-math (already more than twice as fast)
|
|
|
|
# 429 -O3 -mfpu=neon
|
|
|
|
# 419 -O3 -mfpu=neon -funsafe-math-optimizations
|
|
|
|
# 412 -O3 -ffast-math -mfpu=neon
|
|
|
|
# 413 -O3 -ffast-math -mfpu=neon-vfpv4
|
|
|
|
# 430 -O3 -ffast-math -mfpu=neon-vfpv4 -march=armv7-a
|
|
|
|
# 412 -O3 -ffast-math -mfpu=neon-vfpv4 -mtune=arm7
|
|
|
|
# 410 -O3 -ffast-math -mfpu=neon-vfpv4 -funsafe-math-optimizations
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
#
|
2015-07-27 01:17:23 +00:00
|
|
|
# gcc -march=armv7-a -mfpu=neon-vfpv4
|
|
|
|
#
|
|
|
|
# I expected the -mfpu=neon option to have a much larger impact.
|
|
|
|
# Adding -march=armv7-a makes it slower!
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
#
|
|
|
|
# If you compile with the RPi 2 specific options above and try to run it on the RPi
|
|
|
|
# model B (pre version 2), it will die with "illegal instruction."
|
|
|
|
#
|
|
|
|
# Dire Wolf is known to work on the BeagleBone, CubieBoard2, etc.
|
|
|
|
# The best compiler options will depend on the specific type of processor
|
|
|
|
# and the compiler target defaults.
|
|
|
|
#
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
neon := $(shell cat /proc/cpuinfo | grep neon)
|
|
|
|
ifneq ($(neon),)
|
|
|
|
CFLAGS += -mfpu=neon
|
2015-07-27 00:35:07 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
#
|
|
|
|
# You would expect "-march=native" to produce the fastest code.
|
|
|
|
# Why don't I use it here?
|
|
|
|
#
|
|
|
|
# 1. In my benchmarks, above, it has a negligible impact if any at all.
|
|
|
|
# 2. Some older versions of gcc don't recognize "native" as a valid choice.
|
|
|
|
# 3. Results are less portable. Not a consideration if you are
|
|
|
|
# building only for your own use but very important for anyone
|
|
|
|
# redistributing a "binary" version.
|
|
|
|
#
|
|
|
|
# If you are planning to distribute the binary version to other
|
|
|
|
# people (in some ham radio software collection, RPM, or DEB package),
|
2015-11-08 01:57:02 +00:00
|
|
|
# avoid fine tuning it for your particular computer. It could
|
2015-07-27 01:17:23 +00:00
|
|
|
# cause compatibility issues for those with older computers.
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2015-07-27 01:05:48 +00:00
|
|
|
# If you want to use OSS (for FreeBSD, OpenBSD) instead of
|
2015-07-27 01:17:23 +00:00
|
|
|
# ALSA (for Linux), comment out (or remove) the two lines below.
|
2015-07-27 01:05:48 +00:00
|
|
|
|
|
|
|
CFLAGS += -DUSE_ALSA
|
2015-11-08 01:57:02 +00:00
|
|
|
LDFLAGS += -lasound
|
2015-07-27 01:05:48 +00:00
|
|
|
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Enable GPS if header file is present.
|
|
|
|
# Finding libgps.so* is more difficult because it
|
|
|
|
# is in different places on different operating systems.
|
2015-07-27 01:05:48 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
enable_gpsd := $(wildcard /usr/include/gps.h)
|
|
|
|
ifneq ($(enable_gpsd),)
|
|
|
|
CFLAGS += -DENABLE_GPSD
|
|
|
|
LDFLAGS += -lgps
|
|
|
|
endif
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
2015-10-27 16:31:02 +00:00
|
|
|
# Uncomment following lines to enable hamlib support.
|
2015-12-26 22:08:57 +00:00
|
|
|
#CFLAGS += -DUSE_HAMLIB
|
|
|
|
#LDFLAGS += -lhamlib
|
2015-10-27 16:31:02 +00:00
|
|
|
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
# Name of current directory.
|
|
|
|
# Used to generate zip file name for distribution.
|
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
z := $(notdir ${CURDIR})
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
|
|
|
|
# -------------------------------- Main application -----------------------------------------
|
|
|
|
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2016-05-01 22:46:47 +00:00
|
|
|
direwolf : direwolf.o config.o recv.o demod.o dsp.o demod_afsk.o demod_psk.o demod_9600.o hdlc_rec.o \
|
2016-07-03 22:09:34 +00:00
|
|
|
hdlc_rec2.o multi_modem.o rdq.o rrbb.o dlq.o \
|
2016-11-20 19:58:51 +00:00
|
|
|
fcs_calc.o ax25_pad.o ax25_pad2.o xid.o \
|
2015-07-27 00:35:07 +00:00
|
|
|
decode_aprs.o symbols.o server.o kiss.o kissnet.o kiss_frame.o hdlc_send.o fcs_calc.o \
|
2016-11-20 19:58:51 +00:00
|
|
|
gen_tone.o audio.o audio_stats.o digipeater.o cdigipeater.o pfilter.o dedupe.o tq.o xmit.o morse.o \
|
2015-11-08 04:14:47 +00:00
|
|
|
ptt.o beacon.o encode_aprs.o latlong.o encode_aprs.o latlong.o textcolor.o \
|
2016-03-20 23:23:09 +00:00
|
|
|
dtmf.o aprs_tt.o tt_user.o tt_text.o igate.o waypoint.o serial_port.o log.o telemetry.o \
|
2016-11-20 19:58:51 +00:00
|
|
|
dwgps.o dwgpsnmea.o dwgpsd.o dtime_now.o mheard.o ax25_link.o \
|
2015-09-07 23:56:20 +00:00
|
|
|
misc.a geotranz.a
|
2015-11-08 01:57:02 +00:00
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
|
|
|
ifneq ($(enable_gpsd),)
|
|
|
|
@echo " "
|
|
|
|
@echo "This includes support for gpsd."
|
|
|
|
else
|
|
|
|
@echo " "
|
|
|
|
@echo "This does NOT include support for gpsd."
|
|
|
|
endif
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
# Optimization for slow processors.
|
|
|
|
|
2016-05-01 22:46:47 +00:00
|
|
|
demod.o : fsk_fast_filter.h
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
demod_afsk.o : fsk_fast_filter.h
|
|
|
|
|
|
|
|
|
2016-05-01 22:46:47 +00:00
|
|
|
fsk_fast_filter.h : gen_fff
|
2015-07-27 00:35:07 +00:00
|
|
|
./gen_fff > fsk_fast_filter.h
|
|
|
|
|
2016-05-01 22:46:47 +00:00
|
|
|
gen_fff : demod_afsk.c dsp.c textcolor.c
|
|
|
|
echo " " > tune.h
|
|
|
|
$(CC) $(CFLAGS) -DGEN_FFF -o $@ $^ $(LDFLAGS)
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
#
|
|
|
|
# The destination field is often used to identify the manufacturer/model.
|
|
|
|
# These are not hardcoded into Dire Wolf. Instead they are read from
|
|
|
|
# a file called tocalls.txt at application start up time.
|
|
|
|
#
|
|
|
|
# The original permanent symbols are built in but the "new" symbols,
|
|
|
|
# using overlays, are often updated. These are also read from files.
|
|
|
|
#
|
|
|
|
# You can obtain an updated copy by typing "make tocalls-symbols".
|
|
|
|
# This is not part of the normal build process. You have to do this explicitly.
|
|
|
|
#
|
|
|
|
# The locations below appear to be the most recent.
|
|
|
|
# The copy at http://www.aprs.org/tocalls.txt is out of date.
|
|
|
|
#
|
|
|
|
|
|
|
|
.PHONY: tocalls-symbols
|
|
|
|
tocalls-symbols :
|
|
|
|
cp tocalls.txt tocalls.txt~
|
|
|
|
wget http://www.aprs.org/aprs11/tocalls.txt -O tocalls.txt
|
2016-02-27 20:37:45 +00:00
|
|
|
-diff -Z tocalls.txt~ tocalls.txt
|
2015-11-08 01:57:02 +00:00
|
|
|
cp symbols-new.txt symbols-new.txt~
|
|
|
|
wget http://www.aprs.org/symbols/symbols-new.txt -O symbols-new.txt
|
2016-02-27 20:37:45 +00:00
|
|
|
-diff -Z symbols-new.txt~ symbols-new.txt
|
2015-11-08 01:57:02 +00:00
|
|
|
cp symbolsX.txt symbolsX.txt~
|
|
|
|
wget http://www.aprs.org/symbols/symbolsX.txt -O symbolsX.txt
|
2016-02-27 20:37:45 +00:00
|
|
|
-diff -Z symbolsX.txt~ symbolsX.txt
|
2015-11-08 01:57:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
# ---------------------------------------- Other utilities included ------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
# Separate application to decode raw data.
|
|
|
|
|
2015-11-08 04:14:47 +00:00
|
|
|
decode_aprs : decode_aprs.c dwgpsnmea.o dwgps.o dwgpsd.o serial_port.o symbols.o ax25_pad.o textcolor.o fcs_calc.o latlong.o log.o telemetry.o tt_text.o misc.a
|
2015-11-08 01:57:02 +00:00
|
|
|
$(CC) $(CFLAGS) -DDECAMAIN -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Convert between text and touch tone representation.
|
|
|
|
|
|
|
|
text2tt : tt_text.c misc.a
|
|
|
|
$(CC) $(CFLAGS) -DENC_MAIN -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
tt2text : tt_text.c misc.a
|
|
|
|
$(CC) $(CFLAGS) -DDEC_MAIN -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
# Convert between Latitude/Longitude and UTM coordinates.
|
|
|
|
|
|
|
|
ll2utm : ll2utm.c geotranz.a textcolor.o misc.a
|
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
utm2ll : utm2ll.c geotranz.a textcolor.o misc.a
|
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
# Convert from log file to GPX.
|
|
|
|
|
|
|
|
log2gpx : log2gpx.c textcolor.o misc.a
|
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
# Test application to generate sound.
|
|
|
|
|
2016-12-17 01:12:38 +00:00
|
|
|
gen_packets : gen_packets.c ax25_pad.c hdlc_send.c fcs_calc.c gen_tone.c morse.c dtmf.c textcolor.c dsp.c misc.a
|
2015-11-08 01:57:02 +00:00
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
# Unit test for AFSK demodulator
|
|
|
|
|
2016-05-01 22:46:47 +00:00
|
|
|
atest : atest.c demod.o demod_afsk.o demod_psk.o demod_9600.o \
|
2016-01-31 16:42:58 +00:00
|
|
|
dsp.o hdlc_rec.o hdlc_rec2.o multi_modem.o rrbb.o \
|
|
|
|
fcs_calc.o ax25_pad.o decode_aprs.o dwgpsnmea.o \
|
2016-07-03 22:09:34 +00:00
|
|
|
dwgps.o dwgpsd.o serial_port.o telemetry.o dtime_now.o latlong.o symbols.o tt_text.o textcolor.o \
|
2015-11-08 01:57:02 +00:00
|
|
|
misc.a
|
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
# Multiple AGWPE network or serial port clients to test TNCs side by side.
|
|
|
|
|
|
|
|
aclients : aclients.c ax25_pad.c fcs_calc.c textcolor.o misc.a
|
|
|
|
$(CC) $(CFLAGS) -g -o $@ $^
|
|
|
|
|
|
|
|
|
|
|
|
# Touch Tone to Speech sample application.
|
|
|
|
|
|
|
|
ttcalc : ttcalc.o ax25_pad.o fcs_calc.o textcolor.o misc.a
|
|
|
|
$(CC) $(CFLAGS) -g -o $@ $^
|
|
|
|
|
|
|
|
|
|
|
|
# ----------------------------------------- Libraries --------------------------------------------
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
# UTM, USNG, MGRS conversions.
|
|
|
|
|
|
|
|
geotranz.a : error_string.o mgrs.o polarst.o tranmerc.o ups.o usng.o utm.o
|
2015-07-27 00:35:07 +00:00
|
|
|
ar -cr $@ $^
|
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
error_string.o : geotranz/error_string.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
|
|
|
|
mgrs.o : geotranz/mgrs.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
|
|
|
|
polarst.o : geotranz/polarst.c
|
2015-07-27 00:35:07 +00:00
|
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
tranmerc.o : geotranz/tranmerc.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
|
|
|
|
ups.o : geotranz/ups.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
|
|
|
|
usng.o : geotranz/usng.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
|
|
|
|
utm.o : geotranz/utm.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $^
|
|
|
|
|
|
|
|
|
2015-09-07 23:56:20 +00:00
|
|
|
# Provide our own copy of strlcpy and strlcat because they are not included with Linux.
|
|
|
|
# We don't need the others in that same directory.
|
|
|
|
|
|
|
|
misc.a : strlcpy.o strlcat.o
|
|
|
|
ar -cr $@ $^
|
|
|
|
|
|
|
|
strlcpy.o : misc/strlcpy.c
|
|
|
|
$(CC) $(CFLAGS) -I. -c -o $@ $^
|
|
|
|
|
|
|
|
strlcat.o : misc/strlcat.c
|
|
|
|
$(CC) $(CFLAGS) -I. -c -o $@ $^
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# ------------------------------------- Installation ----------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-09-07 23:56:20 +00:00
|
|
|
# Generate apprpriate sample configuration file for this platform.
|
2015-11-08 01:57:02 +00:00
|
|
|
# Originally, there was one sample for all platforms. It got too cluttered
|
|
|
|
# and confusing saying, this is for windows, and this is for Linux, and this ...
|
|
|
|
# Trying to maintain 3 different versions in parallel is error prone.
|
|
|
|
# We now have a single generic version which can be used to generate
|
|
|
|
# the various platform specific versions.
|
|
|
|
|
|
|
|
# generic.conf should be checked into source control.
|
|
|
|
# direwolf.conf should NOT. It is generated when compiling on the target platform.
|
2015-09-07 23:56:20 +00:00
|
|
|
|
|
|
|
direwolf.conf : generic.conf
|
|
|
|
egrep '^C|^L' generic.conf | cut -c2-999 > direwolf.conf
|
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
|
|
|
|
# Where should we install it?
|
|
|
|
|
|
|
|
# My understanding, of the convention, is that something you compile
|
|
|
|
# from source, that is not a standard part of the operating system,
|
|
|
|
# should go in /usr/local/bin.
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# However, if you are preparing a "binary" DEB or RPM package, the
|
2015-07-27 01:17:23 +00:00
|
|
|
# installation location should be /usr/bin.
|
|
|
|
|
|
|
|
# This is a step in the right direction but not sufficient to use /usr instead.
|
2015-11-08 01:57:02 +00:00
|
|
|
# Eventually I'd like to have targets here to build the .DEB and .RPM packages.
|
2015-07-27 01:17:23 +00:00
|
|
|
|
|
|
|
INSTALLDIR := /usr/local
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Command to "install" to system directories. Use "ginstall" for Mac.
|
|
|
|
|
|
|
|
INSTALL=install
|
2015-07-27 01:17:23 +00:00
|
|
|
|
|
|
|
# direwolf.desktop was previously handcrafted for the Raspberry Pi.
|
|
|
|
# It was hardcoded with lxterminal, /home/pi, and so on.
|
|
|
|
# In version 1.2, try to customize this to match other situations better.
|
|
|
|
|
2015-09-07 23:56:20 +00:00
|
|
|
# TODO: Test this better.
|
2015-07-27 01:17:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
direwolf.desktop :
|
|
|
|
@echo "Generating customized direwolf.desktop ..."
|
|
|
|
@echo '[Desktop Entry]' > $@
|
|
|
|
@echo 'Type=Application' >> $@
|
|
|
|
ifneq ($(wildcard /usr/bin/lxterminal),)
|
|
|
|
@echo "Exec=lxterminal -t \"Dire Wolf\" -e \"$(INSTALLDIR)/bin/direwolf\"" >> $@
|
|
|
|
else ifneq ($(wildcard /usr/bin/lxterm),)
|
|
|
|
@echo "Exec=lxterm -hold -title \"Dire Wolf\" -bg white -e \"$(INSTALLDIR)/bin/direwolf\"" >> $@
|
|
|
|
else
|
|
|
|
@echo "Exec=xterm -hold -title \"Dire Wolf\" -bg white -e \"$(INSTALLDIR)/bin/direwolf\"" >> $@
|
|
|
|
endif
|
|
|
|
@echo 'Name=Dire Wolf' >> $@
|
|
|
|
@echo 'Comment=APRS Soundcard TNC' >> $@
|
|
|
|
@echo 'Icon=/usr/share/direwolf/dw-icon.png' >> $@
|
|
|
|
@echo "Path=$(HOME)" >> $@
|
|
|
|
@echo '#Terminal=true' >> $@
|
|
|
|
@echo 'Categories=HamRadio' >> $@
|
|
|
|
@echo 'Keywords=Ham Radio;APRS;Soundcard TNC;KISS;AGWPE;AX.25' >> $@
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Installation into /usr/local/...
|
2015-07-27 01:05:48 +00:00
|
|
|
# Needs to be run as root or with sudo.
|
2015-11-08 01:57:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
.PHONY: install
|
|
|
|
install : $(APPS) direwolf.conf tocalls.txt symbols-new.txt symbolsX.txt dw-icon.png direwolf.desktop
|
|
|
|
#
|
|
|
|
# Applications, not installed with package manager, normally go in /usr/local/bin.
|
|
|
|
# /usr/bin is used instead when installing from .DEB or .RPM package.
|
|
|
|
#
|
|
|
|
$(INSTALL) direwolf $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) decode_aprs $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) text2tt $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) tt2text $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) ll2utm $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) utm2ll $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) aclients $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) log2gpx $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) gen_packets $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) atest $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) ttcalc $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) dwespeak.sh $(INSTALLDIR)/bin
|
|
|
|
#
|
|
|
|
# Telemetry Toolkit executables. Other .conf and .txt files will go into doc directory.
|
|
|
|
#
|
|
|
|
$(INSTALL) telemetry-toolkit/telem-balloon.pl $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) telemetry-toolkit/telem-bits.pl $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) telemetry-toolkit/telem-data.pl $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) telemetry-toolkit/telem-data91.pl $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) telemetry-toolkit/telem-eqns.pl $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) telemetry-toolkit/telem-parm.pl $(INSTALLDIR)/bin
|
2015-12-31 02:49:13 +00:00
|
|
|
$(INSTALL) telemetry-toolkit/telem-seq.sh $(INSTALLDIR)/bin
|
2015-11-08 01:57:02 +00:00
|
|
|
$(INSTALL) telemetry-toolkit/telem-unit.pl $(INSTALLDIR)/bin
|
|
|
|
$(INSTALL) telemetry-toolkit/telem-volts.py $(INSTALLDIR)/bin
|
|
|
|
#
|
|
|
|
# Misc. data such as "tocall" to system mapping.
|
|
|
|
#
|
|
|
|
$(INSTALL) -D --mode=644 tocalls.txt /usr/share/direwolf/tocalls.txt
|
|
|
|
$(INSTALL) -D --mode=644 symbols-new.txt /usr/share/direwolf/symbols-new.txt
|
|
|
|
$(INSTALL) -D --mode=644 symbolsX.txt /usr/share/direwolf/symbolsX.txt
|
|
|
|
$(INSTALL) -D --mode=644 dw-icon.png /usr/share/direwolf/dw-icon.png
|
|
|
|
$(INSTALL) -D --mode=644 direwolf.desktop /usr/share/applications/direwolf.desktop
|
|
|
|
#
|
|
|
|
# Documentation. Various plain text files and PDF.
|
|
|
|
#
|
|
|
|
$(INSTALL) -D --mode=644 CHANGES.md $(INSTALLDIR)/share/doc/direwolf/CHANGES.md
|
|
|
|
$(INSTALL) -D --mode=644 LICENSE-dire-wolf.txt $(INSTALLDIR)/share/doc/direwolf/LICENSE-dire-wolf.txt
|
|
|
|
$(INSTALL) -D --mode=644 LICENSE-other.txt $(INSTALLDIR)/share/doc/direwolf/LICENSE-other.txt
|
|
|
|
#
|
2015-11-08 04:14:47 +00:00
|
|
|
# ./README.md is an overview for the project main page.
|
|
|
|
# doc/README.md contains an overview of the PDF file contents and is more useful here.
|
|
|
|
#
|
|
|
|
$(INSTALL) -D --mode=644 doc/README.md $(INSTALLDIR)/share/doc/direwolf/README.md
|
2015-11-08 01:57:02 +00:00
|
|
|
$(INSTALL) -D --mode=644 doc/User-Guide.pdf $(INSTALLDIR)/share/doc/direwolf/User-Guide.pdf
|
|
|
|
$(INSTALL) -D --mode=644 doc/Raspberry-Pi-APRS.pdf $(INSTALLDIR)/share/doc/direwolf/Raspberry-Pi-APRS.pdf
|
|
|
|
$(INSTALL) -D --mode=644 doc/Raspberry-Pi-APRS-Tracker.pdf $(INSTALLDIR)/share/doc/direwolf/Raspberry-Pi-APRS-Tracker.pdf
|
|
|
|
$(INSTALL) -D --mode=644 doc/Raspberry-Pi-SDR-IGate.pdf $(INSTALLDIR)/share/doc/direwolf/Raspberry-Pi-SDR-IGate.pdf
|
|
|
|
$(INSTALL) -D --mode=644 doc/APRStt-Implementation-Notes.pdf $(INSTALLDIR)/share/doc/direwolf/APRStt-Implementation-Notes.pdf
|
|
|
|
$(INSTALL) -D --mode=644 doc/APRStt-interface-for-SARTrack.pdf $(INSTALLDIR)/share/doc/direwolf/APRStt-interface-for-SARTrack.pdf
|
|
|
|
$(INSTALL) -D --mode=644 doc/APRS-Telemetry-Toolkit.pdf $(INSTALLDIR)/share/doc/direwolf/APRS-Telemetry-Toolkit.pdf
|
|
|
|
$(INSTALL) -D --mode=644 doc/A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf $(INSTALLDIR)/share/doc/direwolf/A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf
|
|
|
|
$(INSTALL) -D --mode=644 doc/A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf $(INSTALLDIR)/share/doc/direwolf/A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf
|
|
|
|
#
|
2015-11-10 02:31:38 +00:00
|
|
|
# Various sample config and other files go into examples under the doc directory.
|
2015-11-08 01:57:02 +00:00
|
|
|
# When building from source, these can be put in home directory with "make install-conf".
|
|
|
|
# When installed from .DEB or .RPM package, the user will need to copy these to
|
|
|
|
# the home directory or other desired location.
|
|
|
|
#
|
2015-11-10 02:31:38 +00:00
|
|
|
$(INSTALL) -D --mode=644 direwolf.conf $(INSTALLDIR)/share/doc/direwolf/examples/direwolf.conf
|
|
|
|
$(INSTALL) -D --mode=644 dw-start.sh $(INSTALLDIR)/share/doc/direwolf/examples/dw-start.sh
|
|
|
|
$(INSTALL) -D --mode=644 sdr.conf $(INSTALLDIR)/share/doc/direwolf/examples/sdr.conf
|
|
|
|
$(INSTALL) -D --mode=644 telemetry-toolkit/telem-m0xer-3.txt $(INSTALLDIR)/share/doc/direwolf/examples/telem-m0xer-3.txt
|
|
|
|
$(INSTALL) -D --mode=644 telemetry-toolkit/telem-balloon.conf $(INSTALLDIR)/share/doc/direwolf/examples/telem-balloon.conf
|
|
|
|
$(INSTALL) -D --mode=644 telemetry-toolkit/telem-volts.conf $(INSTALLDIR)/share/doc/direwolf/examples/telem-volts.conf
|
2015-11-08 01:57:02 +00:00
|
|
|
#
|
|
|
|
# "man" pages
|
|
|
|
#
|
|
|
|
$(INSTALL) -D --mode=644 man1/aclients.1 $(INSTALLDIR)/man/man1/aclients.1
|
|
|
|
$(INSTALL) -D --mode=644 man1/atest.1 $(INSTALLDIR)/man/man1/atest.1
|
|
|
|
$(INSTALL) -D --mode=644 man1/decode_aprs.1 $(INSTALLDIR)/man/man1/decode_aprs.1
|
|
|
|
$(INSTALL) -D --mode=644 man1/direwolf.1 $(INSTALLDIR)/man/man1/direwolf.1
|
|
|
|
$(INSTALL) -D --mode=644 man1/gen_packets.1 $(INSTALLDIR)/man/man1/gen_packets.1
|
|
|
|
$(INSTALL) -D --mode=644 man1/ll2utm.1 $(INSTALLDIR)/man/man1/ll2utm.1
|
|
|
|
$(INSTALL) -D --mode=644 man1/log2gpx.1 $(INSTALLDIR)/man/man1/log2gpx.1
|
|
|
|
$(INSTALL) -D --mode=644 man1/text2tt.1 $(INSTALLDIR)/man/man1/text2tt.1
|
|
|
|
$(INSTALL) -D --mode=644 man1/tt2text.1 $(INSTALLDIR)/man/man1/tt2text.1
|
|
|
|
$(INSTALL) -D --mode=644 man1/utm2ll.1 $(INSTALLDIR)/man/man1/utm2ll.1
|
|
|
|
#
|
2015-07-27 01:17:23 +00:00
|
|
|
@echo " "
|
2015-09-07 23:56:20 +00:00
|
|
|
@echo "If this is your first install, not an upgrade, type this to put a copy"
|
|
|
|
@echo "of the sample configuration file (direwolf.conf) in your home directory:"
|
2015-07-27 01:17:23 +00:00
|
|
|
@echo " "
|
|
|
|
@echo " make install-conf"
|
|
|
|
@echo " "
|
|
|
|
|
|
|
|
|
|
|
|
# These would be done as ordinary user.
|
2015-07-27 01:05:48 +00:00
|
|
|
|
|
|
|
# The Raspberry Pi has ~/Desktop but Ubuntu does not.
|
|
|
|
|
|
|
|
# TODO: Handle Linux variations correctly.
|
|
|
|
|
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
.PHONY: install-conf
|
|
|
|
install-conf : direwolf.conf
|
|
|
|
cp direwolf.conf ~
|
2015-11-10 02:31:38 +00:00
|
|
|
cp sdr.conf ~
|
2015-09-07 23:56:20 +00:00
|
|
|
cp telemetry-toolkit/telem-m0xer-3.txt ~
|
|
|
|
cp telemetry-toolkit/telem-*.conf ~
|
2015-07-27 01:17:23 +00:00
|
|
|
ifneq ($(wildcard $(HOME)/Desktop),)
|
|
|
|
@echo " "
|
|
|
|
@echo "This will add a desktop icon on some systems:"
|
|
|
|
@echo " "
|
|
|
|
@echo " make install-rpi"
|
|
|
|
@echo " "
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: install-rpi
|
2015-07-27 01:05:48 +00:00
|
|
|
install-rpi : dw-start.sh
|
2015-07-27 00:35:07 +00:00
|
|
|
cp dw-start.sh ~
|
|
|
|
ln -f -s /usr/share/applications/direwolf.desktop ~/Desktop/direwolf.desktop
|
|
|
|
|
2015-07-27 01:05:48 +00:00
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# ---------------------------------- Automated Smoke Test --------------------------------
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Combine some unit tests into a single regression sanity check.
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
2016-12-17 01:12:38 +00:00
|
|
|
check : dtest ttest tttexttest pftest tlmtest lltest enctest kisstest pad2test xidtest dtmftest check-modem1200 check-modem300 check-modem9600 check-modem19200 check-modem2400 check-modem4800
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Can we encode and decode at popular data rates?
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
check-modem1200 : gen_packets atest
|
2016-05-01 22:46:47 +00:00
|
|
|
./gen_packets -n 100 -o /tmp/test12.wav
|
|
|
|
./atest -F0 -PE -L63 -G71 /tmp/test12.wav
|
|
|
|
./atest -F1 -PE -L70 -G75 /tmp/test12.wav
|
|
|
|
rm /tmp/test12.wav
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
check-modem300 : gen_packets atest
|
2015-11-18 13:09:45 +00:00
|
|
|
./gen_packets -B300 -n 100 -o /tmp/test3.wav
|
|
|
|
./atest -B300 -F0 -L68 -G69 /tmp/test3.wav
|
|
|
|
./atest -B300 -F1 -L73 -G75 /tmp/test3.wav
|
2015-11-08 01:57:02 +00:00
|
|
|
rm /tmp/test3.wav
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
check-modem9600 : gen_packets atest
|
2016-05-01 22:46:47 +00:00
|
|
|
./gen_packets -B9600 -n 100 -o /tmp/test96.wav
|
2016-07-03 22:09:34 +00:00
|
|
|
./atest -B9600 -F0 -L50 -G54 /tmp/test96.wav
|
|
|
|
./atest -B9600 -F1 -L55 -G59 /tmp/test96.wav
|
2016-05-01 22:46:47 +00:00
|
|
|
rm /tmp/test96.wav
|
|
|
|
|
|
|
|
check-modem19200 : gen_packets atest
|
|
|
|
./gen_packets -r 96000 -B19200 -n 100 -o /tmp/test19.wav
|
2016-07-03 22:09:34 +00:00
|
|
|
./atest -B19200 -F0 -L55 -G59 /tmp/test19.wav
|
|
|
|
./atest -B19200 -F1 -L60 -G64 /tmp/test19.wav
|
2016-05-01 22:46:47 +00:00
|
|
|
rm /tmp/test19.wav
|
|
|
|
|
|
|
|
check-modem2400 : gen_packets atest
|
|
|
|
./gen_packets -B2400 -n 100 -o /tmp/test24.wav
|
|
|
|
./atest -B2400 -F0 -L70 -G78 /tmp/test24.wav
|
|
|
|
./atest -B2400 -F1 -L80 -G87 /tmp/test24.wav
|
|
|
|
rm /tmp/test24.wav
|
|
|
|
|
|
|
|
check-modem4800 : gen_packets atest
|
|
|
|
./gen_packets -B2400 -n 100 -o /tmp/test48.wav
|
|
|
|
./atest -B2400 -F0 -L70 -G79 /tmp/test48.wav
|
|
|
|
./atest -B2400 -F1 -L80 -G90 /tmp/test48.wav
|
|
|
|
rm /tmp/test48.wav
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Unit test for inner digipeater algorithm
|
2015-07-27 01:05:48 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
.PHONY : dtest
|
2016-12-17 01:12:38 +00:00
|
|
|
dtest : digipeater.c dedupe.c pfilter.c \
|
|
|
|
ax25_pad.o fcs_calc.o tq.o textcolor.o \
|
2015-11-08 04:14:47 +00:00
|
|
|
decode_aprs.o dwgpsnmea.o dwgps.o dwgpsd.o serial_port.o latlong.o telemetry.o symbols.o tt_text.o misc.a
|
2015-11-08 01:57:02 +00:00
|
|
|
$(CC) $(CFLAGS) -DDIGITEST -o $@ $^ $(LDFLAGS)
|
|
|
|
./dtest
|
|
|
|
rm dtest
|
2015-07-27 01:05:48 +00:00
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Unit test for APRStt tone sequence parsing.
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
.PHONY : ttest
|
|
|
|
ttest : aprs_tt.c tt_text.c latlong.o textcolor.o misc.a geotranz.a misc.a
|
|
|
|
$(CC) $(CFLAGS) -DTT_MAIN -o $@ $^ $(LDFLAGS)
|
|
|
|
./ttest
|
|
|
|
rm ttest
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Unit test for APRStt tone sequence / text conversions.
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
.PHONY: tttexttest
|
|
|
|
tttexttest : tt_text.c textcolor.o misc.a
|
|
|
|
$(CC) $(CFLAGS) -DTTT_TEST -o $@ $^ $(LDFLAGS)
|
|
|
|
./tttexttest
|
|
|
|
rm tttexttest
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Unit test for Packet Filtering.
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
.PHONY: pftest
|
2015-11-08 04:14:47 +00:00
|
|
|
pftest : pfilter.c ax25_pad.o textcolor.o fcs_calc.o decode_aprs.o dwgpsnmea.o dwgps.o dwgpsd.o serial_port.o latlong.o symbols.o telemetry.o tt_text.o misc.a
|
2015-11-08 01:57:02 +00:00
|
|
|
$(CC) $(CFLAGS) -DPFTEST -o $@ $^ $(LDFLAGS)
|
|
|
|
./pftest
|
|
|
|
rm pftest
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Unit test for telemetry decoding.
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
.PHONY: tlmtest
|
|
|
|
tlmtest : telemetry.c ax25_pad.o fcs_calc.o textcolor.o misc.a
|
|
|
|
$(CC) $(CFLAGS) -DTEST -o $@ $^ $(LDFLAGS)
|
|
|
|
./tlmtest
|
|
|
|
rm tlmtest
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Unit test for location coordinate conversion.
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
.PHONY: lltest
|
|
|
|
lltest : latlong.c textcolor.o misc.a
|
|
|
|
$(CC) $(CFLAGS) -DLLTEST -o $@ $^ $(LDFLAGS)
|
|
|
|
./lltest
|
|
|
|
rm lltest
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Unit test for encoding position & object report.
|
2015-07-27 01:17:23 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
.PHONY: enctest
|
|
|
|
enctest : encode_aprs.c latlong.c textcolor.c misc.a
|
|
|
|
$(CC) $(CFLAGS) -DEN_MAIN -o $@ $^ $(LDFLAGS)
|
|
|
|
./enctest
|
|
|
|
rm enctest
|
2015-07-27 01:17:23 +00:00
|
|
|
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# Unit test for KISS encapsulation.
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
.PHONY: kisstest
|
|
|
|
kisstest : kiss_frame.c
|
|
|
|
$(CC) $(CFLAGS) -DKISSTEST -o $@ $^ $(LDFLAGS)
|
|
|
|
./kisstest
|
|
|
|
rm kisstest
|
|
|
|
|
2016-05-01 22:46:47 +00:00
|
|
|
# Unit test for constructing frames besides UI.
|
|
|
|
|
|
|
|
.PHONY: pad2test
|
|
|
|
pad2test : ax25_pad2.c ax25_pad.c fcs_calc.o textcolor.o misc.a
|
|
|
|
$(CC) $(CFLAGS) -DPAD2TEST -o $@ $^ $(LDFLAGS)
|
|
|
|
./pad2test
|
|
|
|
rm pad2test
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
|
2016-11-20 19:58:51 +00:00
|
|
|
# Unit Test for XID frame encode/decode.
|
|
|
|
|
|
|
|
.PHONY: xidtest
|
|
|
|
xidtest : xid.c textcolor.o misc.a
|
|
|
|
$(CC) $(CFLAGS) -DXIDTEST -o $@ $^ $(LDFLAGS)
|
|
|
|
./xidtest
|
|
|
|
rm xidtest
|
|
|
|
|
|
|
|
|
2016-12-17 01:12:38 +00:00
|
|
|
# Unit Test for DTMF encode/decode.
|
|
|
|
|
|
|
|
.PHONY: dtmftest
|
|
|
|
dtmftest : dtmf.c textcolor.o
|
|
|
|
$(CC) $(CFLAGS) -DDTMF_TEST -o $@ $^ $(LDFLAGS)
|
|
|
|
./dtmftest
|
|
|
|
rm dtmftest
|
|
|
|
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
|
|
|
|
# ----------------------------- Manual tests and experiments ---------------------------
|
|
|
|
|
2016-01-31 16:42:58 +00:00
|
|
|
# These are not included in a normal build. Might be broken.
|
2015-11-08 01:57:02 +00:00
|
|
|
|
|
|
|
# Unit test for IGate
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-09-07 23:56:20 +00:00
|
|
|
itest : igate.c textcolor.c ax25_pad.c fcs_calc.c textcolor.o misc.a
|
2015-07-27 00:35:07 +00:00
|
|
|
$(CC) $(CFLAGS) -DITEST -o $@ $^
|
|
|
|
./itest
|
|
|
|
|
2016-01-31 16:42:58 +00:00
|
|
|
# Unit test for UDP reception with AFSK demodulator.
|
|
|
|
# Temporary during development. Might not be useful anymore.
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2016-05-01 22:46:47 +00:00
|
|
|
udptest : udp_test.c demod.o dsp.o demod_afsk.o demod_psk.o demod_9600.o hdlc_rec.o hdlc_rec2.o multi_modem.o rrbb.o \
|
2016-01-31 16:42:58 +00:00
|
|
|
fcs_calc.o ax25_pad.o decode_aprs.o symbols.o textcolor.o misc.a
|
2015-11-08 01:57:02 +00:00
|
|
|
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
2015-07-27 00:35:07 +00:00
|
|
|
./udptest
|
|
|
|
|
2016-01-31 16:42:58 +00:00
|
|
|
# For demodulator tweaking experiments.
|
|
|
|
# Dependencies of demod*.c, rather than .o, are intentional.
|
|
|
|
|
2016-05-01 22:46:47 +00:00
|
|
|
demod.o : tune.h
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
demod_afsk.o : tune.h
|
2016-05-01 22:46:47 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
demod_9600.o : tune.h
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2016-05-01 22:46:47 +00:00
|
|
|
demod_psk.o : tune.h
|
|
|
|
|
|
|
|
tune.h :
|
|
|
|
echo " " > tune.h
|
|
|
|
|
|
|
|
|
|
|
|
testagc : atest.c demod.c dsp.c demod_afsk.c demod_psk.c demod_9600.c hdlc_rec.o hdlc_rec2.o multi_modem.o rrbb.o \
|
2016-07-03 22:09:34 +00:00
|
|
|
fcs_calc.o ax25_pad.o decode_aprs.o telemetry.o dtime_now.o latlong.o symbols.o tune.h textcolor.o misc.a
|
2015-11-08 01:57:02 +00:00
|
|
|
$(CC) $(CFLAGS) -o atest $^ $(LDFLAGS)
|
|
|
|
./atest 02_Track_2.wav | grep "packets decoded in" > atest.out
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
2016-07-03 22:09:34 +00:00
|
|
|
testagc96 : atest.c fsk_fast_filter.h tune.h demod.c demod_afsk.c demod_psk.c demod_9600.c \
|
|
|
|
dsp.o hdlc_rec.o hdlc_rec2.o multi_modem.o \
|
|
|
|
rrbb.o fcs_calc.o ax25_pad.o decode_aprs.o \
|
|
|
|
dwgpsnmea.o dwgps.o dwgpsd.o serial_port.o latlong.o \
|
|
|
|
symbols.o tt_text.o textcolor.o telemetry.o dtime_now.o \
|
|
|
|
misc.a
|
|
|
|
rm -f atest96
|
|
|
|
$(CC) $(CFLAGS) -o atest96 $^ $(LDFLAGS)
|
|
|
|
./atest96 -B 9600 ../walkabout9600c.wav | grep "packets decoded in" >atest.out
|
|
|
|
#./atest96 -B 9600 noisy96.wav | grep "packets decoded in" >atest.out
|
|
|
|
#./atest96 -B 9600 19990303_0225_9600_8bis_22kHz.wav | grep "packets decoded in" >atest.out
|
|
|
|
#./atest96 -B 9600 19990303_0225_9600_16bit_22kHz.wav | grep "packets decoded in" >atest.out
|
|
|
|
#./atest96 -B 9600 -P + z8-22k.wav| grep "packets decoded in" >atest.out
|
|
|
|
#./atest96 -B 9600 test9600.wav | grep "packets decoded in" >atest.out
|
|
|
|
echo " " > tune.h
|
2015-07-27 01:17:23 +00:00
|
|
|
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# ------------------------------- Source distribution ---------------------------------
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# probably obsolete and can be removed after move to github.
|
2015-07-27 00:35:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
.PHONY: dist-src
|
2015-09-07 23:56:20 +00:00
|
|
|
dist-src : README.md CHANGES.md
|
|
|
|
doc/User-Guide.pdf doc/Raspberry-Pi-APRS.pdf \
|
|
|
|
doc/Raspberry-Pi-APRS-Tracker.pdf doc/APRStt-Implementation-Notes.pdf \
|
2015-07-27 01:17:23 +00:00
|
|
|
dw-start.sh dwespeak.bat dwespeak.sh \
|
|
|
|
tocalls.txt symbols-new.txt symbolsX.txt direwolf.spec
|
2015-07-27 00:35:07 +00:00
|
|
|
rm -f fsk_fast_filter.h
|
|
|
|
echo " " > tune.h
|
|
|
|
rm -f ../$z-src.zip
|
2015-07-27 01:17:23 +00:00
|
|
|
(cd .. ; zip $z-src.zip \
|
2015-09-07 23:56:20 +00:00
|
|
|
$z/README.md \
|
|
|
|
$z/CHANGES.md \
|
2015-07-27 01:17:23 +00:00
|
|
|
$z/LICENSE* \
|
2015-09-07 23:56:20 +00:00
|
|
|
$z/doc/User-Guide.pdf \
|
|
|
|
$z/doc/Raspberry-Pi-APRS.pdf \
|
|
|
|
$z/doc/Raspberry-Pi-APRS-Tracker.pdf \
|
|
|
|
$z/doc/APRStt-Implementation-Notes.pdf \
|
|
|
|
$z/doc/APRS-Telemetry-Toolkit.pdf \
|
2015-07-27 01:17:23 +00:00
|
|
|
$z/Makefile* \
|
|
|
|
$z/*.c $z/*.h \
|
|
|
|
$z/regex/* $z/misc/* $z/geotranz/* \
|
|
|
|
$z/man1/* \
|
2015-09-07 23:56:20 +00:00
|
|
|
$z/generic.conf \
|
2015-07-27 01:17:23 +00:00
|
|
|
$z/tocalls.txt $z/symbols-new.txt $z/symbolsX.txt \
|
2015-07-27 00:35:07 +00:00
|
|
|
$z/dw-icon.png $z/dw-icon.rc $z/dw-icon.ico \
|
2015-07-27 01:17:23 +00:00
|
|
|
$z/dw-start.sh $z/direwolf.spec \
|
2015-09-07 23:56:20 +00:00
|
|
|
$z/dwespeak.bat $z/dwespeak.sh \
|
|
|
|
$z/telemetry-toolkit/* )
|
2015-07-27 01:17:23 +00:00
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
# -----------------------------------------------------------------------------------------
|
2015-07-27 01:05:48 +00:00
|
|
|
|
2015-11-08 01:57:02 +00:00
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean :
|
2016-05-01 22:46:47 +00:00
|
|
|
rm -f $(APPS) gen_fff tune.h fsk_fast_filter.h *.o *.a direwolf.desktop
|
2015-11-08 01:57:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
depend : $(wildcard *.c)
|
|
|
|
makedepend -f $(lastword $(MAKEFILE_LIST)) -- $(CFLAGS) -- $^
|
2015-07-27 01:05:48 +00:00
|
|
|
|
|
|
|
|
2015-07-27 00:35:07 +00:00
|
|
|
#
|
|
|
|
# The following is updated by "make depend"
|
|
|
|
#
|
|
|
|
# DO NOT DELETE
|
|
|
|
|
2015-07-27 01:17:23 +00:00
|
|
|
|