-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmakefile
More file actions
43 lines (25 loc) · 785 Bytes
/
makefile
File metadata and controls
43 lines (25 loc) · 785 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
42
43
CXX = clang++
CXXFLAGS = -Weverything -Wno-c++98-compat -Wno-c++11-extensions -Wno-padded -Wno-conversion -Wno-global-constructors -Wno-exit-time-destructors
EXEC = 3D-engine
LIB = -lsfml-window -lsfml-graphics -lsfml-system
SRC = $(shell find src -type f -name '*.cpp')
OBJ = $(patsubst src/%.cpp, obj/%.o, $(SRC))
DEP = $(OBJ:.o=.d)
all: print_compilation $(EXEC) open
-include $(DEP)
print_compilation:
@printf '\n→ compilation...\n'
$(EXEC): $(OBJ)
$(CXX) $^ -o $(EXEC) $(LIB)
obj/%.o : src/%.cpp
$(CXX) $(CXXFLAGS) -MMD -MP -c $< -o $@
open:
@printf '\n→ launch $(EXEC)...\n'
@./$(EXEC)
clean:
@printf '\n→ clean...\n'
rm -f $(OBJ)
rm -f $(DEP)
rm -f $(EXEC)
cm: clean all
.PHONY: all print_compilation open clean cm