src/Makefile
author Radek Brich <radek.brich@devl.cz>
Wed, 05 Dec 2007 18:54:23 +0100
branchpyrit
changeset 24 d0d76e8a5203
parent 22 76b7bd51d64a
child 30 33f95441790e
permissions -rw-r--r--
new C++ demo: realtime_dragon.cc class Container moved to its own source file (from kdtree.*) new directory for models and Makefile which downloads and prepares them fixed python module path in some forgotten demos ShapeList moved to scene.h

ifndef $(ROOT)
	ROOT=$(shell pwd)/..
endif

include $(ROOT)/config.mk

vpath %.cc $(ROOT)/src
vpath %.h $(ROOT)/include
LIBOBJS=raytracer.o scene.o noise.o container.o kdtree.o
CCFLAGS+=-I$(ROOT)/include

### Targets ###
all: libs-float libs-double python-module

libs-float:
	mkdir -p $(ROOT)/bin/$@
	$(MAKE) -C $(ROOT)/bin/$@ -f $(ROOT)/src/Makefile libs ROOT="$(ROOT)"

libs-double:
	mkdir -p $(ROOT)/bin/$@
	$(MAKE) -C $(ROOT)/bin/$@ -f $(ROOT)/src/Makefile libs ROOT="$(ROOT)" DEFS="$(DEFS) -DPYRIT_DOUBLE"

libs: $(LIBOBJS)

python-module: libs-float
	mkdir -p $(ROOT)/bin/$@
	$(MAKE) -C $(ROOT)/bin/$@ -f $(ROOT)/src/Makefile $(MODULENAME) ROOT="$(ROOT)"

$(MODULENAME): raytracermodule.o
	$(CXX) -shared -o $@ $< $(ROOT)/bin/libs-float/*.o $(LDFLAGS) $(PY_LDFLAGS)

clean:
	rm -rf $(ROOT)/bin/libs-*
	rm -rf $(ROOT)/bin/python-module


### Rules ###
%.o: %.cc
	$(CXX) -c -o $@ $(DEFS) $(CCFLAGS) $<


### Dependencies ###
matrix.o: matrix.cc matrix.h vector.h common.h
noise.o: noise.cc noise.h common.h
scene.o: scene.cc scene.h vector.h noise.h common.h
container.o: container.cc container.h scene.h common.h
kdtree.o: kdtree.cc kdtree.h scene.h common.h
raytracer.o: raytracer.cc raytracer.h scene.h vector.h noise.h common.h

raytracermodule.o: raytracermodule.cc raytracer.h scene.h vector.h common.h
	$(CXX) -c -o $@ $(DEFS) $(CCFLAGS) $(PY_CCFLAGS) $<