# # Makefile for Linux version of Dire Wolf. # all : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients log2gpx 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. # # If you are using gcc version 4.6 or later, you might get a # small improvement by using the new "-Ofast" option that is # not available in older compilers. # "-O3" is used here for compatibility with older compilers. # # 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. # 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 := -O3 -march=pentium3 -pthread -Iutm else CFLAGS := -O3 -pthread -Iutm endif # If you want to use OSS (for FreeBSD, OpenBSD) instead of # ALSA (for Linux), comment out 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 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 \ 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 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 \ 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 $@ $^ # Optional installation into /usr/local/... # Needs to be run as root or with sudo. # TODO: Review file locations. install : direwolf decode_aprs tocalls.txt symbols-new.txt symbolsX.txt dw-icon.png direwolf.desktop install direwolf /usr/local/bin install decode_aprs /usr/local/bin install text2tt /usr/local/bin install tt2text /usr/local/bin install ll2utm /usr/local/bin install utm2ll /usr/local/bin install aclients /usr/local/bin install log2gpx /usr/local/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 /usr/local/share/doc/direwolf/CHANGES.txt install -D --mode=644 LICENSE-dire-wolf.txt /usr/local/share/doc/direwolf/LICENSE-dire-wolf.txt install -D --mode=644 LICENSE-other.txt /usr/local/share/doc/direwolf/LICENSE-other.txt install -D --mode=644 User-Guide.pdf /usr/local/share/doc/direwolf/User-Guide.pdf install -D --mode=644 Raspberry-Pi-APRS.pdf /usr/local/share/doc/direwolf/Raspberry-Pi-APRS.pdf install -D --mode=644 Raspberry-Pi-APRS-Tracker.pdf /usr/local/share/doc/direwolf/Raspberry-Pi-APRS-Tracker.pdf install -D --mode=644 APRStt-Implementation-Notes.pdf /usr/local/share/doc/direwolf/APRStt-Implementation-Notes.pdf install -D --mode=644 Quick-Start-Guide-Windows.pdf /usr/local/share/doc/direwolf/Quick-Start-Guide-Windows.pdf # 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 $(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 time ./atest ../direwolf-0.2/02_Track_2.wav # Unit test for inner digipeater algorithm dtest : digipeater.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 $@ $^ SRCS = direwolf.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c multi_modem.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c \ server.c kiss.c kissnet.c kiss_frame.c hdlc_send.c fcs_calc.c gen_tone.c audio.c \ digipeater.c dedupe.c tq.c xmit.c beacon.c encode_aprs.c latlong.c encode_aprs.c latlong.c telemetry.c log.c depend : $(SRCS) makedepend $(INCLUDES) $^ clean : rm -f direwolf decode_aprs text2tt tt2text ll2utm utm2ll fsk_fast_filter.h *.o *.a 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 direwolf.desktop dw-start.sh rm -f fsk_fast_filter.h echo " " > tune.h rm -f ../$z-src.zip (cd .. ; zip $z-src.zip $z/CHANGES.txt $z/LICENSE* \ $z/User-Guide.pdf $z/Quick-Start-Guide-Windows.pdf $z/Raspberry-Pi-APRS.pdf Raspberry-Pi-APRS-Tracker.pdf \ $z/Makefile* $z/*.c $z/*.h $z/regex/* $z/misc/* $z/utm/* \ $z/*.conf $z/tocalls.txt $z/symbols-new.txt $z/symbolsX.txt \ $z/dw-icon.png $z/dw-icon.rc $z/dw-icon.ico \ $z/direwolf.desktop $z/dw-start.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 *****" 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