File: rules

package info (click to toggle)
sane 0.72-1.1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 3,008 kB
  • ctags: 5,180
  • sloc: ansic: 42,911; sh: 4,584; java: 1,421; makefile: 720
file content (115 lines) | stat: -rwxr-xr-x 3,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
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
#!/usr/bin/make -f
# Sample debian.rules file - for GNU Hello (1.3).
# Copyright 1994,1995 by Ian Jackson.
# I hereby give you perpetual unlimited permission to copy,
# modify and relicense this file, provided that you do not remove
# my name from the file itself.  (I assert my moral right of
# paternity under the Copyright, Designs and Patents Act 1988.)
# This file may have to be extensively modified
# Copyright 1996 by Kevin Dalley
#


CC = gcc
CFLAGS = -O2
# LDFLAGS = -s LDFLAGS is not correctly defined in Makefile.in
prefix=/usr
package = sane

build:
	$(checkdir)
	./configure --prefix=$(prefix) --sysconfdir=/etc --datadir=$(prefix)/share/sane
	$(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)"
	cd doc; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" ps
	cd tools; $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS)" find-scanner
	touch build

clean:
	$(checkdir)
	-rm -f build
	-$(MAKE) -i distclean || $(MAKE) -f Makefile.in distclean
	-rm -rf *~ debian/tmp debian/*~ debian/files*
	-rm -f japi/Makefile
	-rm -f tools/find-scanner
	-rm -f doc/sane.{dvi,ind lof,lot,ps}

binary-indep:	checkroot build
	$(checkdir)

# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch:	checkroot build
	$(checkdir)
	-rm -rf debian/tmp
	install -d debian/tmp debian/tmp/DEBIAN
	install -d debian/tmp$(prefix)/doc/$(package)
	install -d debian/tmp$(prefix)/doc/$(package)/tools
	install -d debian/tmp$(prefix)/bin
	install -d debian/tmp/etc
	install -m 0644 debian/{conffiles,shlibs} \
		debian/tmp/DEBIAN/.
	install -d debian/tmp$(prefix)/lib/gimp/1.0/plug-ins
	ln -sf ../../../../bin/xscanimage \
		debian/tmp$(prefix)/lib/gimp/1.0/plug-ins
	$(MAKE) prefix=`pwd`/debian/tmp$(prefix) \
		sysconfdir=`pwd`/debian/tmp/etc \
		datadir=`pwd`/debian/usr/share/sane \
		CC="$(CC)" CFLAGS="$(CFLAGS)" \
		INSTALL_PROGRAM="install -s" \
		install
	chmod a-x $$file debian/tmp/usr/lib/*.so.*.*
	chmod a-x $$file debian/tmp/usr/lib/*.la
	install -m 644 doc/sane.ps debian/tmp$(prefix)/doc/$(package)
	gzip -9v debian/tmp$(prefix)/doc/$(package)/sane.ps
	install tools/find-scanner debian/tmp$(prefix)/bin
	install -m 644 frontend/xcam.README \
		debian/tmp$(prefix)/doc/$(package)
	gzip -9v debian/tmp$(prefix)/doc/$(package)/xcam.README
	install -m 644 debian/README.debian \
		debian/tmp$(prefix)/doc/$(package)
	for file in AUTHORS LEVEL2 LICENSE NEWS PROBLEMS PROJECTS \
		README TODO; do \
		install -m 644 $${file} \
			debian/tmp$(prefix)/doc/$(package); \
		gzip -9v debian/tmp$(prefix)/doc/$(package)/$${file}; \
	done
	strip --strip-unneeded \
		debian/tmp$(prefix)/lib/*.so.0.0.*
	strip debian/tmp$(prefix)/bin/*
	gzip -9v debian/tmp$(prefix)/man/man[15]/*
	install -m 0644 debian/copyright debian/tmp$(prefix)/doc/$(package)/.
	install -m 0644 debian/changelog \
		debian/tmp$(prefix)/doc/$(package)/changelog.Debian
	gzip -9v debian/tmp$(prefix)/doc/$(package)/changelog.Debian
	ln -s ../man7/undocumented.7.gz \
		debian/tmp$(prefix)/man/man1/find-scanner.1.gz
	ln -s ../man7/undocumented.7.gz \
		debian/tmp$(prefix)/man/man1/xcam.1.gz
	install -d debian/tmp$(prefix)/doc/$(package)/examples
	install -d debian/tmp$(prefix)/doc/$(package)/examples/tools
	install tools/xerox debian/tmp$(prefix)/doc/$(package)/examples/tools
	install -m 644 tools/README \
		debian/tmp$(prefix)/doc/$(package)/examples/tools
	gzip -9v debian/tmp$(prefix)/doc/$(package)/examples/tools/README
	dpkg-shlibdeps debian/tmp$(prefix)/bin/* debian/tmp/$(prefix)/lib/lib*.so
	dpkg-gencontrol
	dpkg --build debian/tmp ..

define checkdir
	test -f sanei/sanei_config.c -a -f debian/rules
endef

# Below here is fairly generic really

binary:		binary-indep binary-arch

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

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

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