-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.inc
41 lines (32 loc) · 1.1 KB
/
Makefile.inc
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
# define to "" to produce verbose output
ifndef VERBOSE
co := @
silence := --silence-errors
endif
c_opts := -fdata-sections -ffunction-sections -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE # -DSPDLOG_FMT_EXTERNAL
ifdef DEBUG
c_opts += -g
silence := --silence-errors
else
c_opts += -O3
endif
C := gcc -Wall ${c_opts}
CPP := g++ -std=c++17 -fPIE -Wall ${c_opts}
# compile x86 simulator or real cRIO stuff
ifdef SIMULATOR
CPP += -pedantic -DSIMULATOR
else
C += -fmessage-length=0
CPP += -fmessage-length=0
m1m3cli := m1m3cli
endif
PKG_LIBS := $(shell pkg-config yaml-cpp --libs $(silence)) \
$(shell pkg-config spdlog --libs $(silence)) \
$(shell pkg-config fmt --libs $(silence))
LIBS += $(PKG_LIBS) -ldl -lpthread
PKG_CPP_FLAGS := $(shell pkg-config yaml-cpp --cflags $(silence)) \
$(shell pkg-config spdlog --cflags $(silence)) \
$(shell pkg-config fmt --cflags $(silence))
CPP_FLAGS += $(PKG_CPP_FLAGS)
VERSION := $(shell git describe --tags --dirty 2>/dev/null || echo "unknown:non-git")
GIT_HASH := $(shell git rev-parse HEAD 2>/dev/null || echo "unknown-non-git")