forked from Nuand/bladeRF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
44 lines (33 loc) · 1.19 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
################################################################################
# bladeRF applications and utilities
#
# Temporary Makefile until we get an autotools-based build in place
#
# If you don't have libbladeRF installed on your system provide
# CFLAGS_LIBBLADERF and LDFLAGS_LIBBLADERF at build-time. Be aware that
# the build dives down a couple dirs, so either adjust your relative
# paths accordingly, or use absolute paths (preferred)
################################################################################
SRC_DIR := src
BIN_DIR := bin
APPS := cli
CFLAGS_LIBBLADERF ?= $(shell pkg-config --cflags libbladeRF)
CFLAGS := -Wall -Wextra -Wno-unused-parameter -std=gnu99 -D_GNU_SOURCE \
$(CFLAGS_LIBBLADERF)
LDFLAGS_LIBBLADERF ?= $(shell pkg-config --libs libbladeRF)
LDFLAGS := $(LDFLAGS_LIBBLADERF)
ifdef DEBUG
CFLAGS += -O0 -ggdb3 -DDEBUG
else
CFLAGS += -O2 -DNDEBUG
endif
all: $(APPS)
$(APPS): % : $(BIN_DIR)/% $(BIN_DIR)
$(BIN_DIR):
mkdir -p $(BIN_DIR)
$(BIN_DIR)/% : $(BIN_DIR)
$(MAKE) -C $(SRC_DIR)/$(notdir $@) \
BIN_DIR="$(abspath $(dir $@))" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" INTERACTIVE="$(INTERACTIVE)"
clean:
rm -rf $(BIN_DIR)
$(MAKE) -C $(SRC_DIR)/cli clean