File: rules

package info (click to toggle)
mac-fdisk 0.1-1
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 344 kB
  • ctags: 814
  • sloc: ansic: 5,745; makefile: 100; sh: 23
file content (97 lines) | stat: -rwxr-xr-x 2,584 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
#!/usr/bin/make -f
# Made with the aid of debmake, by Christoph Lameter,
# based on the sample debian/rules file for GNU hello by Ian Jackson.

export DH_VERBOSE=1

BUILDARCH = $(shell dpkg --print-gnu-build-architecture)

packmn  = mac-fdisk
packmc  = mac-fdisk-cross
packpmn = pmac-fdisk
packpmc = pmac-fdisk-cross
tmpmn   = debian/tmp
tmpmc   = debian/$(packmc)
tmppmn  = debian/$(packpmn)
tmppmc  = debian/$(packpmc)
docmn   = $(tmpmn)/usr/doc/$(packmn)
docmc   = $(tmpmc)/usr/doc/$(packmc)
docpmn  = $(tmppmn)/usr/doc/$(packpmn)
docpmc  = $(tmppmc)/usr/doc/$(packpmc)

build:
	$(checkdir)
	make CFLAGS="-O2 -g -Wall"
	touch build

clean:
	$(checkdir)
	-rm -f build
	-make clean
	-rm -f `find . -name "*~"`
	-rm -rf $(tmpmn) $(tmpmc) $(tmppmn) $(tmppmc) debian/files* core debian/substvars

binary-indep: 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: build
	dh_testdir pdisk.h
	dh_testroot
	dh_clean -k
	dh_installdirs
	install -d $(tmpmn)/sbin
	install -m 755 pdisk $(tmpmn)/sbin/mac-fdisk
	install -d $(tmpmc)/usr/sbin
	install -m 755 pdisk $(tmpmc)/usr/sbin/mac-fdisk
	install -d $(tmppmn)/sbin
	install -m 755 fdisk $(tmppmn)/sbin/pmac-fdisk
	install -d $(tmppmc)/usr/sbin
	install -m 755 fdisk $(tmppmc)/usr/sbin/pmac-fdisk
	dh_installdocs -A README
	# install README.Debian also in cross package (not done by dh_installdocs)
	install -m 644 debian/README.debian $(docmc)/README.Debian
	dh_installmanpages
	dh_installchangelogs HISTORY
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	# build native pdisk only for m68k, cross package only for others
	set -e; if [ "$(BUILDARCH)" = "m68k" ]; then \
		dh_gencontrol -p$(packmn); \
	else \
		dh_gencontrol -p$(packmc); \
	fi
	# build native fdisk only for powerpc, cross package only for others
	set -e; if [ "$(BUILDARCH)" = "powerpc" ]; then \
		dh_gencontrol -p$(packpmn); \
	else \
		dh_gencontrol -p$(packpmc); \
	fi
	dh_md5sums
	set -e; if [ "$(BUILDARCH)" = "m68k" ]; then \
		dh_builddeb -p$(packmn); \
	elif [ "$(BUILDARCH)" = "sparc" -o "$(BUILDARCH)" = "powerpc" ]; then \
		dh_builddeb -p$(packmc); \
	fi
	set -e; if [ "$(BUILDARCH)" = "powerpc" ]; then \
		dh_builddeb -p$(packpmn); \
	elif [ "$(BUILDARCH)" = "sparc" -o "$(BUILDARCH)" = "m68k" ]; then \
		dh_builddeb -p$(packpmc); \
	fi

define checkdir
	test -f debian/rules
endef

binary: binary-indep binary-arch

checkroot:
	$(checkdir)
	test root = "`whoami`"

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