Some major changes: each flavour now has a separate
target, making the name of the flavour available to make. svn path=/branches/kernel-image-2.6.11/; revision=3215
This commit is contained in:
parent
6940307761
commit
f258f5f42a
|
@ -5,7 +5,7 @@
|
||||||
# Additionally, variables version, abiname and ktver are
|
# Additionally, variables version, abiname and ktver are
|
||||||
# expected to be available (need to be exported from the parent process).
|
# expected to be available (need to be exported from the parent process).
|
||||||
# It is possible to override the flavours by setting the flavours
|
# It is possible to override the flavours by setting the flavours
|
||||||
# variable.
|
# variable.
|
||||||
#
|
#
|
||||||
SHELL := sh -e
|
SHELL := sh -e
|
||||||
debver := $(version)-$(abiname)
|
debver := $(version)-$(abiname)
|
||||||
|
@ -49,20 +49,18 @@ build_prefix := build-$(subarch)-
|
||||||
# Here we construct the command lines for different make-kpkg
|
# Here we construct the command lines for different make-kpkg
|
||||||
# calls (build, kernel-image, kernel-headers) based on the values
|
# calls (build, kernel-image, kernel-headers) based on the values
|
||||||
# of variables defined so far and provided by the arch/subarch
|
# of variables defined so far and provided by the arch/subarch
|
||||||
# in Makefile.inc. Note that $$i in these expressions is going to
|
# in Makefile.inc. @flavour@ in the expressions is going to be
|
||||||
# become a reference to the shell variable $i, which is expected
|
# replaced by the flavour for which the command is run.
|
||||||
# to have the current flavour. This is slightly evil, but saves
|
|
||||||
# a lot of grief.
|
|
||||||
#
|
#
|
||||||
kpkg_headers_cmd := HEADER_CLEAN_HOOK='$(CURDIR)/header-install-$(subarch)'
|
kpkg_headers_cmd := HEADER_CLEAN_HOOK='$(CURDIR)/header-install-$(subarch)'
|
||||||
kpkg_headers_cmd += make-kpkg --append-to-version $(debnum)$(append)
|
kpkg_headers_cmd += make-kpkg --append-to-version $(debnum)$(append)
|
||||||
kpkg_build_cmd := make-kpkg --append-to-version $(debnum)-$$i
|
kpkg_build_cmd := make-kpkg --append-to-version $(debnum)-@flavour@
|
||||||
ifdef added_patches
|
ifdef added_patches
|
||||||
kpkg_headers_cmd += --added_patches $(subst @uver@,$(uver),$(added_patches))
|
kpkg_headers_cmd += --added_patches $(subst @uver@,$(uver),$(added_patches))
|
||||||
kpkg_build_cmd += --added_patches $(subst @uver@,$(uver),$(added_patches))
|
kpkg_build_cmd += --added_patches $(subst @uver@,$(uver),$(added_patches))
|
||||||
endif
|
endif
|
||||||
ifdef build_subarch
|
ifdef build_subarch
|
||||||
kpkg_build_cmd += --subarch $$i
|
kpkg_build_cmd += --subarch @flavour@
|
||||||
endif
|
endif
|
||||||
ifdef headers_subarch
|
ifdef headers_subarch
|
||||||
kpkg_headers_cmd += --subarch $(headers_subarch)
|
kpkg_headers_cmd += --subarch $(headers_subarch)
|
||||||
|
@ -81,55 +79,43 @@ ifneq (no,$(include_common_config))
|
||||||
ccommon := arch/config.common
|
ccommon := arch/config.common
|
||||||
endif
|
endif
|
||||||
ccommon += arch/$(karch)/config.common arch/$(karch)/$(subarch)/config.common
|
ccommon += arch/$(karch)/config.common arch/$(karch)/$(subarch)/config.common
|
||||||
bdirs := $(addprefix build-$(subarch)-, $(flavours))
|
|
||||||
#
|
#
|
||||||
# TODO:
|
# Here we build lists of directories and stamps which we will depend on.
|
||||||
# * Check that make oldconfig does not actually
|
# For each class of such targets there is a pattern rule which will catch
|
||||||
# change the config file. If it does, something
|
# it and do the right thing.
|
||||||
# is wrong (missing/extra options, etc).
|
#
|
||||||
|
bdirs := $(addprefix build-$(subarch)-, $(flavours))
|
||||||
|
bstamps := $(addprefix build-stamp-$(subarch)-, $(flavours))
|
||||||
|
istamps := $(addprefix install-stamp-$(subarch)-, $(flavours))
|
||||||
|
#
|
||||||
|
# Targets
|
||||||
#
|
#
|
||||||
unpack: unpack-stamp-$(subarch)
|
unpack: unpack-stamp-$(subarch)
|
||||||
unpack-stamp-$(subarch): $(configs) header-install-$(subarch) $(bdirs)
|
unpack-stamp-$(subarch): $(configs) header-install-$(subarch) $(bdirs)
|
||||||
# We remove the configs just in case
|
|
||||||
rm -f $(configs)
|
|
||||||
touch unpack-stamp-$(subarch)
|
touch unpack-stamp-$(subarch)
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
build: build-stamp-$(subarch)
|
build: build-stamp-$(subarch)
|
||||||
build-stamp-$(subarch): unpack-stamp-$(subarch)
|
build-stamp-$(subarch): unpack-stamp-$(subarch) $(bstamps)
|
||||||
dh_testdir
|
|
||||||
PATH=$$PWD/bin:$$PATH; \
|
|
||||||
for i in $(flavours); do \
|
|
||||||
cd build-$(subarch)-$$i; \
|
|
||||||
$(kpkg_build_cmd); \
|
|
||||||
$(if $(image_postproc),$(image_postproc),true); \
|
|
||||||
cd ..; \
|
|
||||||
done
|
|
||||||
touch build-stamp-$(subarch)
|
touch build-stamp-$(subarch)
|
||||||
|
|
||||||
binary-indep: build
|
binary-indep: build
|
||||||
binary-arch: build
|
binary-arch: build headers-stamp $(istamps)
|
||||||
|
mv *.deb ..
|
||||||
|
|
||||||
|
install-stamp-$(subarch)-%: build-$(subarch)-% build-stamp-$(subarch)-%
|
||||||
|
cp -al $< install-$*;
|
||||||
|
cd install-$*; $(kpkg_image_cmd)
|
||||||
|
cat install-$*/debian/files >> debian/files;
|
||||||
|
rm -rf install-$*;
|
||||||
|
touch install-stamp-$(subarch)-$*
|
||||||
|
|
||||||
|
headers-stamp: $(kdir)
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_clean -k
|
dh_clean -k
|
||||||
dh_installdirs
|
dh_installdirs
|
||||||
|
|
||||||
cd $(kdir); $(kpkg_headers_cmd)
|
cd $(kdir); $(kpkg_headers_cmd)
|
||||||
#
|
|
||||||
# Hmm, is it right to just cat all the debian/files
|
|
||||||
# together? Need to check it out...
|
|
||||||
#
|
|
||||||
cat $(kdir)/debian/files >> debian/files
|
cat $(kdir)/debian/files >> debian/files
|
||||||
|
touch headers-stamp
|
||||||
for i in $(flavours); do \
|
|
||||||
cp -al build-$(subarch)-$$i install-$$i; \
|
|
||||||
cd install-$$i; \
|
|
||||||
$(kpkg_image_cmd); \
|
|
||||||
cd ..; \
|
|
||||||
cat install-$$i/debian/files >> debian/files; \
|
|
||||||
rm -rf install-$$i ; \
|
|
||||||
done
|
|
||||||
mv *.deb ..
|
|
||||||
|
|
||||||
binary: binary-indep binary-arch
|
binary: binary-indep binary-arch
|
||||||
|
|
||||||
|
@ -158,6 +144,7 @@ post-install-$(subarch): post-install.in
|
||||||
# arch/$(karch)/Makefile.inc.
|
# arch/$(karch)/Makefile.inc.
|
||||||
#
|
#
|
||||||
config.%:
|
config.%:
|
||||||
|
@echo "configs=$(configs)"
|
||||||
@echo "Generating configuration file $@:"
|
@echo "Generating configuration file $@:"
|
||||||
rm -f $@
|
rm -f $@
|
||||||
for i in $(ccommon); do \
|
for i in $(ccommon); do \
|
||||||
|
@ -167,9 +154,7 @@ config.%:
|
||||||
done
|
done
|
||||||
# Flavour config file must be present
|
# Flavour config file must be present
|
||||||
cat $(basedir)/$@ >> $@
|
cat $(basedir)/$@ >> $@
|
||||||
#
|
|
||||||
# TODO: subarch specific patches
|
|
||||||
#
|
|
||||||
$(kdir): post-install-$(subarch)
|
$(kdir): post-install-$(subarch)
|
||||||
dh_testdir
|
dh_testdir
|
||||||
tar jxf /usr/src/$(tkdir).tar.bz2
|
tar jxf /usr/src/$(tkdir).tar.bz2
|
||||||
|
@ -190,11 +175,26 @@ $(kdir): post-install-$(subarch)
|
||||||
done; \
|
done; \
|
||||||
fi
|
fi
|
||||||
mv $(tkdir) $@
|
mv $(tkdir) $@
|
||||||
|
#
|
||||||
build-%: $(kdir)
|
# This target performs a build for a particular flavour. Note
|
||||||
|
# that in this file it should be always placed *before* the
|
||||||
|
# build-$(subarch)-% target, which creates the build directory.
|
||||||
|
#
|
||||||
|
build-stamp-$(subarch)-%: build-$(subarch)-%
|
||||||
|
dh_testdir
|
||||||
|
PATH=$$PWD/bin:$$PATH; \
|
||||||
|
cd $<; \
|
||||||
|
$(subst @flavour@,$*,$(kpkg_build_cmd)); \
|
||||||
|
$(if $(image_postproc),$(image_postproc),true);
|
||||||
|
touch build-stamp-$(subarch)-$*
|
||||||
|
#
|
||||||
|
# Creates a build directory for a particular flavour
|
||||||
|
#
|
||||||
|
build-$(subarch)-%: $(kdir) config.%
|
||||||
|
dh_testdir
|
||||||
if [ ! -d $@ ]; then \
|
if [ ! -d $@ ]; then \
|
||||||
cp -al $(kdir) $@; \
|
cp -al $(kdir) $@; \
|
||||||
cp config.$(subst build-$(subarch)-,,$@) $@/.config; \
|
cp config.$* $@/.config; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
.PHONY: build unpack binary-indep binary-arch binary
|
.PHONY: build unpack binary-indep binary-arch binary
|
|
@ -4,7 +4,7 @@
|
||||||
#
|
#
|
||||||
version := 2.6.11
|
version := 2.6.11
|
||||||
abiname := 1
|
abiname := 1
|
||||||
ktver := 4
|
ktver := 5
|
||||||
#
|
#
|
||||||
# Generally nothing needs to be modified below this line
|
# Generally nothing needs to be modified below this line
|
||||||
#
|
#
|
||||||
|
@ -34,7 +34,7 @@ unpack: unpack-stamp
|
||||||
unpack-stamp:
|
unpack-stamp:
|
||||||
dh_testdir
|
dh_testdir
|
||||||
for i in $(subarchs); do \
|
for i in $(subarchs); do \
|
||||||
$(MAKE) -f debian/rules.subarch subarch=$${i} unpack; \
|
$(MAKE) subarch=$${i} unpack; \
|
||||||
done
|
done
|
||||||
ln -s $$(command -v touch) bin/touch.orig
|
ln -s $$(command -v touch) bin/touch.orig
|
||||||
touch unpack-stamp
|
touch unpack-stamp
|
||||||
|
@ -43,7 +43,7 @@ build: build-stamp
|
||||||
build-stamp: unpack-stamp
|
build-stamp: unpack-stamp
|
||||||
dh_testdir
|
dh_testdir
|
||||||
for i in $(subarchs); do \
|
for i in $(subarchs); do \
|
||||||
$(MAKE) -f debian/rules.subarch subarch=$${i} build; \
|
$(MAKE) subarch=$${i} build; \
|
||||||
done
|
done
|
||||||
touch build-stamp
|
touch build-stamp
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ binary-indep: build
|
||||||
binary-arch: build
|
binary-arch: build
|
||||||
dh_testdir
|
dh_testdir
|
||||||
for i in $(subarchs); do \
|
for i in $(subarchs); do \
|
||||||
$(MAKE) -f debian/rules.subarch subarch=$${i} binary; \
|
$(MAKE) subarch=$${i} binary; \
|
||||||
done
|
done
|
||||||
|
|
||||||
binary: binary-indep binary-arch
|
binary: binary-indep binary-arch
|
||||||
|
|
Loading…
Reference in New Issue