File: rules

package info (click to toggle)
mbr 1.2.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster
  • size: 676 kB
  • sloc: sh: 3,941; ansic: 2,226; makefile: 116
file content (63 lines) | stat: -rwxr-xr-x 1,301 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
#!/usr/bin/make -f

include /usr/share/dpkg/architecture.mk
-include /usr/share/dpkg/buildtools.mk

binaries := $(shell dh_listpackages)

CC := $(CC) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64

CFLAGS := -g -Wall -W
INSTALL_PROGRAM := install

ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
  CFLAGS += -O2
endif

build: build-arch build-indep

build-arch: build-stamp

build-indep: build-stamp

build-stamp:
	./configure --exec-prefix=`pwd`/debian/mbr/ --prefix=`pwd`/debian/mbr/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
	$(MAKE) CC="$(CC)" LD="$(LD)" CFLAGS="$(CFLAGS)"
	touch build

clean:
	dh_testdir
	dh_testroot
	dh_clean
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -f build

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs -p mbr-udeb sbin
	dh_installdocs -p mbr debian/README-1st.Debian NEWS README AUTHORS
	dh_installchangelogs
	$(MAKE) install INSTALL_PROGRAM="$(INSTALL_PROGRAM)"
ifneq ($(filter mbr-udeb,$(binaries)),)
	cp `pwd`/debian/mbr/sbin/install-mbr `pwd`/debian/mbr-udeb/sbin/
endif

binary-indep: build
	dh_testdir

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_strip
	dh_compress
	dh_fixperms
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean