File: rules

package info (click to toggle)
numerix 0.22-4
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,380 kB
  • ctags: 4,165
  • sloc: asm: 26,210; ansic: 12,168; ml: 4,912; sh: 3,899; pascal: 414; makefile: 179
file content (149 lines) | stat: -rwxr-xr-x 3,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
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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.

#export DH_VERBOSE=1
export DH_ALWAYS_EXCLUDE=CVS:.svn

OCAMLLIB = $(shell ocamlc -where)
OCAMLABI = $(shell ocamlc -version)
OCAMLDIR = $(CURDIR)/debian/tmp$(OCAMLLIB)
DOCDIR   = $(CURDIR)/debian/numerix-doc

PACKAGE = numerix
# Don't forget to update debian/META if this version number changes.
VERSION = 0.22

DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
  confflags += --build $(DEB_HOST_GNU_TYPE)
else
  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

# assembly code for alpha and ppc doesn't work on linux yet, so force use of
# the generic C code
ifeq ($(DEB_HOST_ARCH),alpha)
	confflags += --enable-processor=generic
endif
ifeq ($(DEB_HOST_ARCH),powerpc)
	confflags += --enable-processor=generic
endif

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

export CFLAGS

include /usr/share/dpatch/dpatch.make

ocamlabi:
	for i in $(wildcard debian/*.in); do \
		sed -e 's/#OCamlABI#/$(OCAMLABI)/g' < $$i > $${i%.in}; \
	done

config: config-stamp
config-stamp: ocamlabi patch-stamp
	dh_testdir
	dh_clean -k

	cp /usr/share/misc/config.guess /usr/share/misc/config.sub config

	./configure --prefix=/usr $(confflags) \
	            --disable-sse2 --enable-ocaml_bignum --enable-gmp

	touch config-stamp

build: build-stamp
build-stamp: config-stamp
	dh_testdir
	dh_clean -k

	$(MAKE)

	touch build-stamp

clean: patch clean1 unpatch
clean1:
	dh_testdir
	dh_testroot

	[ ! -f Makefile ] || $(MAKE) clean
	[ ! -f doc/Makefile ] || $(MAKE) -C doc clean

	rm -rf debian/doc/
	dh_clean config.guess config.sub build-stamp config-stamp

install: build
	dh_testdir
	dh_testroot
#	dh_clean -k
	dh_installdirs

	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp

	mkdir -p $(OCAMLDIR)/METAS
	cp -p debian/META $(OCAMLDIR)/METAS/META.numerix

	dh_install -s --sourcedir=debian/tmp

# Prune empty directories
	find debian -type d | xargs rmdir -p --ignore-fail-on-non-empty

# have to actually build first, since ocamldoc is run on a derived file
install-doc: build
	dh_clean -k -i
	dh_installdirs -i

	$(MAKE) -C doc all

	mkdir -p debian/doc/html
	find exemples -type f -exec chmod a-x {} \;
	ocamldoc -html -m A -keep-code -d debian/doc/html/ \
		kernel/ocaml/mli/numerix.mli


binary-indep: install-doc
	dh_testdir
	dh_testroot
	dh_installdocs -i
	dh_installexamples -i
	dh_installchangelogs -i

	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdocs -s
	dh_installchangelogs -s
#	dh_installman -plibnumerix-ocaml-dev debian/ocamlnumx.1
	dh_installexamples -s
	dh_movefiles -s
	dh_link -s
	dh_strip -s
	dh_compress -s
	dh_fixperms -s
	dh_makeshlibs -s
	dh_installdeb -s
	dh_shlibdeps -s
	dh_gencontrol -s -- -VF:OCamlABI="$(OCAMLABI)"
	dh_md5sums -s
	dh_builddeb -s

binary: binary-indep binary-arch
.PHONY: patch unpatch config build clean clean1 install binary-indep binary-arch binary