-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (29 loc) · 960 Bytes
/
Makefile
File metadata and controls
41 lines (29 loc) · 960 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
30
31
32
33
34
35
36
37
38
39
40
41
CXX = g++ -std=c++17
CXXFLAGS = -O3 -I./src -Wall -Werror -Wpedantic -Wconversion # -DASCIIONLY
DBGFLAGS = -g3 -I./src -Wall -Werror -Wpedantic -Wconversion
SRC = src
DCURSES_CPP = $(wildcard $(SRC)/dcurses/*.cpp)
DCURSES_O = $(DCURSES_CPP:%.cpp=%.o)
DVIM_CPP = $(wildcard $(SRC)/dvim/*.cpp)
DVIM_O = $(DVIM_CPP:%.cpp=%.o)
LOG_CPP = $(wildcard $(SRC)/Logging.cpp)
LOG_O = $(LOG_CPP:%.cpp=%.o)
# No default rules.
.SUFFIXES:
dvim: $(SRC)/main.cpp $(DCURSES_O) $(DVIM_O) $(LOG_O)
$(CXX) $(CXXFLAGS) $(MODE) $^ -o $@
dvim_dbg: $(SRC)/main.cpp $(DCURSES_O:%.o=%.o.dbg) $(DVIM_O:%.o=%.o.dbg) $(LOG_O:%.o=%.o.dbg)
$(CXX) $(DBGFLAGS) $(MODE) $^ -o $@
.PHONY: debug
debug: dvim_dbg
$(SRC)/%.o: $(SRC)/%.cpp $(SRC)/%.hpp
$(CXX) $(CXXFLAGS) $(MODE) -c $< -o $@
$(SRC)/%.o.dbg: $(SRC)/%.cpp
$(CXX) $(DBGFLAGS) $(MODE) -c $^ -o $@
.PHONY: clean
clean:
find . -name "*.o" -delete
find . -name "*.o.dbg" -delete
rm -f dvim
rm -f dvim_dbg
rm -rf *.dSYM