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
|
#!/usr/bin/make -f
SHELL := sh -e
include debian/rules.defs
GENCONTROL = debian/bin/gencontrol.py
SIGN = debian/bin/sign.py
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_BUILD_ARCH := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
__BINNMU := $(shell dpkg-parsechangelog -SVersion | sed -rne 's,.*\+b([0-9]+)$$,\1,p')
build: build-arch build-indep
build-arch:
build-indep:
$(BUILD_DIR):
@[ -d $@ ] || mkdir $@
clean: debian/control
dh_testdir
rm -rf $(BUILD_DIR)
dh_clean
binary: binary-arch binary-indep
binary-arch: debian/control $(BUILD_DIR)
dh_testdir
$(MAKE) -f debian/rules.gen binary-arch_$(DEB_HOST_ARCH)
binary-indep:
CONTROL_FILES += debian/changelog $(wildcard debian/templates/control.*)
debian/control debian/rules.gen: $(GENCONTROL) $(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: $(GENCONTROL) $(CONTROL_FILES)
dpkg --compare-versions '$(KERNEL_IMAGE_VERSION)$(SIGNED_VERSION_SUFFIX)' lt '$(KERNEL_IMAGE_VERSION)+deb'
$(GENCONTROL) /usr/src/linux-support-$(KERNEL_ABINAME) $(KERNEL_IMAGE_VERSION) '$(SIGNED_VERSION_SUFFIX)'
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
ifdef DEBIAN_KERNEL_BUILD_ANY
binary-arch: binary-arch-all
endif
binary-arch-all: debian/control $(BUILD_DIR)
dh_testdir
$(MAKE) -f debian/rules.gen binary-arch
maintainerclean:
rm -rf debian/control debian/control.md5sum debian/linux-* debian/rules.gen debian/localpackages debian/*-modules-*-di* debian/kernel-image-*-di*
sign:
$(SIGN) /usr/src/linux-support-$(KERNEL_ABINAME) "$(KERNEL_IMAGE_VERSION)" "$(KERNEL_MODULES_PRIVKEY)" "$(KERNEL_MODULES_CERT)" "$(KERNEL_IMAGE_PRIVKEY)" "$(KERNEL_IMAGE_CERT)" "$(MIRROR_URL)" "$(MIRROR_SUITE)"
.PHONY: build build-arch build-indep clean binary binary-arch binary-indep binary-arch-all maintainerclean sign
|