File: rules

package info (click to toggle)
sgb 1%3A1996-7
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 1,600 kB
  • ctags: 26
  • sloc: makefile: 171; sh: 3
file content (73 lines) | stat: -rwxr-xr-x 2,263 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
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

package=sgb

build:
	$(checkdir)
	make -f Makefile.debian tests
	rm -f *.o
	make -f Makefile.debian CFLAGS='-fPIC -D_REENTRANT -O2' libgb.so
	make -f Makefile.debian sotests
	make -f Makefile.debian demos
	touch build

clean:
	$(checkdir)
	-rm -f build
	-make -f Makefile.debian veryclean
	-rm -f test_flip test_graph test_io test_sample
	-rm -f `find . -name "*~"`
	-rm -rf debian/tmp debian/files* core debian/substvars

binary-indep: checkroot build
	$(checkdir)
#	tex abstract.plaintex
#	dvips -D 600 -o abstract.ps abstract.dvi

binary-arch: checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp
	cd debian/tmp && install -d `cat ../dirs`
	make -f Makefile.debian install
	make -f Makefile.debian installdemos
	install -m 644 libgb.so debian/tmp/usr/lib/
	install -m 644 debian/sgb.1 debian/tmp/usr/man/man1/
	install -m 644 debian/README.Debian ERRATA README abstract.plaintex  \
		debian/tmp/usr/doc/$(package)/
	gzip -9 `find debian/tmp/usr/man -type f 2>/dev/null`
	set -e; for i in `find debian/tmp/usr/bin/ -type f -perm +111`; do \
		ln -s sgb.1.gz debian/tmp/usr/man/man1/`basename $$i`.1.gz; \
		done
	gzip -9 `find debian/tmp/usr/doc -type f -size +4k ! -name "*.htm*"`
	install -m 644 debian/changelog \
		debian/tmp/usr/doc/$(package)/changelog.Debian
	gzip -9 debian/tmp/usr/doc/$(package)/changelog.Debian
	install -m 644 debian/copyright debian/tmp/usr/doc/$(package)/
	strip `find debian/tmp -type f -perm +111 | xargs file | fgrep ELF | sed 's/^\([^:]*\):.*$$/\1/'`
	strip --strip-unneeded `find debian/tmp -name '*.so'`
	install -d debian/tmp/DEBIAN
	install -m 755 debian/postinst debian/tmp/DEBIAN/
	dpkg-shlibdeps `find debian/tmp -type f -perm +111 | xargs file | fgrep ELF | sed 's/^\([^:]*\):.*$$/\1/'`
	dh_md5sums
	dpkg-gencontrol -isp
	chown -R root.root debian/tmp
	chmod -R go=rX debian/tmp
	chmod -R u+w debian/tmp
	dpkg --build debian/tmp ..

define checkdir
	test -f debian/rules
endef

# Below here is fairly generic really

binary: binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

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