* '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
This commit is contained in:
Jurij Smakov 2005-05-12 05:58:57 +00:00
parent 4271cb729c
commit 754c6795b1
3 changed files with 71 additions and 4 deletions

29
README
View File

@ -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.

View File

@ -2,3 +2,6 @@
# Variables
#
include_common_config = no
added_patches = blah
arch_with_subarch = yes
arch_makeflags = 'CC=gcc-2.95'

43
debian/rules vendored
View File

@ -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' \