#!/usr/bin/make -f # # Required variables # version := 2.6.11 abiname := 1 ktver := 5 # # Generally nothing needs to be modified below this line # SHELL := sh -e kbpkg := kernel-kbuild-$(version)-$(abiname) controls := $(wildcard arch/*/control.in arch/*/*/control.in) karch := $(shell dpkg-architecture -qDEB_HOST_ARCH) # # If we are not passed a subarchs variable, we obtain the complete # subarch list as a list of subdirectories in arch/$(karch). We # also export the flavours variables, which allows to control which # flavours are built. # ifndef subarchs subarchs := $(shell find arch/$(karch) \ -type d -mindepth 1 -maxdepth 1 \ ! -name '.svn' ! -name 'patches' \ -printf '%f\n') endif ifeq (,$(subarchs)) subarchs := none endif export version abiname ktver kbuildver flavours unpack: unpack-stamp unpack-stamp: dh_testdir for i in $(subarchs); do \ $(MAKE) subarch=$${i} unpack; \ done ln -s $$(command -v touch) bin/touch.orig touch unpack-stamp build: build-stamp build-stamp: unpack-stamp dh_testdir for i in $(subarchs); do \ $(MAKE) subarch=$${i} build; \ done touch build-stamp clean: dh_testdir rm -f *-stamp-* *-stamp config.* rm -f header-install-* post-install-* bin/touch.orig rm -rf kernel-source-* build-* install-* dh_clean binary-indep: build binary-arch: build dh_testdir for i in $(subarchs); do \ $(MAKE) subarch=$${i} binary; \ done binary: binary-indep binary-arch # # Prepares debian/control by cat'ing together all the # control files, substituting variables, removing all # empty lines and inserting a newline before every # line starting with 'Package:' # debian/control: cat debian/control.in $(controls) | \ sed -e 's,@karch@,$(karch),g' \ -e 's,@version@,$(version),g' \ -e 's,@ktver@,$(ktver),g' \ -e 's,@abiname@,$(abiname),g' \ -e 's,@kbpkg@,$(kbpkg),g' | \ sed '/^[[:space:]]*$$/d' | \ sed 's/^Package:/\n&/g' > debian/control .PHONY: clean build unpack binary-indep binary-arch binary