--- Makefile.linux.orig 2015-05-10 14:25:42.288338461 -0700 +++ Makefile.linux 2015-05-10 14:24:39.529751840 -0700 @@ -1,437 +1,437 @@ -# -# Makefile for Linux version of Dire Wolf. -# - -all : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_packets ttcalc direwolf.desktop - @echo " " - @echo "Next step - install with:" - @echo " " - @echo " sudo make -f Makefile.linux install" - @echo " " - -CC = gcc - -# -# The DSP filters can be sped up considerably with the SSE -# instructions. The SSE instructions were introduced in 1999 -# with the Pentium III series. -# SSE2 instructions, added in 2000, don't seem to offer any advantage. -# -# Let's look at impact of various optimization levels. -# -# Benchmark results with Ubuntu gcc version 4.6.3, 32 bit platform. -# Intel(R) Celeron(R) CPU 2.53GHz. Appears to have only 32 bit instructions. -# -# seconds options, comments -# ------ ----------------- -# 123 -O2 -# 128 -O3 Slower than -O2 ? -# 123 -Ofast (should be same as -O3 -ffastmath) -# 126 -Ofast -march=pentium -# 88 -Ofast -msse -# 108 -Ofast -march=pentium -msse -# 88 -Ofast -march=pentium3 (this implies -msse) -# 89 -Ofast -march=pentium3 -msse -# -# -# Raspberry Pi, ARM11 (ARMv6 + VFP2) -# gcc (Debian 4.6.3-14+rpi1) 4.6.3 -# -# seconds options, comments -# ------ ----------------- -# 1015 -O2 -# 948 -O3 -# 928 -Ofast -# 937 -Ofast -fmpu=vfp (worse, no option for vfp2) -# -# Are we getting any vectorizing? -# - - - -# -# Release 0.9 added a new feature than can consume a lot of CPU -# power: multiple AFSK demodulators running in parallel. -# These spend a lot of time spinning around in little loops -# calculating the sums of products for the DSP filters. -# -# 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. -# Here we find out if the gcc compiler is generating code -# for the i386. If so, we add the option to assume we will -# have at least a Pentium 3 to run on. -# -# When generating code for the x86_64 target, it is automatically -# assumed that the SSE instructions are available. -# - -# -# You might also get some improvement by using "-march=native" -# to fine tune the application for your particular type of -# hardware. -# -# If you are planning to distribute the binary version to -# other people (in some ham radio software collection), avoid -# fine tuning it for your particular computer. It could -# cause compatibility issues for those with older computers. -# - -CFLAGS := -O3 -pthread -Iutm - -arch := $(shell echo | gcc -E -dM - | grep __i386__) - -ifneq ($(arch),) -# You might see improvement with -march fine tuned to your hardware. -# Probably should keep pentium3 if you will be redistributing binaries -# to other people. -CFLAGS += -march=pentium3 -endif - -# -Ofast is actually similar to -O3 and -ffast-math which has -# has been around a lot longer. -# Add it in if compiler version recognizes it. - -useffast := $(shell gcc --help -v 2>/dev/null | grep ffast-math) -ifneq ($(useffast),) -CFLAGS += -ffast-math -endif - - -#CFLAGS += -D_FORTIFY_SOURCE - - -# If you want to use OSS (for FreeBSD, OpenBSD) instead of -# ALSA (for Linux), comment out - or remove - the two lines below. - -CFLAGS += -DUSE_ALSA -LDLIBS += -lasound - - -# Uncomment following lines to enable GPS interface & tracker function. - -#CFLAGS += -DENABLE_GPS -#LDLIBS += -lgps - - -# Name of current directory. -# Used to generate zip file name for distribution. - -z=$(notdir ${CURDIR}) - - -# Main application. - -direwolf : direwolf.o config.o recv.o demod.o dsp.o demod_afsk.o demod_9600.o hdlc_rec.o \ - hdlc_rec2.o multi_modem.o redecode.o rdq.o rrbb.o dlq.o \ - fcs_calc.o ax25_pad.o \ - decode_aprs.o symbols.o server.o kiss.o kissnet.o kiss_frame.o hdlc_send.o fcs_calc.o \ - gen_tone.o audio.o digipeater.o pfilter.o dedupe.o tq.o xmit.o \ - ptt.o beacon.o dwgps.o encode_aprs.o latlong.o encode_aprs.o latlong.o textcolor.o \ - dtmf.o aprs_tt.o tt_user.o tt_text.o igate.o nmea.o log.o telemetry.o dtime_now.o \ - utm.a - $(CC) $(CFLAGS) -o $@ $^ -lpthread -lrt $(LDLIBS) -lm - - -# Optimization for slow processors. - -demod.o : fsk_fast_filter.h - -demod_afsk.o : fsk_fast_filter.h - - -fsk_fast_filter.h : demod_afsk.c - $(CC) $(CFLAGS) -o gen_fff -DGEN_FFF demod_afsk.c dsp.c textcolor.c -lm - ./gen_fff > fsk_fast_filter.h - - - -utm.a : LatLong-UTMconversion.o - ar -cr $@ $^ - -LatLong-UTMconversion.o : utm/LatLong-UTMconversion.c - $(CC) $(CFLAGS) -c -o $@ $^ - - - - -# A step in the right direction but not sufficient to use /usr instead. - -INSTALLDIR=/usr/local - - -# 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. - -# TODO1.2: Test this better. - - -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' >> $@ - - -# Optional installation into /usr/local/... -# Needs to be run as root or with sudo. -# TODO: Review file locations. - -install : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients log2gpx gen_packets \ - tocalls.txt symbols-new.txt symbolsX.txt dw-icon.png direwolf.desktop - 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 - 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 - install -D --mode=644 CHANGES.txt $(INSTALLDIR)/share/doc/direwolf/CHANGES.txt - 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 - install -D --mode=644 User-Guide.pdf $(INSTALLDIR)/share/doc/direwolf/User-Guide.pdf - install -D --mode=644 Raspberry-Pi-APRS.pdf $(INSTALLDIR)/share/doc/direwolf/Raspberry-Pi-APRS.pdf - install -D --mode=644 Raspberry-Pi-APRS-Tracker.pdf $(INSTALLDIR)/share/doc/direwolf/Raspberry-Pi-APRS-Tracker.pdf - install -D --mode=644 APRStt-Implementation-Notes.pdf $(INSTALLDIR)/share/doc/direwolf/APRStt-Implementation-Notes.pdf - install -D --mode=644 A-Better-APRS-Packet-Demodulator.pdf $(INSTALLDIR)/share/doc/direwolf/A-Better-APRS-Packet-Demodulator.pdf - install -D --mode=644 Quick-Start-Guide-Windows.pdf $(INSTALLDIR)/share/doc/direwolf/Quick-Start-Guide-Windows.pdf - 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 - @echo " " - @echo "If this is your first install, not an upgrade, type this" - @echo "to put a copy of the sample configuration file in your home directory:" - @echo " " - @echo " make -f Makefile.linux install-conf" - @echo " " -ifneq ($(wildcard $(HOME)/Desktop),) - @echo " " - @echo "This will add a desktop icon on some systems:" - @echo " " - @echo " make -f Makefile.linux install-rpi" - @echo " " -endif - - -# These would be done as ordinary user. - -# The Raspberry Pi has ~/Desktop but Ubuntu does not. - -# TODO: Handle Linux variations correctly. - - -install-rpi : dw-start.sh - cp dw-start.sh ~ - ln -f -s /usr/share/applications/direwolf.desktop ~/Desktop/direwolf.desktop - -install-conf : direwolf.conf - cp direwolf.conf ~ - - -# Separate application to decode raw data. - -decode_aprs : decode_aprs.c symbols.c ax25_pad.c textcolor.c fcs_calc.c latlong.c log.c telemetry.o - $(CC) $(CFLAGS) -o decode_aprs -DTEST $^ -lm - - - -# Convert between text and touch tone representation. - -text2tt : tt_text.c - $(CC) $(CFLAGS) -DENC_MAIN -o text2tt tt_text.c - -tt2text : tt_text.c - $(CC) $(CFLAGS) -DDEC_MAIN -o tt2text tt_text.c - - -# Convert between Latitude/Longitude and UTM coordinates. - -ll2utm : ll2utm.c utm.a - $(CC) $(CFLAGS) -o $@ $^ -lm - -utm2ll : utm2ll.c utm.a - $(CC) $(CFLAGS) -o $@ $^ -lm - - -# Convert from log file to GPX. - -log2gpx : log2gpx.c - $(CC) $(CFLAGS) -o $@ $^ -lm - - -# Test application to generate sound. - -gen_packets : gen_packets.c ax25_pad.c hdlc_send.c fcs_calc.c gen_tone.c textcolor.c dsp.c - $(CC) $(CFLAGS) -o $@ $^ $(LDLIBS) -lm - -demod.o : tune.h -demod_afsk.o : tune.h -demod_9600.o : tune.h - -testagc : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o \ - fcs_calc.c ax25_pad.c decode_aprs.c telemetry.c latlong.c symbols.c tune.h textcolor.c - $(CC) $(CFLAGS) -o atest $^ -lm - ./atest 02_Track_2.wav | grep "packets decoded in" > atest.out - - -# Unit test for AFSK demodulator - - -atest : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o \ - fcs_calc.c ax25_pad.c decode_aprs.c telemetry.c latlong.c symbols.c textcolor.c - $(CC) $(CFLAGS) -o $@ $^ -lm -lrt - -# Unit test for inner digipeater algorithm - - -dtest : digipeater.c pfilter.c ax25_pad.c dedupe.c fcs_calc.c tq.c textcolor.c - $(CC) $(CFLAGS) -DTEST -o $@ $^ - ./dtest - - -# Unit test for IGate - - -itest : igate.c textcolor.c ax25_pad.c fcs_calc.c - $(CC) $(CFLAGS) -DITEST -o $@ $^ - ./itest - - -# Unit test for UDP reception with AFSK demodulator - -udptest : udp_test.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c rrbb.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c - $(CC) $(CFLAGS) -o $@ $^ -lm -lrt - ./udptest - - -# Unit test for telemetry decoding. - - -etest : telemetry.c ax25_pad.c fcs_calc.c textcolor.c misc.a regex.a - $(CC) $(CFLAGS) -o $@ $^ -lm -lrt - ./etest - - -# Multiple AGWPE network or serial port clients to test TNCs side by side. - -aclients : aclients.c ax25_pad.c fcs_calc.c textcolor.c - $(CC) $(CFLAGS) -g -o $@ $^ - - -# Touch Tone to Speech sample application. - -ttcalc : ttcalc.o ax25_pad.o fcs_calc.o textcolor.o - $(CC) $(CFLAGS) -g -o $@ $^ - - -depend : $(wildcard *.c) - makedepend -f $(lastword $(MAKEFILE_LIST)) -- $(CFLAGS) -- $^ - - -clean : - rm -f direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_packets ttcalc \ - fsk_fast_filter.h *.o *.a direwolf.desktop - echo " " > tune.h - - -# Package it up for distribution. - -dist-src : CHANGES.txt User-Guide.pdf Quick-Start-Guide-Windows.pdf Raspberry-Pi-APRS.pdf \ - Raspberry-Pi-APRS-Tracker.pdf APRStt-Implementation-Notes.pdf A-Better-APRS-Packet-Demodulator.pdf \ - dw-start.sh dwespeak.bat dwespeak.sh \ - tocalls.txt symbols-new.txt symbolsX.txt direwolf.spec - rm -f fsk_fast_filter.h - echo " " > tune.h - rm -f ../$z-src.zip - egrep '^C|^L' direwolf.txt | cut -c2-999 > direwolf.conf - (cd .. ; zip $z-src.zip \ - $z/CHANGES.txt \ - $z/LICENSE* \ - $z/User-Guide.pdf \ - $z/Raspberry-Pi-APRS.pdf \ - $z/Raspberry-Pi-APRS-Tracker.pdf \ - $z/APRStt-Implementation-Notes.pdf \ - $z/A-Better-APRS-Packet-Demodulator.pdf \ - $z/Makefile* \ - $z/*.c $z/*.h \ - $z/regex/* $z/misc/* $z/utm/* \ - $z/man1/* \ - $z/direwolf.conf $z/direwolf.txt \ - $z/tocalls.txt $z/symbols-new.txt $z/symbolsX.txt \ - $z/dw-icon.png $z/dw-icon.rc $z/dw-icon.ico \ - $z/dw-start.sh $z/direwolf.spec \ - $z/dwespeak.bat $z/dwespeak.sh ) - - - -#User-Guide.pdf : User-Guide.docx -# echo "***** User-Guide.pdf is out of date *****" - -#Quick-Start-Guide-Windows.pdf : Quick-Start-Guide-Windows.docx -# echo "***** Quick-Start-Guide-Windows.pdf is out of date *****" - -#Raspberry-Pi-APRS.pdf : Raspberry-Pi-APRS.docx -# echo "***** Raspberry-Pi-APRS.pdf is out of date *****" - -#Raspberry-Pi-APRS-Tracker.pdf : Raspberry-Pi-APRS-Tracker.docx -# echo "***** Raspberry-Pi-APRS-Tracker.pdf is out of date *****" - -A-Better-APRS-Packet-Demodulator.pdf : A-Better-APRS-Packet-Demodulator.docx -# echo "***** A-Better-APRS-Packet-Demodulator.pdf is out of date *****" - - -backup : - mkdir /cygdrive/e/backup-cygwin-home/`date +"%Y-%m-%d"` - cp -r . /cygdrive/e/backup-cygwin-home/`date +"%Y-%m-%d"` - -# -# The locations below appear to be the most recent. -# The copy at http://www.aprs.org/tocalls.txt is out of date. -# - -tocalls-symbols : - wget http://www.aprs.org/aprs11/tocalls.txt -O tocalls.txt - wget http://www.aprs.org/symbols/symbols-new.txt -O symbols-new.txt - wget http://www.aprs.org/symbols/symbolsX.txt -O symbolsX.txt - - -# -# The following is updated by "make depend" -# -# DO NOT DELETE +# +# Makefile for Linux version of Dire Wolf. +# + +all : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_packets ttcalc direwolf.desktop + @echo " " + @echo "Next step - install with:" + @echo " " + @echo " sudo make -f Makefile.linux install" + @echo " " + +CC = gcc + +# +# The DSP filters can be sped up considerably with the SSE +# instructions. The SSE instructions were introduced in 1999 +# with the Pentium III series. +# SSE2 instructions, added in 2000, don't seem to offer any advantage. +# +# Let's look at impact of various optimization levels. +# +# Benchmark results with Ubuntu gcc version 4.6.3, 32 bit platform. +# Intel(R) Celeron(R) CPU 2.53GHz. Appears to have only 32 bit instructions. +# +# seconds options, comments +# ------ ----------------- +# 123 -O2 +# 128 -O3 Slower than -O2 ? +# 123 -Ofast (should be same as -O3 -ffastmath) +# 126 -Ofast -march=pentium +# 88 -Ofast -msse +# 108 -Ofast -march=pentium -msse +# 88 -Ofast -march=pentium3 (this implies -msse) +# 89 -Ofast -march=pentium3 -msse +# +# +# Raspberry Pi, ARM11 (ARMv6 + VFP2) +# gcc (Debian 4.6.3-14+rpi1) 4.6.3 +# +# seconds options, comments +# ------ ----------------- +# 1015 -O2 +# 948 -O3 +# 928 -Ofast +# 937 -Ofast -fmpu=vfp (worse, no option for vfp2) +# +# Are we getting any vectorizing? +# + + + +# +# Release 0.9 added a new feature than can consume a lot of CPU +# power: multiple AFSK demodulators running in parallel. +# These spend a lot of time spinning around in little loops +# calculating the sums of products for the DSP filters. +# +# 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. +# Here we find out if the gcc compiler is generating code +# for the i386. If so, we add the option to assume we will +# have at least a Pentium 3 to run on. +# +# When generating code for the x86_64 target, it is automatically +# assumed that the SSE instructions are available. +# + +# +# You might also get some improvement by using "-march=native" +# to fine tune the application for your particular type of +# hardware. +# +# If you are planning to distribute the binary version to +# other people (in some ham radio software collection), avoid +# fine tuning it for your particular computer. It could +# cause compatibility issues for those with older computers. +# + +CFLAGS += -march=native -pthread -Iutm + + +arch := $(shell echo | gcc -E -dM - | grep __SSE2__) + +ifneq ($(arch),) +# You might see improvement with -march fine tuned to your hardware. +# Probably should keep pentium3 if you will be redistributing binaries +# to other people. +CFLAGS += -march=native -pthread -Iutm +endif + +# -Ofast is actually similar to -O3 and -ffast-math which has +# has been around a lot longer. +# Add it in if compiler version recognizes it. + +useffast := $(shell gcc --help -v 2>/dev/null | grep ffast-math) +ifneq ($(useffast),) +CFLAGS += -ffast-math +endif + + +#CFLAGS += -D_FORTIFY_SOURCE + + +# If you want to use OSS (for FreeBSD, OpenBSD) instead of +# ALSA (for Linux), comment out - or remove - the two lines below. + +CFLAGS += -DUSE_ALSA +LDLIBS += -lasound + + +# Uncomment following lines to enable GPS interface & tracker function. + +#CFLAGS += -DENABLE_GPS +#LDLIBS += -lgps + + +# Name of current directory. +# Used to generate zip file name for distribution. + +z=$(notdir ${CURDIR}) + + +# Main application. + +direwolf : direwolf.o config.o recv.o demod.o dsp.o demod_afsk.o demod_9600.o hdlc_rec.o \ + hdlc_rec2.o multi_modem.o redecode.o rdq.o rrbb.o dlq.o \ + fcs_calc.o ax25_pad.o \ + decode_aprs.o symbols.o server.o kiss.o kissnet.o kiss_frame.o hdlc_send.o fcs_calc.o \ + gen_tone.o audio.o digipeater.o pfilter.o dedupe.o tq.o xmit.o \ + ptt.o beacon.o dwgps.o encode_aprs.o latlong.o encode_aprs.o latlong.o textcolor.o \ + dtmf.o aprs_tt.o tt_user.o tt_text.o igate.o nmea.o log.o telemetry.o dtime_now.o \ + utm.a + $(CC) $(CFLAGS) -o $@ $^ -lpthread -lrt $(LDLIBS) -lm + + +# Optimization for slow processors. + +demod.o : fsk_fast_filter.h + +demod_afsk.o : fsk_fast_filter.h + + +fsk_fast_filter.h : demod_afsk.c + $(CC) $(CFLAGS) -o gen_fff -DGEN_FFF demod_afsk.c dsp.c textcolor.c -lm + ./gen_fff > fsk_fast_filter.h + + + +utm.a : LatLong-UTMconversion.o + ar -cr $@ $^ + +LatLong-UTMconversion.o : utm/LatLong-UTMconversion.c + $(CC) $(CFLAGS) -c -o $@ $^ + + + + +# A step in the right direction but not sufficient to use /usr instead. + +INSTALLDIR=/usr + + +# 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. + +# TODO1.2: Test this better. + + +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' >> $@ + + +# Optional installation into /usr/local/... +# Needs to be run as root or with sudo. +# TODO: Review file locations. + +install : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients log2gpx gen_packets \ + tocalls.txt symbols-new.txt symbolsX.txt dw-icon.png direwolf.desktop + install -D --mode=755 direwolf $(INSTALLDIR)/bin/direwolf + install -D --mode=755 decode_aprs $(INSTALLDIR)/bin/decode_aprs + install -D --mode=755 text2tt $(INSTALLDIR)/bin/text2tt + install -D --mode=755 tt2text $(INSTALLDIR)/bin/tt2text + install -D --mode=755 ll2utm $(INSTALLDIR)/bin/ll2utm + install -D --mode=755 utm2ll $(INSTALLDIR)/bin/utm2ll + install -D --mode=755 aclients $(INSTALLDIR)/bin/aclients + install -D --mode=755 log2gpx $(INSTALLDIR)/bin/log2gpx + install -D --mode=755 gen_packets $(INSTALLDIR)/bin/gen_packets + install -D --mode=755 atest $(INSTALLDIR)/bin/atest + install -D --mode=755 ttcalc $(INSTALLDIR)/bin/ttcalc + install -D --mode=644 tocalls.txt $(INSTALLDIR)/share/direwolf/tocalls.txt + install -D --mode=644 symbols-new.txt $(INSTALLDIR)/share/direwolf/symbols-new.txt + install -D --mode=644 symbolsX.txt $(INSTALLDIR)/share/direwolf/symbolsX.txt + install -D --mode=644 dw-icon.png $(INSTALLDIR)/share/pixmaps/direwolf/dw-icon.png + install -D --mode=644 direwolf.desktop $(INSTALLDIR)/share/applications/direwolf.desktop + install -D --mode=644 CHANGES.txt $(INSTALLDIR)/share/doc/direwolf/CHANGES.txt + 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 + install -D --mode=644 User-Guide.pdf $(INSTALLDIR)/share/doc/direwolf/User-Guide.pdf + install -D --mode=644 Raspberry-Pi-APRS.pdf $(INSTALLDIR)/share/doc/direwolf/Raspberry-Pi-APRS.pdf + install -D --mode=644 Raspberry-Pi-APRS-Tracker.pdf $(INSTALLDIR)/share/doc/direwolf/Raspberry-Pi-APRS-Tracker.pdf + install -D --mode=644 APRStt-Implementation-Notes.pdf $(INSTALLDIR)/share/doc/direwolf/APRStt-Implementation-Notes.pdf + install -D --mode=644 A-Better-APRS-Packet-Demodulator.pdf $(INSTALLDIR)/share/doc/direwolf/A-Better-APRS-Packet-Demodulator.pdf + install -D --mode=644 Quick-Start-Guide-Windows.pdf $(INSTALLDIR)/share/doc/direwolf/Quick-Start-Guide-Windows.pdf + install -D --mode=644 man1/aclients.1 $(INSTALLDIR)/share/man/man1/aclients.1 + install -D --mode=644 man1/atest.1 $(INSTALLDIR)/share/man/man1/atest.1 + install -D --mode=644 man1/decode_aprs.1 $(INSTALLDIR)/share/man/man1/decode_aprs.1 + install -D --mode=644 man1/direwolf.1 $(INSTALLDIR)/share/man/man1/direwolf.1 + install -D --mode=644 man1/gen_packets.1 $(INSTALLDIR)/share/man/man1/gen_packets.1 + install -D --mode=644 man1/ll2utm.1 $(INSTALLDIR)/share/man/man1/ll2utm.1 + install -D --mode=644 man1/log2gpx.1 $(INSTALLDIR)/share/man/man1/log2gpx.1 + install -D --mode=644 man1/text2tt.1 $(INSTALLDIR)/share/man/man1/text2tt.1 + install -D --mode=644 man1/tt2text.1 $(INSTALLDIR)/share/man/man1/tt2text.1 + install -D --mode=644 man1/utm2ll.1 $(INSTALLDIR)/share/man/man1/utm2ll.1 + @echo " " + @echo "If this is your first install, not an upgrade, type this" + @echo "to put a copy of the sample configuration file in your home directory:" + @echo " " + @echo " make -f Makefile.linux install-conf" + @echo " " +ifneq ($(wildcard $(HOME)/Desktop),) + @echo " " + @echo "This will add a desktop icon on some systems:" + @echo " " + @echo " make -f Makefile.linux install-rpi" + @echo " " +endif + + +# These would be done as ordinary user. + +# The Raspberry Pi has ~/Desktop but Ubuntu does not. + +# TODO: Handle Linux variations correctly. + + +install-rpi : dw-start.sh + cp dw-start.sh ~ + ln -f -s $(INSTALLDIR)/share/applications/direwolf.desktop ~/Desktop/direwolf.desktop + +install-conf : direwolf.conf + install -D --mode=644 direwolf.conf $(INSTALLDIR)/../etc/ax25/direwolf.conf + + +# Separate application to decode raw data. + +decode_aprs : decode_aprs.c symbols.c ax25_pad.c textcolor.c fcs_calc.c latlong.c log.c telemetry.o + $(CC) $(CFLAGS) -o decode_aprs -DTEST $^ -lm + + + +# Convert between text and touch tone representation. + +text2tt : tt_text.c + $(CC) $(CFLAGS) -DENC_MAIN -o text2tt tt_text.c + +tt2text : tt_text.c + $(CC) $(CFLAGS) -DDEC_MAIN -o tt2text tt_text.c + + +# Convert between Latitude/Longitude and UTM coordinates. + +ll2utm : ll2utm.c utm.a + $(CC) $(CFLAGS) -o $@ $^ -lm + +utm2ll : utm2ll.c utm.a + $(CC) $(CFLAGS) -o $@ $^ -lm + + +# Convert from log file to GPX. + +log2gpx : log2gpx.c + $(CC) $(CFLAGS) -o $@ $^ -lm + + +# Test application to generate sound. + +gen_packets : gen_packets.c ax25_pad.c hdlc_send.c fcs_calc.c gen_tone.c textcolor.c dsp.c + $(CC) $(CFLAGS) -o $@ $^ $(LDLIBS) -lm + +demod.o : tune.h +demod_afsk.o : tune.h +demod_9600.o : tune.h + +testagc : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o \ + fcs_calc.c ax25_pad.c decode_aprs.c telemetry.c latlong.c symbols.c tune.h textcolor.c + $(CC) $(CFLAGS) -o atest $^ -lm + ./atest 02_Track_2.wav | grep "packets decoded in" > atest.out + + +# Unit test for AFSK demodulator + + +atest : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o \ + fcs_calc.c ax25_pad.c decode_aprs.c telemetry.c latlong.c symbols.c textcolor.c + $(CC) $(CFLAGS) -o $@ $^ -lm -lrt + +# Unit test for inner digipeater algorithm + + +dtest : digipeater.c pfilter.c ax25_pad.c dedupe.c fcs_calc.c tq.c textcolor.c + $(CC) $(CFLAGS) -DTEST -o $@ $^ + ./dtest + + +# Unit test for IGate + + +itest : igate.c textcolor.c ax25_pad.c fcs_calc.c + $(CC) $(CFLAGS) -DITEST -o $@ $^ + ./itest + + +# Unit test for UDP reception with AFSK demodulator + +udptest : udp_test.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c rrbb.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c + $(CC) $(CFLAGS) -o $@ $^ -lm -lrt + ./udptest + + +# Unit test for telemetry decoding. + + +etest : telemetry.c ax25_pad.c fcs_calc.c textcolor.c misc.a regex.a + $(CC) $(CFLAGS) -o $@ $^ -lm -lrt + ./etest + + +# Multiple AGWPE network or serial port clients to test TNCs side by side. + +aclients : aclients.c ax25_pad.c fcs_calc.c textcolor.c + $(CC) $(CFLAGS) -g -o $@ $^ + + +# Touch Tone to Speech sample application. + +ttcalc : ttcalc.o ax25_pad.o fcs_calc.o textcolor.o + $(CC) $(CFLAGS) -g -o $@ $^ + + +depend : $(wildcard *.c) + makedepend -f $(lastword $(MAKEFILE_LIST)) -- $(CFLAGS) -- $^ + + +clean : + rm -f direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_packets ttcalc \ + fsk_fast_filter.h *.o *.a direwolf.desktop + echo " " > tune.h + + +# Package it up for distribution. + +dist-src : CHANGES.txt User-Guide.pdf Quick-Start-Guide-Windows.pdf Raspberry-Pi-APRS.pdf \ + Raspberry-Pi-APRS-Tracker.pdf APRStt-Implementation-Notes.pdf A-Better-APRS-Packet-Demodulator.pdf \ + dw-start.sh dwespeak.bat dwespeak.sh \ + tocalls.txt symbols-new.txt symbolsX.txt direwolf.spec + rm -f fsk_fast_filter.h + echo " " > tune.h + rm -f ../$z-src.zip + egrep '^C|^L' direwolf.txt | cut -c2-999 > direwolf.conf + (cd .. ; zip $z-src.zip \ + $z/CHANGES.txt \ + $z/LICENSE* \ + $z/User-Guide.pdf \ + $z/Raspberry-Pi-APRS.pdf \ + $z/Raspberry-Pi-APRS-Tracker.pdf \ + $z/APRStt-Implementation-Notes.pdf \ + $z/A-Better-APRS-Packet-Demodulator.pdf \ + $z/Makefile* \ + $z/*.c $z/*.h \ + $z/regex/* $z/misc/* $z/utm/* \ + $z/man1/* \ + $z/direwolf.conf $z/direwolf.txt \ + $z/tocalls.txt $z/symbols-new.txt $z/symbolsX.txt \ + $z/dw-icon.png $z/dw-icon.rc $z/dw-icon.ico \ + $z/dw-start.sh $z/direwolf.spec \ + $z/dwespeak.bat $z/dwespeak.sh ) + + + +#User-Guide.pdf : User-Guide.docx +# echo "***** User-Guide.pdf is out of date *****" + +#Quick-Start-Guide-Windows.pdf : Quick-Start-Guide-Windows.docx +# echo "***** Quick-Start-Guide-Windows.pdf is out of date *****" + +#Raspberry-Pi-APRS.pdf : Raspberry-Pi-APRS.docx +# echo "***** Raspberry-Pi-APRS.pdf is out of date *****" + +#Raspberry-Pi-APRS-Tracker.pdf : Raspberry-Pi-APRS-Tracker.docx +# echo "***** Raspberry-Pi-APRS-Tracker.pdf is out of date *****" + +A-Better-APRS-Packet-Demodulator.pdf : A-Better-APRS-Packet-Demodulator.docx +# echo "***** A-Better-APRS-Packet-Demodulator.pdf is out of date *****" + + +backup : + mkdir /cygdrive/e/backup-cygwin-home/`date +"%Y-%m-%d"` + cp -r . /cygdrive/e/backup-cygwin-home/`date +"%Y-%m-%d"` + +# +# The locations below appear to be the most recent. +# The copy at http://www.aprs.org/tocalls.txt is out of date. +# + +tocalls-symbols : + wget http://www.aprs.org/aprs11/tocalls.txt -O tocalls.txt + wget http://www.aprs.org/symbols/symbols-new.txt -O symbols-new.txt + wget http://www.aprs.org/symbols/symbolsX.txt -O symbolsX.txt + + +# +# The following is updated by "make depend" +# +# DO NOT DELETE + -