Implemented a nicer way to handle prefixing
of a make-kpkg call with blah32 for 32-bit flavours. svn path=/branches/kernel-image-2.6.11/; revision=3223
This commit is contained in:
parent
4826221cc1
commit
5baa4f3931
17
Makefile
17
Makefile
|
@ -41,7 +41,6 @@ kdir := kernel-source-$(version)-$(subarch)
|
||||||
ifndef flavours
|
ifndef flavours
|
||||||
flavours := $(patsubst config.%,%,$(configs))
|
flavours := $(patsubst config.%,%,$(configs))
|
||||||
endif
|
endif
|
||||||
build_prefix := build-$(subarch)-
|
|
||||||
|
|
||||||
-include $(basedir)/Makefile.inc
|
-include $(basedir)/Makefile.inc
|
||||||
|
|
||||||
|
@ -68,9 +67,16 @@ endif
|
||||||
ifdef build_makeflags
|
ifdef build_makeflags
|
||||||
kpkg_build_cmd := MAKEFLAGS=$(build_makeflags) $(kpkg_build_cmd)
|
kpkg_build_cmd := MAKEFLAGS=$(build_makeflags) $(kpkg_build_cmd)
|
||||||
endif
|
endif
|
||||||
kpkg_image_cmd := $(image_prefix) $(kpkg_build_cmd) --initrd kernel_image
|
#
|
||||||
kpkg_image_cmd := $(strip $(kpkg_image_cmd))
|
# Note that next variable (kpkg_image_pre) is not going to be evaluated
|
||||||
kpkg_build_cmd += build
|
# immediately. When referenced, the variable $* will have the current
|
||||||
|
# flavour for which the command is executed. So if this flavour will
|
||||||
|
# happen to be in the image_prefix_flavours list, the call to make-kpkg
|
||||||
|
# will be prepended with contents if image_prefix.
|
||||||
|
#
|
||||||
|
kpkg_image_pre = $(if $(filter $*,$(image_prefix_flavours)),$(image_prefix))
|
||||||
|
kpkg_image_cmd := $(kpkg_build_cmd) --initrd kernel_image
|
||||||
|
kpkg_build_cmd += build
|
||||||
kpkg_headers_cmd += kernel-headers
|
kpkg_headers_cmd += kernel-headers
|
||||||
ifndef headers_dirs
|
ifndef headers_dirs
|
||||||
headers_dirs = $(karch)
|
headers_dirs = $(karch)
|
||||||
|
@ -104,7 +110,8 @@ binary-arch: build headers-stamp $(istamps)
|
||||||
|
|
||||||
install-stamp-$(subarch)-%: build-$(subarch)-% build-stamp-$(subarch)-%
|
install-stamp-$(subarch)-%: build-$(subarch)-% build-stamp-$(subarch)-%
|
||||||
cp -al $< install-$*;
|
cp -al $< install-$*;
|
||||||
cd install-$*; $(subst @flavour@,$*,$(kpkg_image_cmd))
|
cd install-$*; \
|
||||||
|
$(strip $(kpkg_image_pre) $(subst @flavour@,$*,$(kpkg_image_cmd)))
|
||||||
cat install-$*/debian/files >> debian/files;
|
cat install-$*/debian/files >> debian/files;
|
||||||
rm -rf install-$*;
|
rm -rf install-$*;
|
||||||
touch install-stamp-$(subarch)-$*
|
touch install-stamp-$(subarch)-$*
|
||||||
|
|
22
README
22
README
|
@ -182,15 +182,19 @@ image_postproc
|
||||||
it only required on sparc for stripping of the kernel which is too big
|
it only required on sparc for stripping of the kernel which is too big
|
||||||
to be booted otherwise. Typical use is too ugly to be presented here.
|
to be booted otherwise. Typical use is too ugly to be presented here.
|
||||||
|
|
||||||
|
image_prefix_flavours
|
||||||
image_prefix
|
image_prefix
|
||||||
|
|
||||||
This variable may contain an expression, which will be used as a wrapper
|
These variables allow to prepend the 'make-kpkg kernel_image' call with
|
||||||
for the make-kpkg when its target is kernel_image. This option is a kludge,
|
an arbitrary prefix for selected flavours. Some architectures have a
|
||||||
needed for sparc, which has to prepend this call with either 'sparc32' or
|
32- and 64-bit versions. If kernels are built on the 64-bit hardware, then
|
||||||
'sparc64', depending on the flavour being built (otherwise depmod breaks
|
building a 32-bit kernel usually requires using a wrapper which sets the
|
||||||
when building sparc32 kernels on sparc64). For this obscure case it may
|
correct execution domain (such as sparc32 or linux32). If the variable
|
||||||
be used like that (very evil):
|
image_prefix_flavours is non-empty and contains a space-separated list
|
||||||
|
if flavours, then make-kpkg invocation to create a kernel_image target
|
||||||
|
will be prepended with contents of the image_prefix variable. Typical
|
||||||
|
usage:
|
||||||
|
|
||||||
image_prefix := $${i%-smp}
|
image_prefix_flavours := sparc32 sparc32-smp
|
||||||
|
image_prefix := sparc32
|
||||||
The shell variable ${i} will contain the current flavour in the rules file.
|
|
||||||
|
|
Loading…
Reference in New Issue