| author | Radek Brich <radek.brich@devl.cz> | 
| Sat, 17 Nov 2007 17:20:36 +0100 | |
| branch | pyrit | 
| changeset 4 | c73bc405ee7a | 
| parent 1 | e74bf781067e | 
| child 5 | 2d97ea5e711a | 
| permissions | -rw-r--r-- | 
| 
4
 
c73bc405ee7a
multi-threaded rendering via pthreads
 
Radek Brich <radek.brich@devl.cz> 
parents: 
1 
diff
changeset
 | 
1  | 
CCFLAGS=-Wall -O3 -I./src -DPTHREADS -pthread -fno-strict-aliasing  | 
| 
0
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
2  | 
LDFLAGS=  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
3  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
4  | 
ifeq ($(OS), Windows_NT)  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
5  | 
CCFLAGS+=-I"C:/Program Files/Python25/include"  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
6  | 
LDFLAGS+=-L"C:\Program Files\Python25\libs" -lpython25  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
7  | 
MODULENAME=raytracer.pyd  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
8  | 
else  | 
| 
1
 
e74bf781067e
use python-config, strip python version from demos, change [PyRit] to [pyrit] -- should use unix name everywhere
 
Radek Brich <radek.brich@devl.cz> 
parents: 
0 
diff
changeset
 | 
9  | 
CCFLAGS+=-fPIC `python-config --includes`  | 
| 
0
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
10  | 
MODULENAME=raytracermodule.so  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
11  | 
endif  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
12  | 
|
| 
4
 
c73bc405ee7a
multi-threaded rendering via pthreads
 
Radek Brich <radek.brich@devl.cz> 
parents: 
1 
diff
changeset
 | 
13  | 
# optimizations  | 
| 
0
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
14  | 
#CCFLAGS+=-pipe -fomit-frame-pointer -ffast-math -msse3  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
15  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
16  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
17  | 
# TARGETS  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
18  | 
#########  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
19  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
20  | 
all: python-module  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
21  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
22  | 
python-module: $(MODULENAME)  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
23  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
24  | 
tests: testvector testmatrix  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
25  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
26  | 
clean:  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
27  | 
rm -f *.o $(MODULENAME) testvector testmatrix  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
28  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
29  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
30  | 
# RULES  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
31  | 
#######  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
32  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
33  | 
%.o: src/%.cc  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
34  | 
$(CXX) -c -o $@ src/$*.cc $(CCFLAGS)  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
35  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
36  | 
test%: tests/%.cc  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
37  | 
$(CXX) -o $@ tests/$*.cc $(CCFLAGS)  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
38  | 
./$@  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
39  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
40  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
41  | 
# DEPENDENCIES  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
42  | 
##############  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
43  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
44  | 
# C++ raytracer  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
45  | 
vector.o: src/vector.cc src/vector.h  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
46  | 
matrix.o: src/matrix.cc src/matrix.h src/vector.h  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
47  | 
noise.o: src/noise.cc src/noise.h  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
48  | 
scene.o: src/scene.cc src/scene.h src/vector.h src/noise.h  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
49  | 
raytracer.o: src/raytracer.cc src/raytracer.h src/scene.h src/vector.h src/noise.h  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
50  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
51  | 
# python module  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
52  | 
raytracermodule.o: src/raytracermodule.cc src/raytracer.h src/scene.h src/vector.h  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
53  | 
$(MODULENAME): raytracermodule.o raytracer.o scene.o noise.o  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
54  | 
$(CXX) $^ -shared -o $@ $(LDFLAGS)  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
55  | 
|
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
56  | 
# library tests  | 
| 
 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 
Radek Brich <radek.brich@devl.cz> 
parents:  
diff
changeset
 | 
57  | 
testvector: tests/vector.cc src/vector.h  |