File: rules

package info (click to toggle)
ae 962-26
  • links: PTS
  • area: main
  • in suites: potato
  • size: 184 kB
  • ctags: 324
  • sloc: ansic: 2,633; makefile: 114; sh: 17
file content (116 lines) | stat: -rwxr-xr-x 2,804 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
116
#! /usr/bin/make -f
#
# Invoke each target with `./debian/rules <target>'.  All targets should be
# invoked with the package root as the current directory.
#
# The `binary' target must be run as root, as it needs to install files with
# specific ownership.

CC = gcc
CFLAGS = -O2 -DDEBIAN -DTERMIOS -DBADCURSES -DSLCURSES
LDFLAGS = -s
LIBS = -lslang

P=ae

build:
	$(checkdir)
# Builds the binary package.
	make CC="$(CC)" CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(LIBS)"
	touch build

clean:
# Undoes the effect of `make -f debian/rules build'.
	$(checkdir)
	rm -f build stamp-build
	rm -f *.o ae core
	rm -rf *~ debian/tmp debian/*~ debian/substvars* debian/files*

binary-indep:
# None--
	@echo >&2 'No architecture independant portions'

binary binary-arch:	checkroot build
#
# Clean up
#
	rm -rf debian/tmp
#
# Create new temporary directories
#
	install -d debian/tmp debian/tmp/DEBIAN
#
# Create and populate documentation directory for this package
#
	install -d debian/tmp/usr/doc/$(P)
	cp debian/changelog debian/tmp/usr/doc/$(P)/changelog.Debian
	install -m 644 debian.modeless.ti \
		debian/tmp/usr/doc/$(P)/debian.modeless.ti
	install -m 644 mode.rc debian/tmp/usr/doc/$(P)/mode.rc
	install -m 644 modeless.pc debian/tmp/usr/doc/$(P)/modeless.pc
	install -m 644 modeless.rc debian/tmp/usr/doc/$(P)/modeless.rc
	install -m 644 modeless.tc debian/tmp/usr/doc/$(P)/modeless.tc
	install -m 644 modeless.ti debian/tmp/usr/doc/$(P)/modeless.ti
	install -m 644 ae.man debian/tmp/usr/doc/$(P)/ae.man
	gzip -9f debian/tmp/usr/doc/$(P)/*
#
# Don't compress the copyright
#
	cp debian/copyright debian/tmp/usr/doc/$(P)
#
# Install configuration scripts
#
	cp debian/preinst debian/tmp/DEBIAN/.
	chmod +x debian/tmp/DEBIAN/preinst
	cp debian/postinst debian/tmp/DEBIAN/.
	chmod +x debian/tmp/DEBIAN/postinst
	cp debian/prerm debian/tmp/DEBIAN/.
	cp debian/conffiles debian/tmp/DEBIAN/conffiles
	chmod +x debian/tmp/DEBIAN/prerm
#
# Install package binaries
#
	install -d debian/tmp/bin
	install -s ./ae debian/tmp/bin/.
#
# Install resource configuration files
#
	install -d debian/tmp/etc
	install -d debian/tmp/etc/ae
	install -m 644 ae.rc debian/tmp/etc/ae.rc
	install -m 644 fn.rc debian/tmp/etc/ae/fn.rc
#
# Install man or info pages
#
	install -d debian/tmp/usr/man/man1
	install -m 644 debian.ae.1 debian/tmp/usr/man/man1/ae.1
	gzip -9f debian/tmp/usr/man/man1/ae.1
#
# Declare dependencies
#
	dpkg-shlibdeps $(P)
#
# Generate control structures
#
	dpkg-gencontrol
#
# Asure proper permissions and ownership
#
	chown -R root.root debian/tmp
	chmod -R g-ws debian/tmp
#
# Build the binary
#
	dpkg --build debian/tmp ..

#
# Bookkeeping
#
define checkdir:
	test -f $(P).man -a -f debian/rules
endef

checkroot:
	test root = "`whoami`"

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