-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.mk
More file actions
29 lines (24 loc) · 938 Bytes
/
Copy pathconfig.mk
File metadata and controls
29 lines (24 loc) · 938 Bytes
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
CXX ?= g++
BUILD ?= debug
INSTALL_DIR ?= /usr/local/bin
ifeq ($(BUILD),debug)
CXXFLAGS := -std=c++20 -g -O0 -DDEBUG \
-Wall -Wpedantic -Wextra -Wundef -Wwrite-strings -Wredundant-decls \
-Wdisabled-optimization -Wdouble-promotion -Wmissing-declarations -Wconversion \
-Wstrict-overflow=2 -fstack-protector-all -Wvla
BUILD_DIR := debug
else ifeq ($(BUILD),release)
CXXFLAGS := -std=c++20 -O2 -DNDEBUG \
-Wall -Wpedantic -Wextra -Wundef -Wwrite-strings -Wredundant-decls \
-Wdisabled-optimization -Wdouble-promotion -Wmissing-declarations -Wconversion \
-Wstrict-overflow=2 -fstack-protector-all -Wvla
BUILD_DIR := release
else
$(error Unknown build type "$(BUILD)", must be 'debug' or 'release')
endif
LDFLAGS := -lstdc++ -Wl,-E
SRC_DIR := src
OBJ_DIR := $(BUILD_DIR)/obj
EXEC := $(BUILD_DIR)/zura
CPP_FILES := $(shell find $(SRC_DIR) -name '*.cpp')
OBJECTS := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(CPP_FILES))