File: rules

package info (click to toggle)
wmpuzzle 0.5.2-4
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 400 kB
  • sloc: ansic: 948; sh: 193; makefile: 90
file content (79 lines) | stat: -rwxr-xr-x 2,356 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
#!/usr/bin/make -f

BUILDDIR = debian/wmpuzzle
DEBDIR   = $(BUILDDIR)/DEBIAN
DOCDIR   = $(BUILDDIR)/usr/share/doc/wmpuzzle
testdir  = test -f src/wmpuzzle.c && test -f debian/rules
testroot = test x`whoami` = xroot

ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
	CONFFLAGS += --build $(DEB_HOST_GNU_TYPE)
else
	CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
endif

CPPFLAGS = -Wall $(shell dpkg-buildflags --get CPPFLAGS)
export CPPFLAGS

CFLAGS = -Wall -g $(shell dpkg-buildflags --get CFLAGS)
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
export CFLAGS

LDFLAGS = -Wall $(shell dpkg-buildflags --get LDFLAGS)
export LDFLAGS

clean:
	$(testdir)
	rm -f build debian/files debian/substvars
	[ ! -f src/Makefile ] || $(MAKE) -C src distclean
	rm -rf debian/wmpuzzle

build: build-arch

build-indep:

build-arch:
	$(testdir)
	cd src && ./configure $(CONFFLAGS) --prefix=/usr --bindir=/usr/games --mandir=/usr/share/man
	$(MAKE) -C src
	touch build

binary: binary-arch

binary-indep:

binary-arch: build
	$(testdir)
	$(testroot)
	rm -rf debian/wmpuzle

	$(MAKE) -C src install DESTDIR=$(CURDIR)/debian/wmpuzzle
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	strip -R .comment -R .note $(BUILDDIR)/usr/games/wmpuzzle
endif
	gzip -9n $(BUILDDIR)/usr/share/man/man6/wmpuzzle.6
	install -D -p -o root -g root -m 0644 debian/menu $(BUILDDIR)/usr/share/menu/wmpuzzle

	install -D -p -o root -g root -m 0644 CHANGES $(DOCDIR)/changelog
	install -D -p -o root -g root -m 0644 CHANGES $(DOCDIR)/changelog
	install -D -p -o root -g root -m 0644 debian/changelog $(DOCDIR)/changelog.Debian
	install    -p -o root -g root -m 0644 README debian/copyright $(DOCDIR)
	install -d -p -o root -g root -m 0755 $(DOCDIR)/puzzles
	install    -p -o root -g root -m 0644 src/*.xpm $(DOCDIR)/puzzles
	gzip -9n $(DOCDIR)/changelog*

	install -d -p -o root -g root -m 0755 $(DEBDIR)
	install    -p -o root -g root -m 0644 debian/control $(DEBDIR)
	install    -p -o root -g root -m 0755 debian/postinst debian/postrm $(DEBDIR)
	cd $(BUILDDIR) && find usr -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums
	chmod 0644 $(DEBDIR)/md5sums

	dpkg-shlibdeps $(BUILDDIR)/usr/games/wmpuzzle
	dpkg-gencontrol -isp -pwmpuzzle -P$(BUILDDIR)
	dpkg --build $(BUILDDIR) ..

.PHONY: clean binary binary-indep binary-arch