File: rules.include

package info (click to toggle)
linux-2.6 2.6.18.dfsg.1-26etch2
  • links: PTS
  • area: main
  • in suites: etch
  • size: 289,112 kB
  • ctags: 831,064
  • sloc: ansic: 4,700,345; asm: 205,595; makefile: 13,019; perl: 3,208; python: 2,735; yacc: 2,632; sh: 2,313; cpp: 2,107; lex: 1,510; lisp: 218; awk: 99; pascal: 41
file content (65 lines) | stat: -rw-r--r-- 1,980 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
__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)
	if [ -f debian/control ] && [ -f debian/control.md5sum ] && [ -f debian/rules.gen ]; then \
		if [ "$(__BINNMU)" ]; then \
			if ! grep -v debian/changelog debian/control.md5sum | md5sum --check - --status; then \
				$(MAKE) -f debian/rules debian/control-real; \
			fi \
		else \
			if ! md5sum --check debian/control.md5sum --status; then \
				$(MAKE) -f debian/rules debian/control-real; \
			fi \
		fi \
	else \
		$(MAKE) -f debian/rules debian/control-real; \
	fi

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