-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
50 lines (35 loc) · 1.45 KB
/
Makefile
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
# ========================================================================================
# Makefile for airspy_fft_ws
# ========================================================================================
# ========================================================================================
# Compile flags
ifneq (, $(shell which gcc-8))
CC = gcc-8
else
CC = gcc
endif
COPT = -O3 -march=native -mtune=native
CFLAGS = -Wall -Wextra -Wpedantic -std=gnu11 -D_GNU_SOURCE
CFLAGS += -D BUILD_VERSION="\"$(shell git describe --dirty --always)\"" \
-D BUILD_DATE="\"$(shell date '+%Y-%m-%d_%H:%M:%S')\""
BIN = airspy_fft_ws
# ========================================================================================
# Source files
SRCDIR = .
SRC = $(SRCDIR)/libairspy/libairspy/src/*.c \
$(SRCDIR)/main.c
# ========================================================================================
# External Libraries
LIBSDIR = libwebsockets/build/include
OBSDIR = libwebsockets/build/lib
LIBS = -lm -pthread `pkg-config --libs libairspy` -lusb-1.0 -lfftw3 -Wl,-Bstatic -lwebsockets -Wl,-Bdynamic
CFLAGS += `pkg-config --cflags libairspy`
# ========================================================================================
# Makerules
all:
@pkg-config --modversion "libairspy = 1.0"
$(CC) $(COPT) $(CFLAGS) $(SRC) -o $(BIN) -I $(LIBSDIR) -L $(OBSDIR) $(LIBS)
debug: COPT = -Og -ggdb -fno-omit-frame-pointer -D__DEBUG
debug: all
clean:
rm -fv $(BIN)