-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (43 loc) · 1.8 KB
/
Makefile
File metadata and controls
56 lines (43 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
CC ?= clang
CFLAGS = -O3 -std=gnu17 -Wall -Wextra -Wno-unused-parameter -MMD
LIBS = -lusb-1.0 -lrtlsdr -lpthread -lfftw3f -lcurl -lm
# Note
# gcc is a bit faster that clang on this app
# for dbg: -fsanitize=address
ifeq ($(findstring armv6, $(shell uname -m)), armv6)
# Broadcom BCM2835 SoC with 700 MHz 32-bit ARM 1176JZF-S (ARMv6 arch)
# Used in Raspberry Pi1 (A,A+,B,B+), Pi-Zero, Pi-Zero W, Pi-Compute-Module1
EXTRA_OPTS = -DRPI1 --target=arm-linux-gnueabihf -mcpu=arm1176jzf-s -mfloat-abi=hard
endif
ifeq ($(findstring armv7, $(shell uname -m)), armv7)
# Broadcom BCM2836 SoC with 900 MHz 32-bit quad-core ARM Cortex-A7 (ARMv7 arch)
# Used in Raspberry Pi 2 Model B
# Broadcom BCM2837 SoC with 1.2 GHz 64-bit quad-core ARM Cortex-A53 (ARMv8 arch)
# Used in Raspberry Pi 3 Model B +later models of the Raspberry Pi 2 Model B,
# and Pi-Compute-Module3.
EXTRA_OPTS = -DRPI23
endif
ifeq ($(findstring aarch64, $(shell uname -m)), aarch64)
# 64-bit ARM (Raspberry Pi 4/5 with 64-bit OS, etc.)
EXTRA_OPTS = -DRPI23
endif
OBJS = rtlsdr_wsprd.o wsprd/wsprd.o wsprd/wsprsim_utils.o wsprd/wsprd_utils.o wsprd/tab.o wsprd/fano.o wsprd/nhash.o
TEST_OBJS = tests/test_wsprd.o wsprd/wsprsim_utils.o wsprd/wsprd_utils.o wsprd/tab.o wsprd/fano.o wsprd/nhash.o
DEPS = $(OBJS:.o=.d) $(TEST_OBJS:.o=.d)
TARGETS = rtlsdr_wsprd
.PHONY: all clean install test
all: $(TARGETS)
%.o: %.c
${CC} ${CFLAGS} $(EXTRA_OPTS) -c $< -o $@
rtlsdr_wsprd: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
tests/test_wsprd: $(TEST_OBJS)
$(CC) $(LDFLAGS) -o $@ $^ -lm
test: all tests/test_wsprd
./tests/test_wsprd
./tests/run_tests.sh
-include $(DEPS)
clean:
rm -f *.o wsprd/*.o tests/*.o *.d wsprd/*.d tests/*.d $(TARGETS) tests/test_wsprd fftw_wisdom.dat hashtable.txt selftest.iq
install:
install rtlsdr_wsprd /usr/local/bin/rtlsdr_wsprd