@@ -55,7 +55,6 @@ ifeq ($(UNAME), Linux)
5555 LIBS += -lrt
5656 LIBS_USB += -lusb-1.0
5757 LIBS_CURSES := -lncurses
58- CPUFEATURES ?= yes
5958endif
6059
6160ifeq ($(UNAME ) , Darwin)
@@ -70,10 +69,6 @@ ifeq ($(UNAME), Darwin)
7069 endif
7170 LIBS_USB += -lusb-1.0
7271 LIBS_CURSES := -lncurses
73- # cpufeatures reportedly does not work (yet) on darwin arm64
74- ifneq ($(ARCH),arm64)
75- CPUFEATURES ?= yes
76- endif
7772endif
7873
7974ifeq ($(UNAME ) , OpenBSD)
@@ -97,13 +92,6 @@ ifeq ($(UNAME), NetBSD)
9792 LIBS_CURSES := -lcurses
9893endif
9994
100- CPUFEATURES ?= no
101-
102- ifeq ($(CPUFEATURES ) ,yes)
103- include Makefile.cpufeatures
104- DUMP1090_CPPFLAGS += -DENABLE_CPUFEATURES -Icpu_features/include
105- endif
106-
10795RTLSDR ?= yes
10896BLADERF ?= yes
10997
@@ -172,35 +160,30 @@ endif
172160# # starch (runtime DSP code selection) mix, architecture-specific
173161# #
174162
175- ifneq ($(CPUFEATURES ) ,yes)
176- # need to be able to detect CPU features at runtime to enable any non-standard compiler flags
163+ ifeq ($(ARCH ) ,x86_64)
164+ # AVX, AVX2
165+ STARCH_MIX := x86
166+ DUMP1090_CPPFLAGS += -DSTARCH_MIX_X86
167+ else ifeq ($(ARCH),amd64)
168+ # this is the Debian naming of x86_64
169+ STARCH_MIX := x86
170+ DUMP1090_CPPFLAGS += -DSTARCH_MIX_X86
171+ else ifeq ($(findstring aarch,$(ARCH)),aarch)
172+ STARCH_MIX := aarch64
173+ DUMP1090_CPPFLAGS += -DSTARCH_MIX_AARCH64
174+ else ifeq ($(findstring arm64,$(ARCH)),arm64)
175+ # Apple calls this arm64, not aarch64
176+ STARCH_MIX := aarch64
177+ DUMP1090_CPPFLAGS += -DSTARCH_MIX_AARCH64
178+ else ifeq ($(findstring arm,$(ARCH)),arm)
179+ # ARMv7 NEON
180+ STARCH_MIX := arm
181+ DUMP1090_CPPFLAGS += -DSTARCH_MIX_ARM
182+ else
177183 STARCH_MIX := generic
178184 DUMP1090_CPPFLAGS += -DSTARCH_MIX_GENERIC
179- else
180- ifeq ($(ARCH),x86_64)
181- # AVX, AVX2
182- STARCH_MIX := x86
183- DUMP1090_CPPFLAGS += -DSTARCH_MIX_X86
184- else ifeq ($(ARCH),amd64)
185- # this is the Debian naming of x86_64
186- STARCH_MIX := x86
187- DUMP1090_CPPFLAGS += -DSTARCH_MIX_X86
188- else ifeq ($(findstring aarch,$(ARCH)),aarch)
189- STARCH_MIX := aarch64
190- DUMP1090_CPPFLAGS += -DSTARCH_MIX_AARCH64
191- else ifeq ($(findstring arm64,$(ARCH)),arm64)
192- # Apple calls this arm64, not aarch64
193- STARCH_MIX := aarch64
194- DUMP1090_CPPFLAGS += -DSTARCH_MIX_AARCH64
195- else ifeq ($(findstring arm,$(ARCH)),arm)
196- # ARMv7 NEON
197- STARCH_MIX := arm
198- DUMP1090_CPPFLAGS += -DSTARCH_MIX_ARM
199- else
200- STARCH_MIX := generic
201- DUMP1090_CPPFLAGS += -DSTARCH_MIX_GENERIC
202- endif
203185endif
186+
204187all : showconfig dump1090 view1090 starch-benchmark
205188
206189ALL_CCFLAGS := $(CPPFLAGS ) $(DUMP1090_CPPFLAGS ) $(CFLAGS ) $(DUMP1090_CFLAGS )
@@ -222,7 +205,7 @@ showconfig:
222205% .o : % .c * .h
223206 $(CC ) $(ALL_CCFLAGS ) -c $< -o $@
224207
225- dump1090 : dump1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o ais_charset.o adaptive.o $(SDR_OBJ ) $(COMPAT ) $(CPUFEATURES_OBJS ) $( STARCH_OBJS )
208+ dump1090 : dump1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o demod_2400.o stats.o cpr.o icao_filter.o track.o util.o convert.o ais_charset.o adaptive.o $(SDR_OBJ ) $(COMPAT ) $(STARCH_OBJS )
226209 $(CC ) -g -o $@ $^ $(LDFLAGS ) $(LIBS ) $(LIBS_SDR ) $(LIBS_CURSES )
227210
228211view1090 : view1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o ais_charset.o sdr_stub.o $(COMPAT )
@@ -231,11 +214,11 @@ view1090: view1090.o anet.o interactive.o mode_ac.o mode_s.o comm_b.o net_io.o c
231214faup1090 : faup1090.o anet.o mode_ac.o mode_s.o comm_b.o net_io.o crc.o stats.o cpr.o icao_filter.o track.o util.o ais_charset.o sdr_stub.o $(COMPAT )
232215 $(CC ) -g -o $@ $^ $(LDFLAGS ) $(LIBS )
233216
234- starch-benchmark : cpu.o dsp/helpers/tables.o $(CPUFEATURES_OBJS ) $( STARCH_OBJS ) $(STARCH_BENCHMARK_OBJ )
217+ starch-benchmark : cpu.o dsp/helpers/tables.o $(STARCH_OBJS ) $(STARCH_BENCHMARK_OBJ )
235218 $(CC ) -g -o $@ $^ $(LDFLAGS ) $(LIBS )
236219
237220clean :
238- rm -f * .o oneoff/* .o compat/clock_gettime/* .o compat/clock_nanosleep/* .o cpu_features/src/* .o dsp/generated/* .o dsp/helpers/* .o $( CPUFEATURES_OBJS ) dump1090 view1090 faup1090 cprtests crctests oneoff/convert_benchmark oneoff/decode_comm_b oneoff/dsp_error_measurement oneoff/uc8_capture_stats starch-benchmark
221+ rm -f * .o oneoff/* .o compat/clock_gettime/* .o compat/clock_nanosleep/* .o cpu_features/src/* .o dsp/generated/* .o dsp/helpers/* .o dump1090 view1090 faup1090 cprtests crctests oneoff/convert_benchmark oneoff/decode_comm_b oneoff/dsp_error_measurement oneoff/uc8_capture_stats starch-benchmark
239222
240223test : cprtests starch-benchmark
241224 ./cprtests
@@ -250,13 +233,13 @@ crctests: crc.c crc.h
250233benchmarks : oneoff/convert_benchmark
251234 oneoff/convert_benchmark
252235
253- oneoff/convert_benchmark : oneoff/convert_benchmark.o convert.o util.o dsp/helpers/tables.o cpu.o $(CPUFEATURES_OBJS ) $( STARCH_OBJS )
236+ oneoff/convert_benchmark : oneoff/convert_benchmark.o convert.o util.o dsp/helpers/tables.o cpu.o $(STARCH_OBJS )
254237 $(CC ) $(ALL_CCFLAGS ) -g -o $@ $^ -lm -lpthread
255238
256239oneoff/decode_comm_b : oneoff/decode_comm_b.o comm_b.o ais_charset.o
257240 $(CC ) $(ALL_CCFLAGS ) -g -o $@ $^ -lm
258241
259- oneoff/dsp_error_measurement : oneoff/dsp_error_measurement.o dsp/helpers/tables.o cpu.o $(CPUFEATURES_OBJS ) $( STARCH_OBJS )
242+ oneoff/dsp_error_measurement : oneoff/dsp_error_measurement.o dsp/helpers/tables.o cpu.o $(STARCH_OBJS )
260243 $(CC ) $(ALL_CCFLAGS ) -g -o $@ $^ -lm
261244
262245oneoff/uc8_capture_stats : oneoff/uc8_capture_stats.o
0 commit comments