-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmakefrag
More file actions
64 lines (55 loc) · 2.53 KB
/
Copy pathmakefrag
File metadata and controls
64 lines (55 loc) · 2.53 KB
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
# USAGE:
# Set Environment Variables:
# EXTENDED_WARNINGS=1
# for stricter warnings and
#
# WARNINGS_ERROR=1
# for -Werror
CFLAGS += -std=c++17
UNAME_S := $(shell uname -s)
#Currently forcing clang interface on OS X! Otherwise OMNeT++ will use gcc wrapper of clang
ifeq ($(UNAME_S),Darwin)
CC = clang
CXX = clang++
SHLIB_LD = clang++ -shared -fPIC
endif
#Special Flags for OS X
ifeq ($(UNAME_S),Darwin)
LDFLAGS += -headerpad_max_install_names
endif
#Warnings generate errors
ifdef WARNINGS_ERROR
CFLAGS += -Werror
endif
#Stricter warnings in clang and gcc:
ifeq ($(CC),clang)
#clang
ifdef EXTENDED_WARNINGS
CFLAGS += -Wall -Wunused -Wextra -Weverything
endif
CFLAGS += -Wno-padded -Wno-global-constructors -Wno-exit-time-destructors
CFLAGS += -Wno-c++98-compat-pedantic -Wno-unknown-pragmas -Wno-unknown-warning-option
CFLAGS += -Wno-error=unused-parameter -Wno-error=header-hygiene -Wno-error=documentation -Wno-error=c++98-compat-pedantic
CFLAGS += -Wno-error=shadow -Wno-error=missing-noreturn -Wno-error=unreachable-code -Wno-error=unreachable-code-return -Wno-error=old-style-cast
CFLAGS += -Wno-error=conversion -Wno-error=unreachable-code-break -Wno-error=documentation-unknown-command -Wno-error=reserved-id-macro
else ifeq ($(CC),gcc)
#gcc
ifdef EXTENDED_WARNINGS
CFLAGS += -Wall -Wunused -Wextra -Winit-self -Wswitch-enum -Wuninitialized -Wfloat-equal -Wsuggest-attribute=pure
CFLAGS += -Wsuggest-attribute=const -Wsuggest-attribute=noreturn -Wsuggest-attribute=format -Wconversion -Wuseless-cast
CFLAGS += -Wshadow
#CFLAGS += -ansi -pedantic-errors
endif
CFLAGS += -Wno-unknown-pragmas -Wno-error=unused-parameter -Wno-error=conversion -Wno-error=suggest-attribute=noreturn
CFLAGS += -Wno-error=shadow
endif
# add -isystem for referenced projects (-I will be ignored for those also provided with -Isystem)
RELPRJDOTS = $(subst o,,$(subst o ,/,$(patsubst %,..o,$(subst /, ,$(PROJECTRELATIVE_PATH)))))
ifneq (,$(findstring MSYS,$(shell uname -s)))
# on windows we need this hack for pathes like -Id:/...
SYSINCLUDES := $(shell echo '$(subst -I$(RELPRJDOTS)/.,-isystem $(RELPRJDOTS)/.,$(INCLUDE_PATH))' |sed -e 's/-I\($(subst \| ,\|,$(addsuffix \|,$(filter %:,$(subst :,: ,$(patsubst -I%,%,$(INCLUDE_PATH))))) \/)\)/-isystem \1/g')
else
# on unix we can use this
SYSINCLUDES := $(subst -I/,-isystem /,$(subst -I$(RELPRJDOTS)/.,-isystem $(RELPRJDOTS)/.,$(INCLUDE_PATH)))
endif
COPTS += $(SYSINCLUDES) -isystem $(OMNETPP_INCL_DIR)