-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (37 loc) · 897 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# @file: Makefile
# @project: raytracer
# @author: Ondrej Hirjak, 2009-2010
# @description: Project makefile.
# setting
CPP = g++
CXXFLAGS = -pipe -Wall -g -DV2MACOS
LDFLAGS = -pipe
LIBS = -lpthread
#LIBS = -lpthread -lrt
SRC = V2Base.cpp V2File.cpp V2Thread.cpp colors.cpp geometries.cpp main.cpp render.cpp renderGPU.cpp renderGrid.cpp renderMT.cpp scene.cpp
OUT = raytracer
OUTPUTS = output.bmp debug.bmp
.PHONY: all build optimized tags clean distclean
# building
all:
make -j3 build
build: $(OUT)
optimized:
make CXXFLAGS="-pipe -Wall -DV2MACOS -msse3 -O2"
$(OUT): $(SRC:.cpp=.o)
$(CPP) $(LDFLAGS) $(LIBS) -o $(OUT) $(SRC:.cpp=.o)
%.o: %.cpp
$(CPP) $(CXXFLAGS) -c -o $@ $<
tags:
ctags $(SRC) *.h
clean:
-rm $(OUT) $(SRC:.cpp=.o)
distclean: clean
-rm tags core $(OUTPUTS)
# running & results
run: build
./$(OUT)
show_output:
eog output.bmp
show_debug:
eog debug.bmp