-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (38 loc) · 1.17 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
CC=g++
CFLAGS=-Wall -Wextra -Wpedantic -c
ifeq ($(CC), nvcc)
CFLAGS=-x cu -dc
endif
all: tracer
util.o: src/util.cpp src/include/util.hpp
$(CC) $(CFLAGS) src/util.cpp
vec3.o: src/vec3.cpp src/include/vec3.hpp
$(CC) $(CFLAGS) src/vec3.cpp
camera.o: src/camera.cpp src/include/camera.hpp
$(CC) $(CFLAGS) src/camera.cpp
hittable_list.o: src/hittable_list.cpp src/include/hittable_list.hpp
$(CC) $(CFLAGS) src/hittable_list.cpp
sphere.o: src/sphere.cpp src/include/sphere.hpp
$(CC) $(CFLAGS) src/sphere.cpp
hittables: hittable_list.o sphere.o
lambertian.o: src/lambertian.cpp
$(CC) $(CFLAGS) src/lambertian.cpp
metal.o: src/metal.cpp
$(CC) $(CFLAGS) src/metal.cpp
dielectric.o: src/dielectric.cpp
$(CC) $(CFLAGS) src/dielectric.cpp
materials: lambertian.o metal.o dielectric.o
tracer.o: src/tracer.cpp
$(CC) $(CFLAGS) src/tracer.cpp
tracer: tracer.o util.o vec3.o camera.o hittables materials
$(CC) -o tracer tracer.o util.o vec3.o camera.o hittable_list.o \
sphere.o lambertian.o metal.o dielectric.o
clean:
@if test -n "$(wildcard *.o)"; then \
rm *.o; \
echo 'removed .o files'; \
fi
@if test -n "$(wildcard tracer)"; then \
rm tracer; \
echo 'removed tracer'; \
fi