-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (56 loc) · 1.37 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
##
## EPITECH PROJECT, 2023
## Raytracer
## File description:
## Makefile
##
CXX = g++
SRC_DIRS = source\
source/Maths\
source/Primitives\
source/Utils\
source/Lights\
source/Parsing\
SRC = source/main.cpp\
source/Renderer.cpp\
source/Ray.cpp\
source/Camera.cpp\
source/World.cpp\
source/Primitives/Sphere.cpp\
source/Primitives/Plane.cpp\
source/Primitives/Cylinder.cpp\
source/Primitives/APrimitive.cpp\
source/Maths/Vector3D.cpp\
source/Maths/Point3D.cpp\
source/Utils/Color.cpp\
source/Lights/ALight.cpp\
source/Lights/DirectionalLight.cpp\
source/Lights/PointLight.cpp\
source/Parsing/Parsing.cpp\
OBJ = $(SRC:%.cpp=%.o)
EXEC = raytracer
LDFLAGS = -lconfig++
CPPFLAGS = -I source/libs/OBJLoader $(SRC_DIRS:%=-I%)
CFLAGS = -Wall -Wextra
all: $(EXEC)
%.o: %.cpp
$(CXX) -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
$(EXEC): OBJLoader $(OBJ)
$(CXX) -o $@ $(OBJ) $(CFLAGS) $(LDFLAGS)
debug: CFLAGS += -g3
debug: OBJLoader_debug maths_debug $(EXEC)
## OBJ loader
OBJLoader:
make -C source/libs/OBJLoader
OBJLoader_debug:
make -C source/libs/OBJLoader debug
OBJLoader_clean:
make -C source/libs/OBJLoader clean
OBJLoader_fclean:
make -C source/libs/OBJLoader fclean
clean: OBJLoader_clean
$(RM) $(OBJ)
fclean: clean OBJLoader_fclean
$(RM) $(EXEC)
re: fclean all
.PHONY: all re fclean clean OBJLoader_clean OBJLoader_fclean OBJLoader