File: rules

package info (click to toggle)
most 4.8.1-0.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 444 kB
  • ctags: 380
  • sloc: ansic: 4,982; sh: 171; makefile: 115
file content (95 lines) | stat: -rwxr-xr-x 2,986 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# 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

# There used to be `source' and `diff' targets in this file, and many
# packages also had `changes' and `dist' targets.  These functions
# have been taken over by dpkg-source, dpkg-genchanges and
# dpkg-buildpackage in a package-independent way, and so these targets
# are obsolete.

# The name of the package (for example, `emacs').
p=most
# The version of the package (for example, `19.28').
version=4.7
# The Debian revision of the package (for example, `2').
debian=1

CC = gcc
CFLAGS = -O2 -g -Wall

make_directory= install -d -o root -g root -m 755
install_binary= install -s -o root -g root -m 755
install_script= install    -o root -g root -m 755
install_files=  install    -o root -g root -m 644

# The next section may have to be extensively modified

build:
	$(checkdir)
	@echo "Building the binaries ..."
	CC="$(CC)" CFLAGS="$(CFLAGS)" ./configure
	$(MAKE)
	touch build

clean:
	$(checkdir)
	@echo "Cleaning up after a build ..."
	-rm -f build debian/{files,substvars} src/config.h
	-$(MAKE) -i distclean
	-rm -rf debian/tmp debian*~

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)
	@echo "Making the binary package: $(p)-$(version)-$(debian).deb ..."
	rm -rf debian/tmp
	$(make_directory) debian/tmp/DEBIAN
	$(make_directory) debian/tmp/usr/bin
	$(make_directory) debian/tmp/usr/man/man1
	$(make_directory) debian/tmp/usr/doc/most
	$(install_binary) src/objs/most debian/tmp/usr/bin/most
	$(install_files) changes.txt debian/tmp/usr/doc/$(p)/changelog
	$(install_files) debian/changelog debian/tmp/usr/doc/$(p)/changelog.Debian
	$(install_files) most.1 debian/tmp/usr/man/man1/most.1
	$(install_files) debian/copyright README default.rc lesskeys.rc \
		most-fun.txt debian/tmp/usr/doc/$(p)
	gzip -9 debian/tmp/usr/doc/$(p)/{changelog*,[^c]*} \
		debian/tmp/usr/man/man1/most.1
	dpkg-shlibdeps debian/tmp/usr/bin/most; dpkg-gencontrol
	chown -R root.root debian/tmp
	dpkg --build debian/tmp ..

# Below here is fairly generic really.

binary: binary-indep binary-arch

dist-full: checkroot
	dpkg-buildpackage -uc -us -sa
	@echo "You may want to run \"debian/rules clean\" to clean up after the build"

dist-update: checkroot
	dpkg-buildpackage -uc -us -sd
	@echo "You may want to run \"debian/rules clean\" to clean up after the build"

dist: dist-full

update: dist-update

checkroot:
	test root = "`whoami`"

define checkdir
	test -f src/$(p).h -a -f debian/rules
endef

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