#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 make/defines.mk: ./configure \ --kernel_src=/usr build: make/defines.mk patch patch: sh debian/build-patch kernel_source = kernel-source-$(VERSION) kernel_source_tar = /usr/src/$(kernel_source).tar.bz2 build-patch: build-patch/$(ID)/diff-$(VERSION)-stamp build-patch/source/$(VERSION)-stamp: @rm -rf build-patch/source 2> /dev/null @mkdir -p build-patch/source 2> /dev/null @echo "Extracting kernel source ..." cd build-patch/source; tar -xjf $(kernel_source_tar) cd build-patch/source/$(kernel_source); /usr/src/kernel-patches/all/$(VERSION)/apply/debian $(DEBIAN_VERSION) touch $@ build-patch/$(ID)/patch-$(VERSION)-stamp: build-patch/source/$(VERSION)-stamp make/defines.mk @echo "Patching kernel ..." @rm -rf build-patch/$(ID) 2> /dev/null @mkdir build-patch/$(ID) 2> /dev/null cp -al build-patch/source/$(kernel_source) build-patch/$(ID)/$(kernel_source) cp -al build-patch/source/$(kernel_source) build-patch/$(ID)/$(kernel_source).orig cd build-patch/$(ID)/$(kernel_source); \ for patch in $(wildcard patches/$(PATCH_VERSION)/0*.patch); do \ echo "Applying patch $$patch ..."; \ patch --no-backup-if-mismatch -p1 < ../../../$$patch || exit 1; \ done make -C src add linux_patched=$(CURDIR)/build-patch/$(ID)/$(kernel_source) touch $@ build-patch/$(ID)/diff-$(VERSION)-stamp: build-patch/$(ID)/patch-$(VERSION)-stamp @echo "Generating new patch ..." -cd build-patch/$(ID); diff -urN $(kernel_source).orig $(kernel_source) > linux-$(ID)-$(VERSION).diff touch $@ clean: dh_testdir dh_testroot rm -f debian/kpatches -$(MAKE) distclean rm -rf build-patch dh_clean install: dh_testdir dh_testroot dh_clean -k dh_installdirs # Build architecture independant packages using the common target. binary-indep: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs dh_installkpatches dh_link dh_strip dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb # Build architecture dependant packages using the common target. binary-arch: binary: binary-arch binary-indep .PHONY: build clean binary-indep binary-arch binary install