-
Notifications
You must be signed in to change notification settings - Fork 3
/
makefile
35 lines (26 loc) · 976 Bytes
/
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
# Compiler Settings
CXX = g++
# CXXFLAGS = -fopenmp -Wall -g
CXXFLAGS = -openmp -Wall -g
# Path variables
LIB = ./include/
SRC = ./src/
OBJ = ./obj/
# Target
TARGET = main
# Compilation rules
Main: $(OBJ)Main.o $(OBJ)Snowman.o $(OBJ)Scene.o $(OBJ)Sphere.o $(OBJ)KDTree.o
$(CXX) $(CXXFLAGS) $(OBJ)Main.o $(OBJ)Snowman.o $(OBJ)Scene.o $(OBJ)Sphere.o $(OBJ)KDTree.o -o Main
$(OBJ)Main.o: $(SRC)Main.cpp $(LIB)Scene.h $(LIB)Math.h $(LIB)Sphere.h $(LIB)Ray.h $(LIB)Snowman.h
$(CXX) $(CXXFLAGS) -c $< -o $@
$(OBJ)Snowman.o: $(SRC)Snowman.cpp $(LIB)Snowman.h $(LIB)Sphere.h
$(CXX) $(CXXFLAGS) -c $< -o $@
$(OBJ)Scene.o: $(SRC)Scene.cpp $(LIB)Scene.h $(LIB)Math.h $(LIB)Sphere.h $(LIB)Ray.h $(LIB)KDTree.h
$(CXX) $(CXXFLAGS) -c $< -o $@
$(OBJ)Sphere.o: $(SRC)Sphere.cpp $(LIB)Sphere.h
$(CXX) $(CXXFLAGS) -c $< -o $@
$(OBJ)KDTree.o: $(SRC)KDTree.cpp $(LIB)KDTree.h $(LIB)Photon.h $(LIB)Math.h
$(CXX) $(CXXFLAGS) -c $< -o $@
# Clean
clean:
$(RM) $(TARGET) -rf $(OBJ)/*