File: rules.include

package info (click to toggle)
linux-2.6 2.6.32-48squeeze6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 492,732 kB
  • ctags: 1,415,173
  • sloc: ansic: 7,636,125; asm: 225,072; xml: 32,978; makefile: 19,313; perl: 11,533; sh: 3,561; cpp: 3,365; yacc: 2,964; python: 2,893; lex: 1,824; lisp: 218; pascal: 116; awk: 109; sed: 30
file content (61 lines) | stat: -rw-r--r-- 1,856 bytes parent folder | download | duplicates (4)
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
__MODULES_DIR := $(dir $(lastword $(MAKEFILE_LIST)))

DEB_HOST_ARCH  := $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)

include $(__MODULES_DIR)rules.defs

__BINNMU := $(shell dpkg-parsechangelog | sed -ne 's,^Version: .*\+b\(.*\)$$,\1,p')

BUILD_STAMP = $(STAMPS_DIR)/build-base

build: debian/control $(BUILD_STAMP)
$(BUILD_STAMP): $(BUILD_DIR) $(STAMPS_DIR)
	dh_testdir
	$(MAKE) -f debian/rules.gen build_$(DEB_HOST_ARCH)
	touch $@

$(BUILD_DIR) $(STAMPS_DIR):
	@[ -d $@ ] || mkdir $@

clean: debian/control
	dh_testdir
	rm -rf $(BUILD_DIR) $(STAMPS_DIR)
	dh_clean

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

binary-arch:
	dh_testdir
	$(MAKE) -f debian/rules.gen binary-arch_$(DEB_HOST_ARCH)

binary:	binary-indep binary-arch

CONTROL_FILES += debian/changelog $(wildcard debian/templates/control.*) 
CONTROL_FILES += $(wildcard debian/arch/defines) $(wildcard debian/arch/*/defines) $(wildcard debian/arch/*/*/defines)
GENCONTROL = $(__MODULES_DIR)gencontrol.py
debian/control debian/rules.gen: $(CONTROL_FILES)
ifeq ($(wildcard debian/control.md5sum),)
	$(MAKE) -f debian/rules debian/control-real
else ifeq ($(__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: $(CONTROL_FILES)
	$(GENCONTROL) $(__MODULES_DIR)..
	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 binary-indep binary-arch binary