-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathMakefile.inc
39 lines (30 loc) · 832 Bytes
/
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
######################
#
# Highlevel configuration options for all
#
#
# activate debugging with 1 or deactivate with 0
DEBUG ?= 1
######################
#
# Lowlevel options and rules
#
ifeq ($(DEBUG),0)
STRIP ?= strip
else
STRIP ?= :
endif
GITVERSION = $(shell git describe --dirty='-dirty')
# we expect the version to be like 'v0.5.3-27-g0c2727a' and then strip the 'v',
# and the '-27-g0c2727a' parts
VERSION=$(shell git describe | \
sed -r -e 's/^([^[:digit:]]+)(.*)/\2/' \
-e 's/^([^-]+)(.*)/\1/' | \
grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+')
# protect against no version number
ifeq ($(strip $(VERSION)),)
VERSION=0.0.0
endif
CC ?= gcc
CCFLAGS += -fPIC -O2 -Wall -Wextra -Wformat=2 -Winit-self \
-Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Werror