1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# We don't want make removing intermediary stamps
.SECONDARY :
build-arch: $(addprefix build-modules-,$(flavours))
# Prepare the out-of-tree build directory
printenv:
@echo "confdir : $(confdir)"
@echo "stampdir : $(stampdir)"
prepare-%: $(stampdir)/stamp-prepare-%
@# Empty for make to be happy
$(stampdir)/stamp-prepare-%: target_flavour = $*
$(stampdir)/stamp-prepare-%: $(confdir)/$(arch)
@echo "Preparing $*..."
install -d $(builddir)/build-$*
cd updates; find . | cpio -dumpl $(builddir)/build-$*
cat $^ > $(builddir)/build-$*/.config
# XXX: generate real config
touch $(builddir)/build-$*/ubuntu-config.h
touch $(builddir)/build-$*/ubuntu-build
if [ -z "$(filter $(no_alsa_flavours),$(target_flavour))" ] && grep 'CONFIG_ALSA=m' $(builddir)/build-$*/.config > /dev/null ; then \
cd $(builddir)/build-$*/sound/alsa-driver && make SND_TOPDIR=`pwd` all-deps; \
cd $(builddir)/build-$*/sound/alsa-driver && aclocal && autoconf; \
cd $(builddir)/build-$*/sound/alsa-driver && ./configure --with-kernel=$(KDIR); \
sed -i 's/CONFIG_SND_S3C2412_SOC_I2S=m/CONFIG_SND_S3C2412_SOC_I2S=/' $(builddir)/build-$*/sound/alsa-driver/toplevel.config; \
cd $(builddir)/build-$*/sound/alsa-driver && make SND_TOPDIR=`pwd` dep; \
fi
touch $@
# Do the actual build, including image and modules
build-modules-%: $(stampdir)/stamp-build-%
@# Empty for make to be happy
$(stampdir)/stamp-build-%: target_flavour = $*
$(stampdir)/stamp-build-%: build_arch_t = $(call custom_override,build_arch,$*)
$(stampdir)/stamp-build-%: $(stampdir)/stamp-prepare-%
@echo "Building $*..."
$(kmake) $(conc_level) modules
@touch $@
# Install the finished build
install-%: pkgdir = $(CURDIR)/debian/linux-backports-modules-$(release)-$(abinum)-$*
install-%: moddir = $(pkgdir)/lib/modules/$(release)-$(abinum)-$*
install-%: firmdir = $(pkgdir)/lib/firmware/$(release)-$(abinum)-$*
install-%: basehdrpkg = linux-headers-lbm-$(release)$(debnum)
install-%: hdrpkg = $(basehdrpkg)-$*
install-%: hdrdir = $(CURDIR)/debian/$(hdrpkg)/usr/src/$(hdrpkg)
install-%: target_flavour = $*
install-%: $(stampdir)/stamp-build-%
dh_testdir
dh_testroot
dh_clean -k -plinux-backports-modules-$(release)-$(abinum)-$*
install -d $(firmdir)
#
# This firmware file name has to be consistent with IWL4965_UCODE_API in iwl4965-base.c
#
cp updates/wireless/iwlwifi/firmware/*4965*/*.ucode $(firmdir)/iwlwifi-4965-1-lbm.ucode
cd $(builddir)/build-$*; find . -type f -name '*.ko' | \
cpio -dumpl $(moddir)/updates
ifeq ($(no_image_strip),)
find $(pkgdir)/ -type f -name \*.ko -print | xargs -r strip --strip-debug
endif
install -d $(pkgdir)/DEBIAN
for script in postinst postrm; do \
sed -e 's/@@KVER@@/$(release)-$(abinum)-$*/g' \
debian/control-scripts/$$script > $(pkgdir)/DEBIAN/$$script; \
chmod 755 $(pkgdir)/DEBIAN/$$script; \
done
# The flavour specific headers package
if [ -z "$(filter $(no_alsa_flavours),$(target_flavour))" ] && grep 'CONFIG_ALSA=m' $(builddir)/build-$*/.config > /dev/null ; then \
install -d $(hdrdir)/sound; \
cp `find $(builddir)/build-$*/sound/alsa-kernel/include -type f` $(hdrdir)/sound; \
fi
dh_testdir
dh_testroot
dh_installchangelogs -p$(hdrpkg)
dh_installdocs -p$(hdrpkg)
dh_compress -p$(hdrpkg)
dh_fixperms -p$(hdrpkg)
dh_installdeb -p$(hdrpkg)
dh_gencontrol -p$(hdrpkg)
dh_md5sums -p$(hdrpkg)
dh_builddeb -p$(hdrpkg)
binary-modules-%: pkgimg = linux-backports-modules-$(release)-$(abinum)-$*
binary-modules-%: install-%
dh_testdir
dh_testroot
dh_installchangelogs -p$(pkgimg)
dh_installdocs -p$(pkgimg)
dh_compress -p$(pkgimg)
dh_fixperms -p$(pkgimg)
dh_installdeb -p$(pkgimg)
dh_gencontrol -p$(pkgimg)
dh_md5sums -p$(pkgimg)
dh_builddeb -p$(pkgimg) -- -Zbzip2 -z9
binary-debs: $(addprefix binary-modules-,$(flavours))
binary-arch: binary-debs binary-udebs
|