diff --git a/Makefile.macosx b/Makefile.macosx index b6330da7..bcc70e67 100644 --- a/Makefile.macosx +++ b/Makefile.macosx @@ -11,38 +11,11 @@ all : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_packets ttcalc direwolf.conf - @echo " " - @echo "Next step install with: " - @echo " " - @echo " sudo make install" - @echo " " - @echo "System SDK's (10.8 - 10.10) must be located here to make use of them. " - @echo " /Developer/SDKs " - @echo " " -SYS_LIBS := -SYS_MIN := -SDK := $(shell find /Developer -maxdepth 1 -type d -name "SDKs") -#$(info $$SDK = ${SDK}) -ifeq (${SDK},/Developer/SDKs) - SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.8.sdk") - ifeq (${SDK},/Developer/SDKs/MacOSX10.8.sdk) - SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.8.sdk - SYS_MIN := -mmacosx-version-min=10.8 - else - SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.9.sdk") - ifeq (${SDK},/Developer/SDKs/MacOSX10.9.sdk) - SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.9.sdk - SYS_MIN := -mmacosx-version-min=10.9 - else - SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.10.sdk") - ifeq (${SDK},/Developer/SDKs/MacOSX10.10.sdk) - SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.10.sdk - SYS_MIN := -mmacosx-version-min=10.10 - endif - endif - endif -endif +SDK_PATH := $(shell xcrun --show-sdk-path) +SDK_VERSION := $(shell xcrun --show-sdk-version) +SYS_LIBS := -isystem ${SDK_PATH} +SYS_MIN := -mmacosx-version-min=${SDK_VERSION} EXTRA_CFLAGS := DARWIN_CC := $(shell which clang) @@ -53,12 +26,7 @@ else EXTRA_CFLAGS := -fvectorize -fslp-vectorize -fslp-vectorize-aggressive -pthread endif -# Change as required in support of the available libraries - -#CC := $(DARWIN_CC) -m64 $(SYS_LIBS) $(SYS_MIN) -CC := $(DARWIN_CC) -m32 $(SYS_LIBS) $(SYS_MIN) CFLAGS := -Os -pthread -Igeotranz $(EXTRA_CFLAGS) -# $(info $$CC is [${CC}]) # # The DSP filters spend a lot of time spinning around in little @@ -183,12 +151,14 @@ LDLIBS += -framework Foundation -framework CoreServices CFLAGS += -DUSE_PORTAUDIO -I/opt/local/include -# Uncomment following lines to enable GPS interface & tracker function. -# Not available for MacOSX. -# Although MacPorts has gpsd, wonder if it's the same thing. -#CFLAGS += -DENABLE_GPSD -#LDLIBS += -lgps +# Enable GPS interface and tracker function if the gpsd package is installed. + +ifeq ($(shell which -s gpsd),) + CFLAGS += -DENABLE_GPSD + LDLIBS += -lgps +endif + # Name of current directory. # Used to generate zip file name for distribution. @@ -433,7 +403,7 @@ testagc : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.o atest : atest.c fsk_fast_filter.h 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 dwgpsnmea.o dwgps.o serial_port.o telemetry.c latlong.c symbols.c textcolor.c tt_text.c - $(CC) $(CFLAGS) -o $@ $^ -lm + $(CC) $(CFLAGS) $^ -lm # Unit test for inner digipeater algorithm @@ -491,8 +461,9 @@ depend : $(wildcard *.c) .PHONY: clean clean : - rm -f direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_packets ttcalc \ + rm -f direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_fff gen_packets ttcalc \ fsk_fast_filter.h *.o *.a + rm -rf aclients.dSYM echo " " > tune.h