File: rules

package info (click to toggle)
tre 0.8.0-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,456 kB
  • ctags: 876
  • sloc: sh: 10,041; ansic: 9,887; makefile: 231; python: 44; sed: 16
file content (105 lines) | stat: -rwxr-xr-x 3,295 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
#!/usr/bin/make -f

CC = gcc
CFLAGS = -g -Wall -D_REENTRANT
INSTALL_PROGRAM = install

STRIP = true
ATRIP = true

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 INSTALL_PROGRAM += -s
 STRIP=strip --strip-unneeded --remove-section=.comment --remove-section=.note
 ATRIP=strip --strip-debug
endif

SOVERSION=5
VERSION=5.0.0

build:
	./configure --prefix=/usr --enable-static
	$(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
	$(MAKE) -C po update-gmo	
	$(MAKE) install DESTDIR=`pwd`/debian/tmp \
		INSTALL_PROGRAM="$(INSTALL_PROGRAM)"
	touch build

clean:
	rm -f build
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f `find . -name "*~"`
	rm -rf debian/tmp debian/files* core debian/substvars
	cd debian && rm -rf libtre$(SOVERSION) libtre-dev tre-agrep
	cd po && rm -f *.gmo

binary-indep: build

binary-arch: build
	debian/rules libtre$(SOVERSION)
	debian/rules libtre-dev
	debian/rules tre-agrep

libtre$(SOVERSION): build
	rm -rf debian/$@
	install -d debian/$@/DEBIAN debian/$@/usr/share/doc/$@
	install -d debian/$@/usr/lib
	cp -a debian/tmp/usr/lib/libtre.so.$(SOVERSION)* debian/$@/usr/lib
	cp -a debian/tmp/usr/share/locale debian/$@/usr/share
	install -m 755 debian/postinst debian/$@/DEBIAN
	install -m 644 debian/shlibs   debian/$@/DEBIAN
	cp -p NEWS TODO README THANKS debian/$@/usr/share/doc/$@
	cp -p debian/copyright debian/$@/usr/share/doc/$@
	cp -p ChangeLog debian/$@/usr/share/doc/$@/changelog
	cp -p debian/changelog debian/$@/usr/share/doc/$@/changelog.Debian
	cd debian/$@/usr/share/doc/$@ && gzip -9 changelog changelog.Debian
	$(STRIP) debian/$@/usr/lib/libtre.so.$(VERSION)
	chmod -x debian/$@/usr/lib/*
	dpkg-shlibdeps debian/$@/usr/lib/libtre.so.$(VERSION)
	dpkg-gencontrol -p$@ -Pdebian/$@
	cd debian/$@ && \
		md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
	chown -R root:root debian/$@
	chmod -R go=rX debian/$@
	dpkg --build debian/$@ ..

libtre-dev: build
	rm -rf debian/$@
	install -d debian/$@/DEBIAN debian/$@/usr/share/doc
	install -d debian/$@/usr/lib
	ln -s libtre$(SOVERSION) debian/$@/usr/share/doc/$@
	cp -a debian/tmp/usr/lib/*.so debian/$@/usr/lib
	cp -p debian/tmp/usr/lib/*.a  debian/$@/usr/lib
	cp -a debian/tmp/usr/lib/pkgconfig debian/$@/usr/lib
	cp -a debian/tmp/usr/include  debian/$@/usr
	$(ATRIP) debian/$@/usr/lib/*.a
	dpkg-gencontrol -p$@ -Pdebian/$@
	cd debian/$@ && \
		md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
	chown -R root:root debian/$@
	chmod -R go=rX debian/$@
	dpkg --build debian/$@ ..

tre-agrep: build
	rm -rf debian/$@
	install -d debian/$@/DEBIAN debian/$@/usr/share/doc
	install -d debian/$@/usr/bin debian/$@/usr/share/man/man1
	ln -s libtre$(SOVERSION) debian/$@/usr/share/doc/$@
	cp -p debian/tmp/usr/bin/agrep debian/$@/usr/bin/tre-agrep
	cp -p debian/tmp/usr/share/man/man1/agrep.1 \
		debian/$@/usr/share/man/man1/tre-agrep.1
	gzip -r9 debian/$@/usr/share/man
	dpkg-shlibdeps debian/$@/usr/bin/tre-agrep
	$(STRIP) debian/$@/usr/bin/tre-agrep
	dpkg-gencontrol -p$@ -Pdebian/$@
	cd debian/$@ && \
		md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
	chown -R root:root debian/$@
	chmod -R go=rX debian/$@
	dpkg --build debian/$@ ..

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean