src/Makefile
author Radek Brich <radek.brich@devl.cz>
Fri, 28 Mar 2008 23:30:04 +0100
branchpyrit
changeset 52 a6413a3d741d
parent 47 320d5d466864
permissions -rw-r--r--
new implementation of sample_queue
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     1
ifndef $(ROOT)
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     2
	ROOT=$(shell pwd)/..
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     3
endif
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     4
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     5
include $(ROOT)/config.mk
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     6
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     7
vpath %.cc $(ROOT)/src
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
     8
vpath %.h $(ROOT)/include
47
320d5d466864 move Sampler classes to sampler.cc
Radek Brich <radek.brich@devl.cz>
parents: 41
diff changeset
     9
LIBOBJS=raytracer.o scene.o sampler.o noise.o container.o kdtree.o octree.o
22
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    10
CCFLAGS+=-I$(ROOT)/include
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    11
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    12
### Targets ###
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    13
all: libs-float libs-double python-module
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    14
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    15
libs-float:
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    16
	mkdir -p $(ROOT)/bin/$@
41
c1080cb5bd6d fix possible division by zero in ccdemos/common_ply.h
Radek Brich <radek.brich@devl.cz>
parents: 35
diff changeset
    17
	$(MAKE) -C $(ROOT)/bin/$@ -f $(ROOT)/src/Makefile libs ROOT="$(ROOT)" CCFLAGS="$(CCFLAGS) -fsingle-precision-constant"
22
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    18
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    19
libs-double:
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    20
	mkdir -p $(ROOT)/bin/$@
41
c1080cb5bd6d fix possible division by zero in ccdemos/common_ply.h
Radek Brich <radek.brich@devl.cz>
parents: 35
diff changeset
    21
	$(MAKE) -C $(ROOT)/bin/$@ -f $(ROOT)/src/Makefile libs ROOT="$(ROOT)" CCFLAGS="$(CCFLAGS) -DPYRIT_DOUBLE"
22
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    22
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    23
libs: $(LIBOBJS)
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    24
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    25
python-module: libs-float
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    26
	mkdir -p $(ROOT)/bin/$@
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    27
	$(MAKE) -C $(ROOT)/bin/$@ -f $(ROOT)/src/Makefile $(MODULENAME) ROOT="$(ROOT)"
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    28
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    29
$(MODULENAME): raytracermodule.o
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    30
	$(CXX) -shared -o $@ $< $(ROOT)/bin/libs-float/*.o $(LDFLAGS) $(PY_LDFLAGS)
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    31
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    32
clean:
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    33
	rm -rf $(ROOT)/bin/libs-*
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    34
	rm -rf $(ROOT)/bin/python-module
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    35
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    36
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    37
### Rules ###
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    38
%.o: %.cc
41
c1080cb5bd6d fix possible division by zero in ccdemos/common_ply.h
Radek Brich <radek.brich@devl.cz>
parents: 35
diff changeset
    39
	$(CXX) -c -o $@ $(CCFLAGS) $<
22
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    40
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    41
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    42
### Dependencies ###
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    43
matrix.o: matrix.cc matrix.h vector.h common.h
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    44
noise.o: noise.cc noise.h common.h
47
320d5d466864 move Sampler classes to sampler.cc
Radek Brich <radek.brich@devl.cz>
parents: 41
diff changeset
    45
scene.o: scene.cc scene.h sampler.h vector.h noise.h common.h
320d5d466864 move Sampler classes to sampler.cc
Radek Brich <radek.brich@devl.cz>
parents: 41
diff changeset
    46
sampler.o: sampler.cc sampler.h vector.h common.h
24
d0d76e8a5203 new C++ demo: realtime_dragon.cc
Radek Brich <radek.brich@devl.cz>
parents: 22
diff changeset
    47
container.o: container.cc container.h scene.h common.h
22
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    48
kdtree.o: kdtree.cc kdtree.h scene.h common.h
35
fb170fccb19f new space partitioning structure: octree
Radek Brich <radek.brich@devl.cz>
parents: 30
diff changeset
    49
octree.o: octree.cc octree.h scene.h common.h
22
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    50
raytracer.o: raytracer.cc raytracer.h scene.h vector.h noise.h common.h
76b7bd51d64a new make infrastructure
Radek Brich <radek.brich@devl.cz>
parents:
diff changeset
    51
30
33f95441790e pyrit_verbosity: new variable for controlling amount of output, see common.h
Radek Brich <radek.brich@devl.cz>
parents: 24
diff changeset
    52
raytracermodule.o: raytracermodule.cc $(LIBOBJS)
41
c1080cb5bd6d fix possible division by zero in ccdemos/common_ply.h
Radek Brich <radek.brich@devl.cz>
parents: 35
diff changeset
    53
	$(CXX) -c -o $@ $(CCFLAGS) $(PY_CCFLAGS) $<