-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (30 loc) · 1.46 KB
/
Makefile
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
BUILD_DIR := build
BIN_DIR := bin
SRC_DIRS := . src
VPATH += $(SRC_DIRS)
APPLICATION := $(BUILD_DIR)/Onegin
CXX := g++
CXX_FLAGS := -D _DEBUG -ggdb3 -std=c++17 -O0 -Wall -Wextra -Weffc++ -Waggressive-loop-optimizations\
-Wc++14-compat -Wmissing-declarations -Wcast-align -Wcast-qual -Wchar-subscripts -Wconditionally-supported\
-Wconversion -Wctor-dtor-privacy -Wempty-body -Wfloat-equal -Wformat-nonliteral -Wformat-security\
-Wformat-signedness -Wformat=2 -Winline -Wlogical-op -Wnon-virtual-dtor -Wopenmp-simd -Woverloaded-virtual\
-Wpacked -Wpointer-arith -Winit-self -Wredundant-decls -Wshadow -Wsign-conversion -Wstrict-null-sentinel\
-Wstrict-overflow=2 -Wsuggest-attribute=noreturn -Wsuggest-final-methods -Wsuggest-final-types -Wsuggest-override\
-Wswitch-default -Wswitch-enum -Wsync-nand -Wundef -Wunreachable-code -Wunused -Wuseless-cast -Wvariadic-macros\
-Wno-literal-suffix -Wno-missing-field-initializers -Wno-narrowing -Wno-old-style-cast -Wno-varargs -Wstack-protector\
-fcheck-new -fsized-deallocation -fstack-protector -fstrict-overflow -flto-odr-type-merging -fno-omit-frame-pointer\
-Wlarger-than=8192 -Wstack-usage=8192 -pie -fPIE
all: prepare $(APPLICATION)
$(APPLICATION): $(BIN_DIR)/main.o $(BIN_DIR)/stack.o $(BIN_DIR)/test.o
$(CXX) $^ -o $@ $(CXX_FLAGS)
$(BIN_DIR)/%.o: %.cpp
$(CXX) $< -c -o $@ $(CXX_FLAGS)
.PHONY: clean prepare run
run:
./$(APPLICATION)
prepare:
mkdir -p $(BIN_DIR)
mkdir -p $(BUILD_DIR)
clean:
rm -rf $(BIN_DIR)
rm -rf $(BUILD_DIR)