forked from Omega-Numworks/Omega
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefaults.mak
79 lines (68 loc) · 1.5 KB
/
defaults.mak
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
HOSTCC = gcc
HOSTCXX = g++
PYTHON = python3
ifdef OMEGA_USERNAME
SFLAGS += -DOMEGA_USERNAME="$(OMEGA_USERNAME)"
endif
SFLAGS += -DEPSILON_GETOPT=$(EPSILON_GETOPT)
SFLAGS += -DEPSILON_TELEMETRY=$(EPSILON_TELEMETRY)
SFLAGS += -DESCHER_LOG_EVENTS_BINARY=$(ESCHER_LOG_EVENTS_BINARY)
# Language-specific flags
CFLAGS = -std=c99
CXXFLAGS = -std=c++11 -fno-exceptions -fno-rtti -fno-threadsafe-statics
# Flags - Optimizations
ifeq ($(DEBUG),1)
SFLAGS += -O0 -g
else
SFLAGS += -Os
SFLAGS += -DNDEBUG
endif
ifeq ($(ASAN),1)
SFLAGS += -fsanitize=address
LDFLAGS += -fsanitize=address
endif
# Flags - Header search path
SFLAGS += -Ilib -I.
# Flags - Building options
SFLAGS += -Wall
# Flags - Header dependency tracking
SFLAGS += -MD -MP
# Building directory
ifeq ($(DEBUG),1)
BUILD_TYPE = debug
else
BUILD_TYPE = release
endif
BUILD_DIR = output/$(BUILD_TYPE)/$(PLATFORM)
# Define "Q" as an arobase by default to silence-out every command run by make.
# If V=1 is supplied on the make command line, undefine Q so that every command
# is echoed out.
Q=@
BUILD_VERBOSE=0
ifeq ("$(origin V)", "command line")
ifeq ($(V),1)
BUILD_VERBOSE=1
Q=
endif
endif
ifeq ("$(PLATFORM)", "device")
SFLAGS += -DPLATFORM_DEVICE
ifeq ("$(MODEL)", "n0100")
SFLAGS += -DDEVICE_N0100
else
SFLAGS += -DDEVICE_N0110
endif
endif
# Host detection
ifeq ($(OS),Windows_NT)
HOST = windows
else
uname_s := $(shell uname -s)
ifeq ($(uname_s),Darwin)
HOST = macos
else ifeq ($(uname_s),Linux)
HOST = linux
else
HOST = unknown
endif
endif