File: Makefile

package info (click to toggle)
python-pyglew 0.1.2-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 6,084 kB
  • ctags: 160
  • sloc: python: 652; ansic: 321; cpp: 273; sh: 175; makefile: 91
file content (58 lines) | stat: -rw-r--r-- 1,712 bytes parent folder | download | duplicates (2)
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
54
55
56
57
58
builddir=build

GLBASE = $(subst extensions/,,$(wildcard extensions/GL_*))
GLOBJECTS = $(addprefix $(builddir)/, $(addsuffix -gen.o, $(GLBASE)))
GLCCS = $(addprefix $(builddir)/, $(addsuffix -gen.cc, $(GLBASE)))
GLHHS = $(addprefix include/, pack.hh unpack.hh unpack_ptr.hh pyglew_exception.hh pointer_wrapper.hh)

PYTHON=python2.4

all:

include $(shell uname -s).conf

all: exts pyglew.$(SOEXT)

test: pyglew.$(SOEXT)
	$(PYTHON) test.py

install: pyglew.$(SOEXT)
	$(PYTHON) setup.py install

pyglew.$(SOEXT): pyglew.o $(GLOBJECTS)
	$(LINK) -o $@ $^ $(LIBS)

$(builddir)/pyglew-gen.hh: $(addprefix $(builddir)/, $(addsuffix -gen.hh, $(GLBASE)))
	cat $^ > $@

$(builddir)/pyglew-methods.cc: $(addprefix $(builddir)/, $(addsuffix -methods.cc, $(GLBASE)))
	cat $^ > $@

$(builddir)/pyglew-constants.cc: $(addprefix $(builddir)/, $(addsuffix -constants.cc, $(GLBASE)))
	rm -f $@ ; 
	for file in $^; do echo "/* " $$file " */" >> $@; cat $$file >> $@; done;

pyglew.o: pyglew.cc $(GLHHS) $(builddir)/pyglew-gen.hh $(builddir)/pyglew-methods.cc $(builddir)/pyglew-constants.cc
	$(COMPILE) $(INCLUDES) -Iinclude -I$(builddir) -c $< -o $@

$(builddir)/%-gen.o: $(builddir)/%-gen.cc $(GLHHS)
	$(COMPILE) $(INCLUDES)  -c $< -o $@

$(builddir)/%-gen.hh $(builddir)/%-gen.cc $(builddir)/%-constants.cc: extensions/% main.py src/*.cc
	mkdir -p $(builddir)
	$(PYTHON) main.py $(builddir) $<

exts: 
	for ext in $(GLBASE) ; do make $(builddir)/$$ext-constants.cc; done


test_pbo: test_pbo.cc
	$(CXX) $(CXXFLAGS) $^ -o $@ -lGLEW -lGL -lSDL

clean:
	rm -f pyglew.so test_pbo
	rm -rf $(builddir)
	rm -rf dist

.PRECIOUS: $(builddir)/%-gen.hh $(builddir)/%-gen.cc $(builddir)/%-constants.cc $(builddir)/%-gen.o
.PHONY: exts dist