From 754c6795b17d1efdb5f5612cdf2015c1e662e3fe Mon Sep 17 00:00:00 2001 From: Jurij Smakov Date: Thu, 12 May 2005 05:58:57 +0000 Subject: [PATCH] * 'build' target implemented. * Additional variables which can be defined on per-arch basis (in Makefile.inc) introduced and documented in README. svn path=/branches/kernel-image-2.6.11/; revision=3044 --- README | 29 ++++++++++++++++++++++++++++ arch/i386/Makefile.inc | 3 +++ debian/rules | 43 ++++++++++++++++++++++++++++++++++++++---- 3 files changed, 71 insertions(+), 4 deletions(-) diff --git a/README b/README index 32a9507af..c1cfd076c 100644 --- a/README +++ b/README @@ -56,3 +56,32 @@ header_dirs above). For sparc, for example, if will have to be set to 'sparc | sparc64' for the correct packages to be generated. See headers-install file for details. + +arch_makeflags + + This variable may contain the make flags settings for the + make-kpkg invocation in the 'build' target. Currently it is + only used by amd64, where it should be set to something like + + arch_makeflags = 'CC=amd64-linux-gcc V=1" + +added_patches + + Setting this variable to non-empty value will cause an option + --added_patches to be added to the make-kpkg call in 'build' + target, followed by the contents of this variable. Currently + hppa is using it and it looks like ia64 have used it before. + +arch_with_subarch + + Setting this variable to non-empty value will cause an option + --subarch to be added to make-kpkg call in 'build' target, + followed by the flavour for which the kernel is built. NOTE + that the contents of this variable are completely ignored, + any non-empty value indicates that --subarch option should + be added. In general, if you wish to add subarch support for + your architecture, you should contact kernel-package maintainer + to ensure that the flavour name correctly maps onto a kernel + subarch name. Currently only mips and sparc are using this + facility, and both of them should be fine. + diff --git a/arch/i386/Makefile.inc b/arch/i386/Makefile.inc index c3c90ee83..54cb8e161 100644 --- a/arch/i386/Makefile.inc +++ b/arch/i386/Makefile.inc @@ -2,3 +2,6 @@ # Variables # include_common_config = no +added_patches = blah +arch_with_subarch = yes +arch_makeflags = 'CC=gcc-2.95' diff --git a/debian/rules b/debian/rules index 986a30c4a..bc11b8e72 100755 --- a/debian/rules +++ b/debian/rules @@ -37,7 +37,10 @@ ifndef header_dirs header_dirs = $(karch) endif - +# +# Unresolved issues: +# Where does the default config comes from? +# unpack: unpack-stamp unpack-stamp: $(kdir) $(configs) header-install.out for i in $(flavours); do \ @@ -45,16 +48,48 @@ unpack-stamp: $(kdir) $(configs) header-install.out cp config.$$i build-$$i/.config; \ make -C build-$$i ARCH=$(karch) oldconfig; \ done -# Have to figure out what to do with that one # cp default $(kdir)/.config ln -s $$(command -v touch) bin/touch.orig - touch $@ + touch unpack-stamp + +# +# Subarch usage: +# Currently only mips and sparc are calling make-kpkg +# with --subarch. mips is just using the names of the +# flavours, while for sparc it is more complicated. +# After looking at /usr/share/kernel-package/rules, I +# believe that everything will work correctly in sparc +# if use flavour as an argument to subarch. +# +# Unresolved issues: +# m68k,mips have no-op build targets +# How to handle subarch (mips, sparc)? +# What's the deal with sparc trying to strip +# the kernel and copy System.map? +# +build: build-stamp +build-stamp: unpack-stamp + dh_testdir + PATH=$$PWD/bin:$$PATH; \ + for i in $(flavours); do \ + cd build-$$i; \ + OPTS="--append_to_version $(debnum)-$$i"; \ + if [ -n '$(added_patches)' ]; then \ + OPTS="$${OPTS} --added_patches $(added_patches)"; \ + fi; \ + if [ -n '$(arch_with_subarch)' ]; then \ + OPTS="$${OPTS} --subarch $$i"; \ + fi; \ + MAKEFLAGS='$(arch_makeflags)' make-kpkg $${OPTS}; \ + cd ..; \ + done + touch build-stamp clean: rm -f *-stamp header-install.out config.* rm -rf $(kdir) build-* install-* bin/touch.orig dh_clean - + header-install.out: header-install sed -e 's/@kbpkg@/$(kbpkg)/g' \ -e 's/@karch@/$(karch)/g' \