-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile.inc
62 lines (59 loc) · 1.3 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
BUILD_SUFFIX=debug
OPTFLAGS=-ggdb3 -O0 -fno-inline
FEAT_FLAGS=-fPIC
ifeq ($(MAKECMDGOALS), opt)
BUILD_SUFFIX=opt
OPTFLAGS=-O2
endif
ifeq ($(MAKECMDGOALS), optlto)
BUILD_SUFFIX=opt
OPTFLAGS=-O2 -flto
endif
ifeq ($(MAKECMDGOALS), prof)
BUILD_SUFFIX=prof
OPTFLAGS=-O2 -pg
endif
ifeq ($(MAKECMDGOALS), proflto)
BUILD_SUFFIX=prof
OPTFLAGS=-O2 -pg -flto
endif
ifeq ($(MAKECMDGOALS), eopt)
BUILD_SUFFIX=opt
OPTFLAGS=-O3
endif
ifeq ($(MAKECMDGOALS), eoptlto)
BUILD_SUFFIX=opt
OPTFLAGS=-O3 -flto
endif
ifeq ($(MAKECMDGOALS), eprof)
BUILD_SUFFIX=prof
OPTFLAGS=-O3 -pg
endif
ifeq ($(MAKECMDGOALS), eproflto)
BUILD_SUFFIX=prof
OPTFLAGS=-O3 -pg -flto
endif
ifeq ($(MAKECMDGOALS), gperf)
BUILD_SUFFIX=prof
OPTFLAGS=-O3
LINKFLAGS+=-lprofiler
endif
CXX=g++
CC=$(CXX)
LD=$(CXX)
CXXFLAGS+=-Wall -pedantic -Wno-write-strings -Wno-unused-function -D__STDC_LIMIT_MACROS
CXXFLAGS+=-pipe -std=c++11
CXXFLAGS+= -I $(HOME)/prefix/include
LINKFLAGS+=-L $(HOME)/prefix/lib
CXXFLAGS+=$(FEAT_FLAGS)
AR=ar
ARFLAGS=rcs
BISON=bison -v
FLEX=flex
CXXPRINTNAME="[CXX:$(PROJECT_NAME)]"
ARPRINTNAME="[AR:$(PROJECT_NAME)]"
LDPRINTNAME="[LD:$(PROJECT_NAME)]"
DEPPRINTNAME="[DEP:$(PROJECT_NAME)]"
BISONPRINTNAME="[bison:$(PROJECT_NAME)]"
FLEXPRINTNAME="[flex:$(PROJECT_NAME)]"
.PHONY: debug clean opt prof all default eprof eopt optlto proflto eoptlto eproflto