File: rules

package info (click to toggle)
xscavenger 1.4.5-4
  • links: PTS
  • area: main
  • in suites: bullseye, buster
  • size: 856 kB
  • ctags: 898
  • sloc: ansic: 5,386; makefile: 92; sh: 28
file content (141 lines) | stat: -rwxr-xr-x 4,684 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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/usr/bin/make -f
############################ -*- Mode: Makefile -*- ###########################
## rules ---
## Author           : Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de
## Created On       : Wed, 11 Mar 1998 15:05:54 +0100
## Created On Node  : localhost
## Last Modified By : Marcus Brinkmann
## Last Modified On : Wed, 11 Mar 1998 15:05:54 +0100
## Last Machine Used: localhost
## Update Count     : 0
## Status           : Unknown, Use with caution!
## HISTORY          :
## Description      :
##
###############################################################################

# The name of the package (for example, `Emacs').
package   := xscavenger

# Configuration variables (these should be pretty generic)
#CC = cc
CC = gcc
CFLAGS = `dpkg-buildflags --get CFLAGS` \
	`dpkg-buildflags --get LDFLAGS` \
	`pkg-config --cflags --libs alsa` \
	-O2 -g -pipe -Wall -Wno-pointer-sign
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	DONTSTRIP = true
	LDFLAGS = $(LDFLAGS) -s
endif
PREFIX = /usr
BINDIR = $(PREFIX)/games
MANDIR = $(PREFIX)/share/man
MAN6DIR = $(MANDIR)/man6
DOCDIR = $(PREFIX)/share/doc/$(package)
#PIXMAPSDIR = $(PREFIX)/X11R6/include/X11/pixmaps
PIXMAPSDIR = $(PREFIX)/share/pixmaps

#  Package specific stuff.  The idea is to try to make the rules
#  generic (gradually).

FILES_TO_CLEAN  = TAGS tags make.aux make.cp make.cps make.fn \
			make.fns make.toc debian/files config.cache \
			make.dvi make.ps
DIRS_TO_CLEAN   = debian/tmp
STAMPS_TO_CLEAN = stamp-build stamp-binary stamp-xmkmf

install_file= install -o root -g root -m 644
install_program= install -s -o root -g root -m 755
install_script= install -o root -g root -m 755
make_directory= install -d -o root -g root -m 755

define checkdir
	test -f debian/rules
endef

define checkroot
	@test 0 = "`id -u`" || (echo need root priviledges; exit 1)
endef

all build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp

# Compatibility with archaic build rules
build-stamp: stamp-build

xmkmf: stamp-xmkmf
stamp-xmkmf:
	-cd src && cp ../debian/Imakefile.debian Imakefile && xmkmf && touch ../stamp-xmkmf 

stamp-build:
	$(checkdir)
	# build package
	test -f stamp-xmkmf || $(MAKE) -f debian/rules xmkmf
	cd src && $(MAKE) CCOPTIONS="$(CFLAGS)"
	touch stamp-build

clean:
	$(checkdir)
	-cd src && test -f Makefile && $(MAKE) clean
	-rm -f $(FILES_TO_CLEAN) $(STAMPS_TO_CLEAN)
	-rm -rf $(DIRS_TO_CLEAN)
	-cd src && mv xscavenger.6 scavenger.6
	-cd src && cp ../debian/Imakefile.default Imakefile
	-rm src/Makefile*
	-rm -f core `find . \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
		-o -name '.*.rej' -o -name '.SUMS' -o -size 0 \) -print` TAGS
	-rm -f debian/substvars

binary:		binary-indep binary-arch

binary-indep:

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

	$(make_directory) debian/tmp/DEBIAN
	$(make_directory) debian/tmp$(BINDIR)
	$(make_directory) debian/tmp/usr/lib/games/$(package)
	$(make_directory) debian/tmp$(DOCDIR)
	$(make_directory) debian/tmp$(MAN6DIR)
	$(make_directory) debian/tmp$(PIXMAPSDIR)

	cd src && $(MAKE) install DESTDIR=../debian/tmp
	[ "$(DONTSTRIP)" != true ] || \
		strip -s -R.note -R.comment	debian/tmp$(BINDIR)/xscavenger

	$(install_file)		src/scavenger.6 debian/tmp$(MAN6DIR)/xscavenger.6
	gzip -n -9frq		debian/tmp$(MANDIR)/.

	# menu file
	$(install_script)	debian/xscavenger.postinst debian/tmp/DEBIAN/postinst
	$(install_script)	debian/xscavenger.postrm debian/tmp/DEBIAN/postrm
	$(install_script)	debian/xscavenger.prerm debian/tmp/DEBIAN/prerm
	$(install_file)		debian/xscavenger-icon.xpm debian/tmp$(PIXMAPSDIR)/xscavenger-icon.xpm

	# copy doc files but not INSTALL, it won't be needed
	# compress all but copyright
	$(install_file)		README debian/tmp$(DOCDIR)/README
	$(install_file)		CREDITS debian/tmp$(DOCDIR)/CREDITS
	$(install_file)		DOC debian/tmp$(DOCDIR)/DOC
#	$(install_file)		TODO debian/tmp$(DOCDIR)/TODO
	$(install_file)		debian/README.Debian debian/tmp$(DOCDIR)/README.Debian
	$(install_file)		debian/changelog debian/tmp$(DOCDIR)/changelog.Debian
	$(install_file)		changelog debian/tmp$(DOCDIR)/changelog
	gzip -n -9frq		debian/tmp$(DOCDIR)/.
	$(install_file)		debian/copyright debian/tmp$(DOCDIR)/copyright
	$(make_directory)	debian/tmp/usr/share/applications
	$(install_file)		debian/xscavenger.desktop debian/tmp/usr/share/applications/xscavenger.desktop

	dpkg-shlibdeps		debian/tmp$(BINDIR)/xscavenger 
	dpkg-gencontrol         -p$(package) -Pdebian/tmp
	chown -R root.root      debian/tmp
	dpkg --build            debian/tmp ..

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