File: rules

package info (click to toggle)
gmp 2.0.2-3
  • links: PTS
  • area: main
  • in suites: hamm, potato, slink
  • size: 2,856 kB
  • ctags: 1,878
  • sloc: ansic: 18,651; asm: 8,431; sh: 1,632; makefile: 795
file content (64 lines) | stat: -rwxr-xr-x 1,893 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
#!/usr/bin/make -f

p=gmp
command=/usr/lib/dpkg/parsechangelog/debian <debian/changelog
v1 := $(shell $(command) |sed -n '/Version: /s;;;p' |sed -e 's/\..\+//')
v2 := $(shell $(command) |sed -n '/Version: /s;;;p' |sed -e 's/-.\+//')

shl1=libgmp	$(v1)	gmp (>= $(v2))
shl2=libmp	$(v1)	gmp (>= $(v2))

build:
	$(checkdir)
	./configure
	$(MAKE) CFLAGS=-O3 MA_N=$(v1) MI_N=$(v2)
	touch build

clean:
	$(checkdir)
	-rm -f build
	-$(MAKE) distclean
	-rm -rf debian/tmp debian/*~ *~ *.orig ./#*# *.log

binary-indep:
#None:
	@echo >&2 'No independent packages'; false

binary binary-arch:		checkroot build
	-rm -rf debian/tmp
	mkdir debian/tmp debian/tmp/DEBIAN
	echo -e '$(shl1)\n' >debian/tmp/DEBIAN/shlibs
	install -d debian/tmp/usr/doc/$(p)
	install -d debian/tmp/usr/{include,info,lib}
	cp debian/{postinst,prerm} debian/tmp/DEBIAN/.
	chmod +x debian/tmp/DEBIAN/{postinst,prerm}
	install -m 644 gmp.h mp.h debian/tmp/usr/include/.
	install -m 644 mpn/generic/gmp-mparam.h debian/tmp/usr/include/.
	strip --strip-debug libgmp.a
	install -m 644 libgmp.a debian/tmp/usr/lib/.
	strip --strip-debug libgmp.so.$(v2)
	install -m 644 libgmp.so.$(v2) debian/tmp/usr/lib/.
	ln -s libgmp.so.$(v2) debian/tmp/usr/lib/libgmp.so.$(v1)
	ln -s libgmp.so.$(v2) debian/tmp/usr/lib/libgmp.so
	install -m 644 gmp.info* debian/tmp/usr/info/.
	install -m 644 README debian/tmp/usr/doc/$(p)/.
	gzip -9v debian/tmp/usr/info/*
	cp debian/copyright debian/tmp/usr/doc/$(p)/copyright
	cp debian/changelog debian/tmp/usr/doc/$(p)/changelog.Debian
	cp ChangeLog debian/tmp/usr/doc/$(p)/changelog
	gzip -9v debian/tmp/usr/doc/$(p)/change*
	dpkg-gencontrol
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
	dpkg --build debian/tmp ..	

define checkdir
	test -f $(p).h
endef

# Below here is fairly generic really
checkroot:
	$(checkdir)
	test root = "`whoami`"

.PHONY: binary binary-arch binary-indep clean checkroot