-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
39 lines (31 loc) · 2.29 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
CXXFLAGS = -g -std=c++17 -Wall -Wextra -Weffc++ -Wc++0x-compat -Wc++11-compat -Wc++14-compat -Waggressive-loop-optimizations \
-Walloc-zero -Walloca -Walloca-larger-than=8192 -Warray-bounds -Wcast-align -Wcast-qual -Wchar-subscripts \
-Wconditionally-supported -Wconversion -Wctor-dtor-privacy -Wdangling-else -Wduplicated-branches -Wempty-body -Wfloat-equal \
-Wformat-nonliteral -Wformat-security -Wformat-signedness -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=2 -Winline \
-Wlarger-than=8192 -Wvla-larger-than=8192 -Wlogical-op -Wmissing-declarations -Wnon-virtual-dtor -Wopenmp-simd \
-Woverloaded-virtual -Wpacked -Wpointer-arith -Wredundant-decls -Wrestrict -Wshadow -Wsign-promo -Wstack-usage=8192 \
-Wstrict-null-sentinel -Wstrict-overflow=2 -Wstringop-overflow=4 -Wsuggest-attribute=noreturn -Wsuggest-final-types \
-Wsuggest-override -Wswitch-default -Wswitch-enum -Wsync-nand -Wundef -Wunreachable-code -Wunused -Wvariadic-macros \
-Wno-literal-suffix -Wno-missing-field-initializers -Wnarrowing -Wno-old-style-cast -Wvarargs -Waligned-new \
-Walloc-size-larger-than=1073741824 -Walloc-zero -Walloca -Walloca-larger-than=8192 -Wcast-align=strict -Wdangling-else \
-Wduplicated-branches -Wformat-overflow=2 -Wformat-truncation=2 -Wmissing-attributes -Wmultistatement-macros -Wrestrict \
-Wshadow=global -Wsuggest-attribute=malloc -fcheck-new -fsized-deallocation -fstack-check -fstrict-overflow \
-flto-odr-type-merging -fno-omit-frame-pointer -Wno-unknown-pragmas
SrcDir = src
ExamplesDir = examples
IncDir = include
BuildDir = build
OBJECTS = $(BuildDir)/main.o $(BuildDir)/text.o $(BuildDir)/file.o $(BuildDir)/lines_sort.o
onegin: $(OBJECTS)
g++ -I$(IncDir)/.. $(OBJECTS) -o onegin.exe
$(BuildDir)/main.o: $(ExamplesDir)/main.cpp $(IncDir)/text.h $(IncDir)/lines_sort.h
g++ -I$(IncDir)/.. -c $(ExamplesDir)/main.cpp $(CXXFLAGS) -o $(BuildDir)/main.o
$(BuildDir)/text.o: $(SrcDir)/text.cpp $(IncDir)/text.h
g++ -I$(IncDir)/.. -c $(SrcDir)/text.cpp $(CXXFLAGS) -o $(BuildDir)/text.o
$(BuildDir)/file.o: $(SrcDir)/file.cpp $(IncDir)/file.h
g++ -I$(IncDir)/.. -c $(SrcDir)/file.cpp $(CXXFLAGS) -o $(BuildDir)/file.o
$(BuildDir)/lines_sort.o: $(SrcDir)/lines_sort.cpp $(IncDir)/lines_sort.h
g++ -I$(IncDir)/.. -c $(SrcDir)/lines_sort.cpp $(CXXFLAGS) -o $(BuildDir)/lines_sort.o
.PHONY: init
init:
mkdir -p $(BuildDir)