aboutsummaryrefslogtreecommitdiff
path: root/externals/gridflow/optional/rblti/Makefile
blob: d50b1aa7a9c75e463c015e71304e3fcf4852a00b (plain)
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
LTIPREFIX = /usr/local
#LTIPREFIX = /home/matju
LIBS = $(LTIPREFIX)/lib/ltilib/libltir.a -lpng -ljpeg
INCS = -I$(LTIPREFIX)/include/ltilib -I/usr/share/swig1.3/std
PINC = -I/usr/include/python
RINC = -I`ruby -rrbconfig -e'h=Config::CONFIG;puts h["rubylibdir"]+"/"+h["arch"]'`

default:: python

python:: _pylti.so
	python -c 'import pylti'
	python testpylti.py fan.jpg

_pylti.so: pylti_wrap.o Makefile
	g++ -shared -o _pylti.so pylti_wrap.o $(LIBS)

pylti_wrap.o: pylti_wrap.cxx
	g++ $(PINC) -Ipatched $(INCS) -c pylti_wrap.cxx

pylti_wrap.cxx: ./swig/pylti.i
	swig -v -c++ -python -DHAVE_LIBJPEG -DHAVE_LIBPNG -I./generated -I./patched \
		$(INCS) -w509,-312,-362,-389  -o ./pylti_wrap.cxx ./swig/pylti.i
	#swig -c++ -python -DHAVE_LIBJPEG -DHAVE_LIBPNG -I./generated_python -I./patched \
	#	$(INCS) -w509,-312,-362,-389 pylti.i

ruby:: rblti.so
	ruby -e 'require "rblti"'

rblti.so: rblti_wrap.o Makefile
	g++ -shared -o rblti.so rblti_wrap.o $(LIBS)

rblti_wrap.o: rblti_wrap.cxx
	g++ $(RINC) -Ipatched $(INCS) -c rblti_wrap.cxx

rblti_wrap.s: rblti_wrap.cxx
	g++ $(RINC) -Ipatched $(INCS) -S rblti_wrap.cxx

rblti_wrap.cxx: rblti.i
	swig -c++ -ruby -DHAVE_LIBJPEG -DHAVE_LIBPNG -I./generated -I./patched \
		-fcompact -fvirtual $(INCS) -w509,-312,-362,-389,-801,-314 rblti.i

clean::
	rm -f \
		pylti.so pylti_wrap.o pylti_wrap.cxx \
		rblti.so rblti_wrap.o rblti_wrap.cxx