-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.include
57 lines (46 loc) · 1.29 KB
/
Makefile.include
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
57
#BASEPATH_ := $(dir $(realpath $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))))
BASEPATH_ := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
CC ?= gcc
M4 ?= m4
SCAN_BUILD ?= scan-build
PYTHON2 ?= python2
SYSTEM = $(shell uname)
SYSTEM_LDFLAGS =
CONFIG_FLAGS =
DEBUG ?= no
PROFIL ?= no
WERROR ?= no
ifeq '$(PROFIL)' 'yes'
DEBUG = yes
endif
ifeq '$(DEBUG)' 'yes'
CFLAGS = -g -Wno-unused-function
CONFIG_FLAGS += -DDEBUG
else
# force to use optimizations
CFLAGS += -O3
endif
ifeq '$(PROFIL)' 'yes'
CFLAGS += -pg
endif
CFLAGS += -Wall -pedantic --std=gnu99
ifeq '$(WERROR)' 'yes'
CFLAGS += -Werror
endif
LDFLAGS += -pthread
LDFLAGS += $(SYSTEM_LDFLAGS)
OPTS_CFLAGS ?=
OPTS_LDFLGS ?=
USE_LOCAL_OPTS ?= $(shell if test -f $(BASEPATH_)/third-party/opts/libopts.a; then echo "yes"; else echo "no"; fi;)
ifeq '$(USE_LOCAL_OPTS)' 'yes'
OPTS_CFLAGS := -I$(BASEPATH_)/third-party/opts
OPTS_LDFLAGS := -L$(BASEPATH_)/third-party/opts -lopts
endif
BORUVKA_CFLAGS ?=
BORUVKA_LDFLAGS ?=
USE_LOCAL_BORUVKA ?= $(shell if test -f $(BASEPATH_)/third-party/boruvka/libboruvka.a; then echo "yes"; else echo "no"; fi;)
ifeq '$(USE_LOCAL_BORUVKA)' 'yes'
BORUVKA_CFLAGS := -I$(BASEPATH_)/third-party/boruvka
BORUVKA_LDFLAGS := -L$(BASEPATH_)/third-party/boruvka -lboruvka
endif
.DEFAULT_GOAL := all