File: rules

package info (click to toggle)
pycxx 5.4.1-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 660 kB
  • ctags: 1,292
  • sloc: cpp: 2,333; python: 205; makefile: 80; ansic: 22; sh: 9
file content (158 lines) | stat: -rwxr-xr-x 4,227 bytes parent folder | download
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
#
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets  by Bill Allombert 2001

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS



CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

PYVERS	:= $(shell pyversions -vs)
defver	:= $(shell /usr/bin/python -c 'import sys; print sys.version[:3]')

PWD	= $(shell pwd)

p_cxx	= python-cxx
d_cxx	= debian/$(p_cxx)


#Architecture 
build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp: build-indep-stamp
#	cd Demo && \
#	  CFLAGS="-I$(PWD)" \
#	  SUPPORT_DIR=$(PWD)/Src \
#	  /usr/bin/python2.3 setup.py build --build-base $(PWD)

#	$(MAKE) -f example_common.mak \
#		CCC="g++ -c" \
#		CCCFLAGS="$(CFLAGS) -fPIC -I/usr/include/python2.3 -I." \
#		LDSHARED="g++ -shared" \
#		LDLIBS= \
#		PYTHON=/usr/bin/python2.3
	touch build-arch-stamp

build-indep: build-indep-stamp $(PYVERS:%=build-python%)
build-indep-stamp:
#	$(MAKE) doc
	touch build-indep-stamp

build-python%:
	#cd bindings/python && python$* setup.py build
	python$* setup.py build
	touch build-python$*

clean:
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp build-python*
	$(MAKE) -f example_common.mak clean
	rm -rf build
	rm -rf Demo/build
	dh_clean 

pre-install:
	dh_testdir
	dh_testroot
	dh_clean -k -i 
	dh_installdirs -i
	dh_installchangelogs -i

install-indep: pre-install $(PYVERS:%=install-python%) install-arch
	dh_installdocs -ppython-cxx README.html Doc/PyCXX.html

	rm -rf debian/python-cxx-dev/usr/share/doc/python-cxx-dev
	mkdir -p debian/python-cxx-dev/usr/share/doc
	ln -sf python-cxx \
		debian/python-cxx-dev/usr/share/doc/python-cxx-dev
	mkdir -p debian/python-cxx-dev/usr/share/doc/python-cxx
	cp -a Demo \
		debian/python-cxx-dev/usr/share/doc/python-cxx/examples
	chmod 644 debian/python-cxx-dev/usr/share/doc/python-cxx/examples/*.?xx
	rm -rf debian/python-cxx-dev/usr/share/doc/python-cxx/examples/build

	rm -rf debian/python-cxx/usr/include

install-python%:
	/usr/bin/python$* setup.py install \
		--root=$(shell pwd)/debian/python-cxx
	find debian/python-cxx -name '*.egg-info' | xargs -r rm -f
	mkdir -p debian/python-cxx-dev/usr/share/
	mv debian/python-cxx/usr/share/python$* \
		debian/python-cxx-dev/usr/share/
	mkdir -p debian/python-cxx-dev/usr/include
	mv debian/python-cxx/usr/include/python$* debian/python-cxx-dev/usr/include/

	mkdir -p debian/python-cxx-dev/usr/include/python$*_d
	ln -s ../python$*/CXX debian/python-cxx-dev/usr/include/python$*_d/CXX


install-arch:
	dh_testdir
	dh_testroot
#	dh_clean -k -s 
#	dh_installdirs -s
#	cd Demo && \
#	  CFLAGS="-I$(PWD)" \
#	  SUPPORT_DIR=$(PWD)/Src \
#	  /usr/bin/python2.3 setup.py install --root=$(shell pwd)/$(d23_cxx)
#	dh_install -s

# Build architecture independant packages
binary-indep: build-indep install-indep
	dh_testdir
	dh_testroot

	dh_compress -i -X.py -X.cxx -X.hxx
	dh_fixperms -i
	DH_PYCENTRAL=nomove dh_pycentral -i
	grep -v python:Versions debian/python-cxx.substvars \
		> debian/python-cxx.substvars.tmp
	echo "python:Versions=$(PYVERS)" | sed 's/ /, /g' \
		>> debian/python-cxx.substvars.tmp
	mv debian/python-cxx.substvars.tmp debian/python-cxx.substvars
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture dependant packages
binary-arch: build-arch install-arch
#	dh_testdir
#	dh_testroot
#	dh_installchangelogs -a
#	dh_installdocs -a
#	dh_installexamples -a
#	dh_strip -a
#	dh_compress -a 
#	dh_fixperms -a
#	dh_pycentral -a
#	dh_installdeb -a
#	dh_shlibdeps -a
#	dh_gencontrol -a
#	dh_md5sums -a
#	dh_builddeb -a

binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure