File: 01_fix_makefile.dpatch

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 (69 lines) | stat: -rw-r--r-- 2,356 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
59
60
61
62
63
64
65
66
67
68
69
#! /bin/sh /usr/share/dpatch/dpatch-run
## 01_makefile.dpatch by Piotr Ożarowski <piotr@debian.org>
##
## DP: * respect PYTHON variable
## DP: * disable .conf file

@DPATCH@
diff -urNad python-pyglew-0.1.2~/Makefile python-pyglew-0.1.2/Makefile
--- python-pyglew-0.1.2~/Makefile	2007-10-28 21:31:56.000000000 +0100
+++ python-pyglew-0.1.2/Makefile	2007-10-28 23:11:42.000000000 +0100
@@ -1,26 +1,26 @@
 builddir=build
+CXXFLAGS+=-fpic -Wall
 
 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
+#include $(shell uname -s).conf
+SOEXT=so
 
-all: exts pyglew.$(SOEXT)
+all: exts $(builddir)/pyglew.$(SOEXT)
 
-test: pyglew.$(SOEXT)
+test: $(builddir)/pyglew.$(SOEXT)
 	$(PYTHON) test.py
 
-install: pyglew.$(SOEXT)
+install: $(builddir)/pyglew.$(SOEXT)
 	$(PYTHON) setup.py install
 
-pyglew.$(SOEXT): pyglew.o $(GLOBJECTS)
-	$(LINK) -o $@ $^ $(LIBS)
+$(builddir)/pyglew.$(SOEXT): $(builddir)/pyglew.o $(GLOBJECTS)
+	$(CXX) -shared $(CXXFLAGS) -o $@ $^ -lGLEW -lGL -l$(PYTHON)
 
 $(builddir)/pyglew-gen.hh: $(addprefix $(builddir)/, $(addsuffix -gen.hh, $(GLBASE)))
 	cat $^ > $@
@@ -32,11 +32,11 @@
 	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)/pyglew.o: pyglew.cc $(GLHHS) $(builddir)/pyglew-gen.hh $(builddir)/pyglew-methods.cc $(builddir)/pyglew-constants.cc
+	$(CXX) $(CXXFLAGS) -I/usr/include/$(PYTHON) -Iinclude -I. -Iinclude -I$(builddir) -c $< -o $@
 
 $(builddir)/%-gen.o: $(builddir)/%-gen.cc $(GLHHS)
-	$(COMPILE) $(INCLUDES)  -c $< -o $@
+	$(CXX) $(CXXFLAGS) -I/usr/include/$(PYTHON) -Iinclude -I. -c $< -o $@
 
 $(builddir)/%-gen.hh $(builddir)/%-gen.cc $(builddir)/%-constants.cc: extensions/% main.py src/*.cc
 	mkdir -p $(builddir)
@@ -50,7 +50,7 @@
 	$(CXX) $(CXXFLAGS) $^ -o $@ -lGLEW -lGL -lSDL
 
 clean:
-	rm -f pyglew.so test_pbo
+	rm -f test_pbo
 	rm -rf $(builddir)
 	rm -rf dist