File: rules

package info (click to toggle)
quantlib-swig 0.9.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 58,200 kB
  • ctags: 105,353
  • sloc: cpp: 1,047,001; ansic: 133,430; ml: 54,990; cs: 34,216; java: 23,659; perl: 17,882; python: 8,891; lisp: 2,337; ruby: 1,140; sh: 458; makefile: 355
file content (197 lines) | stat: -rwxr-xr-x 5,641 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#! /usr/bin/make -f
#                                                       -*- makefile -*-
# debian/rules file for the Debian Linux quantlib-swig package
# Copyright (C) 2001 - 2007 by Dirk Eddelbuettel <edd@debian.org>

#package	:= $(shell grep Package debian/control | sed 's/^Package: //')
pypackage	= quantlib-python
rbpackage	= quantlib-ruby
rrpackage	= quantlib-r
version		:= $(shell head -1 debian/changelog | \
			perl -nle 'm/\S+\s+\((\S+)\)/ && print $$1')
pydeb		:= $(CURDIR)/debian/$(pypackage)
rbdeb		:= $(CURDIR)/debian/$(rbpackage)
rrdeb		:= $(CURDIR)/debian/$(rrpackage)

#arch 		:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
## edd 01 Nov 2005 use DEB_BUILD_ARCH_CPU, not DEB_BUILD_GNU_TYPE 
##                 updated rules throughout
arch		:= $(shell dpkg-architecture -qDEB_BUILD_ARCH_CPU)
cpu		:= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)

PYTHON  	:= $(shell pyversions -d)
RUBY		:= ruby

#export DH_VERBOSE=1

## edd 29 Nov 2001	Default to g++
cxxcompiler	= g++

## edd 14 Jan 2003	no longer change g++ as g++-3.2 is now default
# 			but use g++-3.0 on ia64
#ifneq "$(findstring $(arch), ia64)" ""
#cxxcompiler	= g++-3.0
#endif

## edd 01 Feb 2002  	allow -ffunction-sections on hppa 
## edd 26 Oct 2007      turn strict aliasing warning off
compilerflags	= -O2 -Wall -Wno-strict-aliasing
ifeq ($(cpu),hppa)
compilerflags   = -O2 -ffunction-sections
#cxxcompiler	= g++-3.0
endif

## edd 18 May 2002	no optimisation or debugging on baby systems
## edd 14 May 2005	don't do it on mipsel or mips either
## edd 01 Jun 2007      no longer activate this on mips/mipsel
## edd 26 Jun 2007 	use cpu test, not arch test -- thanks to Riku via #430709
## edd 26 Oct 2007      s390+powerpc also die, so add'em (and remove mips(el), see next item)
ifneq "$(findstring $(cpu), m68k arm armeb s390 powerpc)" ""
compilerflags   = -O0 -g0
endif

## edd 26 Oct 2007      really reset mips/mips to -O2 (see #419742)
ifneq "$(findstring $(cpu), mipsel mips)" ""
compilerflags   = -O2 -g0
endif


## edd 25 Dec 2002  g++-3.2 for s390

#ifneq "$(findstring $(arch), s390)" ""
#cxxcompiler	= g++-3.2
#endif

upstream: get-orig-source
get-orig-source:
	        lynx http://quantlib.org

build: build-stamp
build-stamp:
	dh_testdir
	@echo "*** Running on arch $(arch) and cpu $(cpu)"

	# need to build the Makefile for R
#	./configure 	--prefix=/usr 				\
#			--build $(arch)

        # $(MAKE)
	(cd Python && 						\
			CC="$(cxxcompiler)"			\
			CXX="$(cxxcompiler)" 			\
			CFLAGS="$(compilerflags)" 		\
			CXXFLAGS="$(compilerflags)"		\
			$(PYTHON) setup.py build		)

	(cd Ruby && 						\
			CC="$(cxxcompiler)"			\
			CXX="$(cxxcompiler)" 			\
			CFLAGS="$(compilerflags)" 		\
			CXXFLAGS="$(compilerflags)"		\
		 	$(RUBY) setup.rb build  		)

# 	(cd R && 						\
# 			CC="$(cxxcompiler)"			\
# 			CXX="$(cxxcompiler)" 			\
# 			CFLAGS="$(compilerflags)" 		\
# 			CXXFLAGS="$(compilerflags)"		\
# 			make					)

	touch build-stamp

test:	build test-stamp
test-stamp:
## edd 01 Nov 2005  run check only on i386
#ifeq "$(findstring $(arch), m68k arm)" ""
ifeq ($(cpu),i486)
        # -$(MAKE) test
	(cd Python && 						\
		$(PYTHON) setup.py test				)
	(cd Ruby   && 						\
		$(RUBY) setup.rb test				)
endif
	touch test-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp test-stamp install-stamp
	-test -f Makefile && $(MAKE) realclean
	(cd Python && 						\
			$(PYTHON) setup.py clean --all	&&	\
			rm -f QuantLib/*.pyc			)
	(cd Ruby &&						\
			rm -f quantlib_wrap.o QuantLibc.so 	)
	dh_clean

install: test install-stamp
install-stamp: 
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs	-p$(pypackage)	usr/share/$(pypackage)
        #$(MAKE) install PREFIX=$(debtmp)/usr
	(cd Python && 						\
			$(PYTHON) setup.py 			\
				install --prefix=$(pydeb)/usr	)
        # edd 2005-Apr-14  copy swig file manually instead
	cp -vax SWIG/* 	$(pydeb)/usr/share/$(pypackage)/
	rm -fv 	Python/test/*.pyc
        # remove Docs installed by Python, we do that below
	rm -frv $(pydeb)/usr/share/doc/QuantLib-Python
        # remove .pyc which Lintian doesn't like
	rm -frv $(pydeb)/usr/lib/python*/site-packages/QuantLib/*.pyc

	dh_installdirs -p$(rbpackage)	usr/share/$(rbpackage)
        # $(MAKE) install PREFIX=$(debtmp)/usr
	(cd Ruby &&							\
		CXX="$(cxxcompiler)" 					\
		CFLAGS="$(compilerflags)" 				\
		CXXFLAGS="$(compilerflags)" 				\
		$(RUBY) setup.rb install				\
			--prefix=$(rbdeb)/usr --debian			)
        # fix mode, lintian complain about 755 and no #! line
	chmod 644 debian/$(rbpackage)/usr/lib/ruby/1.8/QuantLib.rb
        # edd 2007-Dec-20  copy swig file manually instead as well
	cp -vax SWIG/* 	$(rbdeb)/usr/share/$(rbpackage)/
	touch install-stamp

	touch install-stamp

binary-indep: build test install

binary-arch: build test install
	dh_testdir
	dh_testroot
#	dh_installdebconf
	dh_installdocs	-A	Readme.txt News.txt 
	dh_installexamples -p$(pypackage) Python/test/ Python/examples/*.py
	dh_installexamples -p$(rbpackage) Ruby/test/ Ruby/examples/*.rb
#	dh_installmenu
#	dh_installemacsen
#	dh_installpam
#	dh_installinit
#	dh_installcron
#	dh_installmanpages
#	dh_installinfo		
#	dh_undocumented
	dh_installchangelogs -A	ChangeLog.txt
#	dh_link
	dh_compress
	dh_fixperms
	dh_strip
#	dh_suidregister
	dh_pycentral	-p$(pypackage)
	dh_python	-p$(pypackage)
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
#	dh_md5sums
	dh_builddeb

source diff:                                                                  
	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

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