File: rules

package info (click to toggle)
lacheck 1.25-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 228 kB
  • ctags: 203
  • sloc: makefile: 117
file content (105 lines) | stat: -rwxr-xr-x 2,713 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
#
# rules file for Debian lacheck package.
# $Id: rules,v 1.11 1998/02/22 22:39:33 salve Exp $
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to: The Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
#
# On Debian GNU/Linux System you can find a copy of the GNU General Public
# License in /usr/doc/copyright/GPL.

package	= lacheck
BINS	= lacheck
DOCS	= lacheck.hlp

tmp	:= $(shell pwd)/debian/tmp/
usr	= $(tmp)/usr/
bin	= $(usr)/bin/
man	= $(usr)/man/man1/
DEBIAN 	= $(tmp)/DEBIAN/
doc	= $(usr)/doc/$(package)/

SHELL		= /bin/bash
INSTDIR		= install -m 755 -d
INSTPROG	= install -m 755 -s
INSTDATA	= install -m 644
INSTSCRIPT	= install -m 755

build:
	$(checkdir)
#	note the use of prefix=/usr: it leads to correct FILES section in lacheck.1
	$(MAKE) CC=gcc CFLAGS="-O2 -Wall" prefix=/usr lacheck lacheck.1
	touch build

clean:
	$(checkdir)
	-rm -rf build core $(tmp) debian/files* debian/substvars
	-$(MAKE) clean

binary: binary-indep binary-arch

binary-arch: checkroot build
	$(checkdir)
	-rm -rf $(tmp)

# install package
	$(INSTDIR) $(bin) $(man)
	$(MAKE) prefix=$(usr) install
	strip $(addprefix $(bin), $(BINS))
	gzip -9v $$(find $(man) -type f)

# install Debian doc
	$(INSTDIR) $(doc)
	$(INSTDATA) $(DOCS) $(doc)
	$(INSTDATA) debian/changelog $(doc)/changelog.Debian
	gzip -9v $$(find $(doc) -type f)
	$(INSTDATA) debian/copyright $(doc)

# install Debian control files
	$(INSTDIR) $(DEBIAN)

# standard stuff
#-#	cd $(tmp) && du -k * | grep -v 'DEBIAN' | sort -k 2 -o $(DEBIAN)/du
	cd $(tmp) && md5sum \
		$$(find ./ -path './DEBIAN' -prune -o -type f -printf "%P\n") \
		| sort -k 2 -o $(DEBIAN)/md5sums
	dpkg-shlibdeps $(BINS)
	dpkg-gencontrol
	chown -R root.root $(tmp)
	chmod -R go=rX $(tmp)
	dpkg --build $(tmp) ..

binary-indep: checkroot build
	$(checkdir)

test: build
	$(checkdir)
	$(MAKE) check

checkdir = test -f debian/rules

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

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

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

### Local Variables:
### mode: makefile
### End: