File: rules

package info (click to toggle)
linux 4.9.25-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 794,052 kB
  • ctags: 3,033,799
  • sloc: ansic: 14,481,780; asm: 287,385; makefile: 35,234; perl: 27,553; sh: 15,791; python: 13,364; cpp: 6,087; yacc: 4,337; lex: 2,439; awk: 1,212; pascal: 231; lisp: 218; sed: 21
file content (119 lines) | stat: -rwxr-xr-x 4,040 bytes parent folder | download | duplicates (5)
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
#!/usr/bin/make -f

SHELL    := sh -e
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
SOURCE := $(shell dpkg-parsechangelog -SSource)
VERSION := $(shell dpkg-parsechangelog -SVersion)
VERSION_UPSTREAM := $(shell echo "$(VERSION)" | sed -e 's,-[^-]*$$,,')
VERSION_BINNMU := $(shell echo "$(VERSION)" | sed -rne 's,.*\+b([0-9]+)$$,\1,p')

include debian/rules.defs

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
  DEBIAN_KERNEL_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
ifdef DEBIAN_KERNEL_JOBS
  MAKEFLAGS += -j$(DEBIAN_KERNEL_JOBS)
endif
BUILD_STAGE1 := $(filter stage1,$(DEB_BUILD_PROFILES))
ifneq (,$(filter nodoc,$(DEB_BUILD_PROFILES)))
# This only disables building the linux-doc and linux-manual packages.
# The rules for tools packages check separately for the 'nodoc' profile.
  MAKEFLAGS += DO_DOCS=False
endif
ifneq (,$(filter pkg.linux.notools,$(DEB_BUILD_PROFILES)))
  MAKEFLAGS += DO_TOOLS=False
endif

.NOTPARALLEL:

source: debian/control
	dh_testdir
	$(MAKE) -f debian/rules.gen source

setup: debian/control
	dh_testdir
	$(MAKE) -f debian/rules.gen setup_$(DEB_HOST_ARCH)

build: build-arch build-indep

build-arch: debian/control
	dh_testdir
ifndef BUILD_STAGE1
	$(MAKE) -f debian/rules.gen build-arch_$(DEB_HOST_ARCH)
endif

build-indep: debian/control
	dh_testdir
ifndef BUILD_STAGE1
	$(MAKE) -f debian/rules.gen build-indep
endif

binary:	binary-indep binary-arch

binary-arch:
	dh_testdir
ifdef BUILD_STAGE1
	$(MAKE) -f debian/rules.gen binary-libc-dev_$(DEB_HOST_ARCH)
else
	$(MAKE) -f debian/rules.gen binary-arch_$(DEB_HOST_ARCH)
endif

binary-indep:
	dh_testdir
ifndef BUILD_STAGE1
	$(MAKE) -f debian/rules.gen binary-indep
endif

DIR_ORIG = ../orig/$(SOURCE)-$(VERSION_UPSTREAM)
TAR_ORIG_NAME = $(SOURCE)_$(VERSION_UPSTREAM).orig.tar.xz
TAR_ORIG = $(firstword $(wildcard ../$(TAR_ORIG_NAME)) $(wildcard ../orig/$(TAR_ORIG_NAME)))

orig: $(DIR_ORIG)
	rsync --delete --exclude /debian --exclude .svk --exclude .svn --exclude .git --link-dest=$(DIR_ORIG)/ -a $(DIR_ORIG)/ .
	QUILT_PATCHES='$(CURDIR)/debian/patches' QUILT_PC=.pc quilt push --quiltrc - -a -q --fuzz=0

$(DIR_ORIG):
ifeq ($(TAR_ORIG),)
	$(error Cannot find orig tarball $(TAR_ORIG_NAME))
else
	mkdir -p ../orig
	tar -C ../orig -xaf $(TAR_ORIG)
endif

maintainerclean:
	rm -f debian/config.defines.dump debian/control debian/control.md5sum debian/linux-headers-* debian/linux-image-* debian/rules.gen
	rm -rf $(filter-out debian .svk .svn .git, $(wildcard * .[^.]*))

clean: debian/control
	dh_testdir
	rm -rf $(BUILD_DIR) $(STAMPS_DIR) debian/lib/python/debian_linux/*.pyc debian/lib/python/debian_linux/__pycache__ $$(find debian -maxdepth 1 -type d -name 'linux-*') debian/*-modules-*-di* debian/kernel-image-*-di* debian/xen-linux-system-* debian/*-tmp
	dh_clean

CONTROL_FILES = debian/changelog $(wildcard debian/templates/*.in)
CONTROL_FILES += debian/config/defines $(wildcard debian/config/*/defines) $(wildcard debian/config/*/*/defines)
CONTROL_FILES += $(wildcard debian/installer/*/kernel-versions) $(wildcard debian/installer/*/package-list) debian/installer/package-list
debian/control debian/rules.gen: debian/bin/gencontrol.py $(CONTROL_FILES)
ifeq ($(wildcard debian/control.md5sum),)
	$(MAKE) -f debian/rules debian/control-real
else ifeq ($(VERSION_BINNMU),)
	md5sum --check debian/control.md5sum --status || \
		$(MAKE) -f debian/rules debian/control-real
else
	grep -v debian/changelog debian/control.md5sum | md5sum --check - --status || \
		$(MAKE) -f debian/rules debian/control-real
endif

debian/control-real: debian/bin/gencontrol.py $(CONTROL_FILES)
# Hash randomisation makes the pickled config unreproducible
	PYTHONHASHSEED=0 $<
	md5sum $^ > debian/control.md5sum
	@echo
	@echo This target is made to fail intentionally, to make sure
	@echo that it is NEVER run during the automated build. Please
	@echo ignore the following error, the debian/control file has
	@echo been generated SUCCESSFULLY.
	@echo
	exit 1

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