File: rules

package info (click to toggle)
xtel 3.1.4-4
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 1,988 kB
  • ctags: 4,359
  • sloc: ansic: 14,674; makefile: 3,931; sh: 41
file content (120 lines) | stat: -rwxr-xr-x 3,259 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
117
118
119
120
#!/usr/bin/make -f
# Sample debian.rules file - Copyright 1994,1995 by Ian Jackson.
#
# Invoke each target with `./debian/rules <target>'.  All targets should be
# invoked with the package root as the current directory.

# The name of the package
P = xtel

CC = gcc
COPTIONS = -O2 -g -Wall
LDFLAGS = # none 
INSTALL = install -s

SHELL = bash

R = debian/tmp

DIRECTORIES = \
        $(R) \
        $(R)/DEBIAN \
        $(R)/etc \
        $(R)/etc/$(P) \
	$(R)/etc/cron.weekly \
        $(R)/usr \
        $(R)/usr/X11R6 \
        $(R)/usr/X11R6/bin \
        $(R)/usr/X11R6/lib \
        $(R)/usr/X11R6/lib/X11 \
        $(R)/usr/X11R6/lib/X11/app-defaults \
        $(R)/usr/X11R6/lib/X11/fonts \
        $(R)/usr/X11R6/lib/X11/fonts/$(P) \
	$(R)/usr/X11R6/man \
	$(R)/usr/X11R6/man/man1 \
        $(R)/usr/doc \
	$(R)/usr/doc/LANG \
	$(R)/usr/doc/LANG/fr \
	$(R)/usr/doc/LANG/fr/$(P) \
        $(R)/usr/doc/$(P) \
        $(R)/usr/doc/$(P)/examples \
	$(R)/usr/lib \
        $(R)/usr/lib/menu \
        $(R)/usr/man \
        $(R)/usr/man/man8

build:
	xmkmf
	make Makefiles 
	make -k depend 
	make CC="$(CC)" COPTIONS="$(COPTIONS)" LDFLAGS="$(LDFLAGS)"
	touch build

# Clean $(DIRECTORIES)
clean-dir:
	$(checkdir)
	rm -f fonts/debian
	rm -rf $(R)

# Undoes the effect of `make -f rules build'.
clean: clean-dir
	$(checkdir)
	make clean
	rm -f debian/files* debian/substvars core
	rm -f build

# Makes a binary package.
binary-indep: $(DIRECTORIES) checkroot build
	$(checkdir)

binary-arch: $(DIRECTORIES) checkroot build
	$(checkdir)
	test -s fonts/debian || ln -s ../debian fonts
	$(INSTALL) -m 755 debian/{postrm,postinst} $(R)/DEBIAN/.
	$(INSTALL) -m 644 debian/conffiles $(R)/DEBIAN/.
	$(INSTALL) -m 644 debian/changelog $(R)/usr/doc/$(P)/changelog.Debian
	$(INSTALL) -m 644 debian/copyright $(R)/usr/doc/$(P)/.
	$(INSTALL) -m 644 debian/menu $(R)/usr/lib/menu/$(P)
	$(INSTALL) -m 644 xtel.gif $(R)/usr/doc/$(P)/.
	$(INSTALL) -m 644 debian/README $(R)/usr/doc/$(P)/.
	$(INSTALL) -m 644 exemples/* $(R)/usr/doc/$(P)/examples/.
	$(INSTALL) -m 644 HISTOIRE.txt $(R)/usr/doc/LANG/fr/$(P)/.
	$(INSTALL) -m 644 LISEZMOI.txt $(R)/usr/doc/LANG/fr/$(P)/.
	$(INSTALL) -m 644 FAQ.txt $(R)/usr/doc/LANG/fr/$(P)/.
	$(INSTALL) -m 755 debian/xtel.cron $(R)/etc/cron.weekly/$(P)
	$(INSTALL) -m 644 XTel-color $(R)/usr/X11R6/lib/X11/app-defaults/.
	$(INSTALL) -m 644 xtel.man $(R)/usr/X11R6/man/man1/xtel.1x
	$(INSTALL) -m 644 xteld.man $(R)/usr/man/man8/xteld.8x
	ln -s ../LANG/fr/$(P) $(R)/usr/doc/$(P)/fr
	make install DESTDIR=$(R) INSTALL="$(INSTALL)"
	gzip -9v $(R)/usr/doc/$(P)/changelog.Debian
	gzip -9v $(R)/usr/doc/LANG/fr/$(P)/{HISTOIRE.txt,LISEZMOI.txt,FAQ.txt}
	gzip -9v $(R)/usr/X11R6/man/man1/*
	gzip -9v $(R)/usr/man/man8/*
	dpkg-shlibdeps xtel xteld
	dpkg-gencontrol
	chown -R root.root $(R)
	chmod -R go-ws+rX $(R)
	chmod -R u-s+rw $(R)
	dpkg --build $(R) ..

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

# Below here is fairly generic really

binary:	binary-indep binary-arch

$(DIRECTORIES):
	install -d -g root -o root -m 755 $@
	chmod g-s $@

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