aboutsummaryrefslogtreecommitdiff
path: root/.build.mk
blob: 23cbe3046e95cbdbc3ab42ce1b4662697cba8dc5 (plain) (blame)
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
# MIT License, Copyright (c) 2021 Marvin Borner

# All preprocessor flags - enable using the custom config group below
ALL_PREPROCESSOR_FLAGS = \
    DEBUG_ALLOC \
    DEBUG_SYSCALLS \
    DEBUG_SCHEDULER

# All config options
ALL_CONFIGS = \
	CONFIG_STRIP \
	CONFIG_CACHE \
	CONFIG_EXTRA_CFLAGS \
	CONFIG_USER_PIE

# Set ccache globally
CONFIG_CACHE ?= ccache

# Specific config groups
ifeq ($(CONFIG), debug)
    CONFIG_OPTIMIZATION ?= -Ofast
    CONFIG_EXTRA_CFLAGS ?= -Wno-error -ggdb3 -s -fsanitize=undefined -fstack-protector-all
else ifeq ($(CONFIG), dev)
    CONFIG_OPTIMIZATION ?= -finline -finline-functions -Ofast
else ifeq ($(CONFIG), release)
    CONFIG_OPTIMIZATION ?= -finline -finline-functions -Ofast
    CONFIG_STRIP ?= true
else ifeq ($(CONFIG), experimental)
    CONFIG_USER_PIE ?= true
else ifeq ($(CONFIG), custom)
    DEBUG_ALLOC ?= true
    DEBUG_SYSCALLS ?= true
    DEBUG_SCHEDULER ?= true
endif