forked from EmbeddedRPC/erpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flags.mk
85 lines (73 loc) · 2.56 KB
/
flags.mk
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#-------------------------------------------------------------------------------
# Copyright (C) 2014 Freescale Semiconductor, Inc.
# Copyright 2016 NXP
# All Rights Reserved.
#
# THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
# SHALL FREESCALE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
# OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
# OF SUCH DAMAGE.
#-------------------------------------------------------------------------------
#-----------------------------------------------
# Include path. Add the include paths like this:
# INCLUDES += ./include/
#-----------------------------------------------
#Force compilation to 32 or 64 bit architectures
#-m32 or -m64
ifeq "$(is_darwin)" "1"
MARCH ?= -m64
else
MARCH ?= # -m32 or -m64
endif
CXXFLAGS += -std=gnu++17 -Wunused-variable -Wno-deprecated-register -Wno-narrowing -Werror $(MARCH)
#CXXFLAGS += -Wall -Wextra -Wshadow -pedantic-errors
CFLAGS += -std=gnu17 -Werror $(MARCH)
YYFLAGS += -Wno-other # --debug --verbose
LLFLAGS +=
LDFLAGS += $(MARCH)
# do not cause the "free nonheap object"-waning to cause an error
# code generated by bison may cause gcc11 to errornously detect such a condition.
ifneq "$(is_darwin)" "1"
ifeq "$(CXX)" "g++"
CXXFLAGS += -Wno-free-nonheap-object
endif
endif
# This is the defualt installation location by home brew.
ifeq "$(is_darwin)" "1"
LDFLAGS += -L$(FLEX_ROOT)/lib
INCLUDES += $(FLEX_ROOT)/include
endif
# Need to pass the -U option to GNU ar to turn off deterministic mode, or
# we'll get a warning.
ifneq "$(is_darwin)" "1"
ARFLAGS = -rcsU
else
ARFLAGS = -rcs
endif
ifeq "$(build)" "release"
DEBUG_OR_RELEASE := Release
CFLAGS += -Os -DNDEBUG
CXXFLAGS += -Os -DNDEBUG
else
DEBUG_OR_RELEASE := Debug
CFLAGS += -g3 -O0 -DDEBUG -DYYDEBUG=1
CXXFLAGS += -g3 -O0 -DDEBUG -DYYDEBUG=1
endif
ifneq "$(is_cygwin)" "1"
LIBRARIES += -lstdc++
endif
ifeq "$(is_linux)" "1"
LIBRARIES += -lpthread -lrt
endif
LIBRARIES += -lm
ifeq "$(is_mingw)" "1"
LIBRARIES += -pthread -lws2_32
else
LIBRARIES += -lc
endif