Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: debian.chrome/rules.d/2-binary-arch.mk

Issue 646032: Rename config to match naming convention. (Closed)
Patch Set: Send mail Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « debian.chrome/rules.d/1-maintainer.mk ('k') | debian.chrome/rules.d/3-binary-indep.mk » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # We don't want make removing intermediary stamps
2 .SECONDARY :
3
4 # Prepare the out-of-tree build directory
5
6 prepare-%: $(stampdir)/stamp-prepare-%
7 @# Empty for make to be happy
8 $(stampdir)/stamp-prepare-%: target_flavour = $*
9 $(stampdir)/stamp-prepare-%: $(commonconfdir)/config.common.$(family) $(archconf dir)/config.common.$(arch) $(archconfdir)/config.flavour.%
10 @echo "Preparing $*..."
11 install -d $(builddir)/build-$*
12 touch $(builddir)/build-$*/ubuntu-build
13 cat $^ | sed -e 's/.*CONFIG_VERSION_SIGNATURE.*/CONFIG_VERSION_SIGNATURE ="Ubuntu $(release)-$(revision)-$*"/' > $(builddir)/build-$*/.config
14 find $(builddir)/build-$* -name "*.ko" | xargs rm -f
15 $(kmake) O=$(builddir)/build-$* silentoldconfig prepare scripts
16 touch $@
17
18
19 # Do the actual build, including image and modules
20 build-%: $(stampdir)/stamp-build-%
21 @# Empty for make to be happy
22 $(stampdir)/stamp-build-%: target_flavour = $*
23 $(stampdir)/stamp-build-%: $(stampdir)/stamp-prepare-%
24 @echo "Building $*..."
25 $(kmake) O=$(builddir)/build-$* $(conc_level) $(build_image)
26 $(kmake) O=$(builddir)/build-$* $(conc_level) modules
27 @touch $@
28
29 # Install the finished build
30 install-%: pkgdir = $(CURDIR)/debian/$(bin_pkg_name)-$*
31 install-%: bindoc = $(pkgdir)/usr/share/doc/$(bin_pkg_name)-$*
32 install-%: dbgpkgdir = $(CURDIR)/debian/$(dbg_pkg_name)-$*
33 install-%: basepkg = $(hdrs_pkg_name)
34 install-%: hdrdir = $(CURDIR)/debian/$(basepkg)-$*/usr/src/$(basepkg)-$*
35 install-%: target_flavour = $*
36 install-%: $(stampdir)/stamp-build-% checks-%
37 dh_testdir
38 dh_testroot
39 dh_clean -k -p$(bin_pkg_name)-$*
40 dh_clean -k -p$(hdrs_pkg_name)-$*
41 dh_clean -k -p$(dbg_pkg_name)-$*
42
43 # The main image
44 # compress_file logic required because not all architectures
45 # generate a zImage automatically out of the box
46 ifeq ($(compress_file),)
47 install -m644 -D $(builddir)/build-$*/$(kernel_file) \
48 $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
49 else
50 install -d $(pkgdir)/boot
51 gzip -c9v $(builddir)/build-$*/$(kernel_file) > \
52 $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
53 chmod 644 $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
54 endif
55
56 install -m644 $(builddir)/build-$*/.config \
57 $(pkgdir)/boot/config-$(abi_release)-$*
58 install -m644 $(abidir)/$* \
59 $(pkgdir)/boot/abi-$(abi_release)-$*
60 install -m644 $(builddir)/build-$*/System.map \
61 $(pkgdir)/boot/System.map-$(abi_release)-$*
62 ifeq ($(no_dumpfile),)
63 makedumpfile -g $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$* \
64 -x $(builddir)/build-$*/vmlinux
65 endif
66
67 $(kmake) O=$(builddir)/build-$* modules_install \
68 INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=$(pkgdir)/ \
69 INSTALL_FW_PATH=$(pkgdir)/lib/firmware/$(abi_release)-$*
70
71 ifeq ($(no_dumpfile),)
72 makedumpfile -g $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$* \
73 -x $(builddir)/build-$*/vmlinux
74 endif
75 rm -f $(pkgdir)/lib/modules/$(abi_release)-$*/build
76 rm -f $(pkgdir)/lib/modules/$(abi_release)-$*/source
77
78 # Some initramfs-tools specific modules
79 install -d $(pkgdir)/lib/modules/$(abi_release)-$*/initrd
80 if [ -f $(pkgdir)/lib/modules/$(abi_release)-$*/kernel/drivers/video/ves afb.ko ]; then\
81 ln -f $(pkgdir)/lib/modules/$(abi_release)-$*/kernel/drivers/video/ves afb.ko \
82 $(pkgdir)/lib/modules/$(abi_release)-$*/initrd/; \
83 fi
84
85 # Now the image scripts
86 install -d $(pkgdir)/DEBIAN
87 for script in postinst postrm preinst prerm; do \
88 sed -e 's/=V/$(abi_release)-$*/g' -e 's/=K/$(install_file)/g' \
89 -e 's/=L/$(loader)/g' -e 's@=B@$(build_arch)@g' \
90 $(DEBIAN)/control-scripts/$$script > $(pkgdir)/DEBIAN/$$script; \
91 chmod 755 $(pkgdir)/DEBIAN/$$script; \
92 done
93
94 # Install the full changelog.
95 install -d $(bindoc)
96 cat $(DEBIAN)/changelog $(DEBIAN)/changelog.historical | \
97 gzip -9 >$(bindoc)/changelog.Debian.old.gz
98 chmod 644 $(bindoc)/changelog.Debian.old.gz
99
100 ifneq ($(skipsub),true)
101 for sub in $($(*)_sub); do \
102 if ! (TO=$$sub FROM=$* ABI_RELEASE=$(abi_release) $(SHELL) \
103 $(DEBIAN)/scripts/sub-flavour); then exit 1; fi; \
104 /sbin/depmod -b debian/$(bin_pkg_name)-$$sub \
105 -ea -F debian/$(bin_pkg_name)-$$sub/boot/System.map-$(ab i_release)-$* \
106 $(abi_release)-$*; \
107 install -d debian/$(bin_pkg_name)-$$sub/DEBIAN; \
108 for script in postinst postrm preinst prerm; do \
109 sed -e 's/=V/$(abi_release)-$*/g' \
110 -e 's/=K/$(install_file)/g' \
111 -e 's/=L/$(loader)/g' \
112 -e 's@=B@$(build_arch)@g' \
113 $(DEBIAN)/control-scripts/$$script > \
114 debian/$(bin_pkg_name)-$$sub/DEBIAN/$$script;\
115 chmod 755 debian/$(bin_pkg_name)-$$sub/DEBIAN/$$script; \
116 done; \
117 done
118 endif
119
120 ifneq ($(skipdbg),true)
121 # Debug image is simple
122 install -m644 -D $(builddir)/build-$*/vmlinux \
123 $(dbgpkgdir)/usr/lib/debug/boot/vmlinux-$(abi_release)-$*
124 $(kmake) O=$(builddir)/build-$* modules_install \
125 INSTALL_MOD_PATH=$(dbgpkgdir)/usr/lib/debug
126 rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/build
127 rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/source
128 rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/modules.*
129 rm -fr $(dbgpkgdir)/usr/lib/debug/lib/firmware
130 endif
131
132 # The flavour specific headers image
133 # TODO: Would be nice if we didn't have to dupe the original builddir
134 install -d -m755 $(hdrdir)
135 cat $(builddir)/build-$*/.config | \
136 sed -e 's/.*CONFIG_DEBUG_INFO=.*/# CONFIG_DEBUG_INFO is not set/ g' > \
137 $(hdrdir)/.config
138 chmod 644 $(hdrdir)/.config
139 $(kmake) O=$(hdrdir) silentoldconfig prepare scripts
140 # We'll symlink this stuff
141 rm -f $(hdrdir)/Makefile
142 rm -rf $(hdrdir)/include2
143 # powerpc seems to need some .o files for external module linking. Add t hem in.
144 ifeq ($(arch),powerpc)
145 mkdir -p $(hdrdir)/arch/powerpc/lib
146 cp $(builddir)/build-$*/arch/powerpc/lib/*.o $(hdrdir)/arch/powerpc/lib
147 endif
148 # Script to symlink everything up
149 $(SHELL) $(DEBIAN)/scripts/link-headers "$(hdrdir)" "$(basepkg)" "$*"
150 # Setup the proper asm symlink
151 rm -f $(hdrdir)/include/asm
152 ln -s asm-$(asm_link) $(hdrdir)/include/asm
153 # The build symlink
154 install -d debian/$(basepkg)-$*/lib/modules/$(abi_release)-$*
155 ln -s /usr/src/$(basepkg)-$* \
156 debian/$(basepkg)-$*/lib/modules/$(abi_release)-$*/build
157 # And finally the symvers
158 install -m644 $(builddir)/build-$*/Module.symvers \
159 $(hdrdir)/Module.symvers
160
161 # Now the header scripts
162 install -d $(CURDIR)/debian/$(basepkg)-$*/DEBIAN
163 for script in postinst; do \
164 sed -e 's/=V/$(abi_release)-$*/g' -e 's/=K/$(install_file)/g' \
165 $(DEBIAN)/control-scripts/headers-$$script > \
166 $(CURDIR)/debian/$(basepkg)-$*/DEBIAN/$$script; \
167 chmod 755 $(CURDIR)/debian/$(basepkg)-$*/DEBIAN/$$script; \
168 done
169
170 # At the end of the package prep, call the tests
171 DPKG_ARCH="$(arch)" KERN_ARCH="$(build_arch)" FLAVOUR="$*" \
172 VERSION="$(abi_release)" REVISION="$(revision)" \
173 PREV_REVISION="$(prev_revision)" ABI_NUM="$(abinum)" \
174 PREV_ABI_NUM="$(prev_abinum)" BUILD_DIR="$(builddir)/build-$*" \
175 INSTALL_DIR="$(pkgdir)" SOURCE_DIR="$(CURDIR)" \
176 run-parts -v $(DEBIAN)/tests
177
178 #
179 # Remove files which are generated at installation by postinst, except f or
180 # modules.order.
181 #
182 mv $(pkgdir)/lib/modules/$(abi_release)-$*/modules.order \
183 $(pkgdir)/lib/modules/$(abi_release)-$*/_modules.order
184 rm -f $(pkgdir)/lib/modules/$(abi_release)-$*/modules.*
185 mv $(pkgdir)/lib/modules/$(abi_release)-$*/_modules.order \
186 $(pkgdir)/lib/modules/$(abi_release)-$*/modules.order
187
188 headers_tmp := $(CURDIR)/debian/tmp-headers
189 headers_dir := $(CURDIR)/debian/linux-libc-dev
190
191 hmake := $(MAKE) -C $(CURDIR) O=$(headers_tmp) SUBLEVEL=$(SUBLEVEL) \
192 EXTRAVERSION=-$(abinum) INSTALL_HDR_PATH=$(headers_tmp)/install \
193 SHELL="$(SHELL)" ARCH=$(header_arch)
194
195 install-arch-headers:
196 dh_testdir
197 dh_testroot
198 dh_clean -k -plinux-libc-dev
199
200 rm -rf $(headers_tmp)
201 install -d $(headers_tmp) $(headers_dir)/usr/include/
202
203 $(hmake) $(defconfig)
204 mv $(headers_tmp)/.config $(headers_tmp)/.config.old
205 sed -e 's/^# \(CONFIG_MODVERSIONS\) is not set$$/\1=y/' \
206 -e 's/.*CONFIG_LOCALVERSION_AUTO.*/# CONFIG_LOCALVERSION_AUTO is not s et/' \
207 $(headers_tmp)/.config.old > $(headers_tmp)/.config
208 $(hmake) silentoldconfig
209 $(hmake) headers_install
210
211 ( cd $(headers_tmp)/install/include/ && \
212 find . -name '.' -o -name '.*' -prune -o -print | \
213 cpio -pvd --preserve-modification-time \
214 $(headers_dir)/usr/include/ )
215
216 rm -rf $(headers_tmp)
217
218 binary-arch-headers: install-arch-headers
219 dh_testdir
220 dh_testroot
221
222 dh_installchangelogs -plinux-libc-dev
223 dh_installdocs -plinux-libc-dev
224 dh_compress -plinux-libc-dev
225 dh_fixperms -plinux-libc-dev
226 dh_installdeb -plinux-libc-dev
227 dh_gencontrol -plinux-libc-dev
228 dh_md5sums -plinux-libc-dev
229 dh_builddeb -plinux-libc-dev
230
231 binary-%: pkgimg = $(bin_pkg_name)-$*
232 binary-%: pkghdr = $(hdrs_pkg_name)-$*
233 binary-%: dbgpkg = $(dbg_pkg_name)-$*
234 binary-%: install-%
235 dh_testdir
236 dh_testroot
237
238 dh_installchangelogs -p$(pkgimg)
239 dh_installdocs -p$(pkgimg)
240 dh_compress -p$(pkgimg)
241 dh_fixperms -p$(pkgimg)
242 dh_installdeb -p$(pkgimg)
243 dh_gencontrol -p$(pkgimg)
244 dh_md5sums -p$(pkgimg)
245 dh_builddeb -p$(pkgimg) -- -Zbzip2 -z9
246
247 dh_installchangelogs -p$(pkghdr)
248 dh_installdocs -p$(pkghdr)
249 dh_compress -p$(pkghdr)
250 dh_fixperms -p$(pkghdr)
251 dh_shlibdeps -p$(pkghdr)
252 dh_installdeb -p$(pkghdr)
253 dh_gencontrol -p$(pkghdr)
254 dh_md5sums -p$(pkghdr)
255 dh_builddeb -p$(pkghdr)
256
257 ifneq ($(skipsub),true)
258 @set -e; for sub in $($(*)_sub); do \
259 pkg=$(bin_pkg_name)-$$sub; \
260 dh_installchangelogs -p$$pkg; \
261 dh_installdocs -p$$pkg; \
262 dh_compress -p$$pkg; \
263 dh_fixperms -p$$pkg; \
264 dh_shlibdeps -p$$pkg; \
265 dh_installdeb -p$$pkg; \
266 dh_gencontrol -p$$pkg; \
267 dh_md5sums -p$$pkg; \
268 dh_builddeb -p$$pkg; \
269 done
270 endif
271
272 ifneq ($(skipdbg),true)
273 dh_installchangelogs -p$(dbgpkg)
274 dh_installdocs -p$(dbgpkg)
275 dh_compress -p$(dbgpkg)
276 dh_fixperms -p$(dbgpkg)
277 dh_installdeb -p$(dbgpkg)
278 dh_gencontrol -p$(dbgpkg)
279 dh_md5sums -p$(dbgpkg)
280 dh_builddeb -p$(dbgpkg)
281
282 # Hokay...here's where we do a little twiddling...
283 # Renaming the debug package prevents it from getting into
284 # the primary archive, and therefore prevents this very large
285 # package from being mirrored. It is instead, through some
286 # archive admin hackery, copied to http://ddebs.ubuntu.com.
287 #
288 mv ../$(dbgpkg)_$(release)-$(revision)_$(arch).deb \
289 ../$(dbgpkg)_$(release)-$(revision)_$(arch).ddeb
290 grep -v '^$(dbgpkg)_.*$$' debian/files > debian/files.new
291 mv debian/files.new debian/files
292 # Now, the package wont get into the archive, but it will get put
293 # into the debug system.
294 endif
295
296 $(stampdir)/stamp-flavours:
297 @echo $(flavours) > $@
298
299 binary-debs: $(stampdir)/stamp-flavours $(addprefix binary-,$(flavours)) \
300 binary-arch-headers
301
302 build-arch: $(addprefix build-,$(flavours))
303
304 binary-arch-deps = binary-debs
305 ifeq ($(AUTOBUILD),)
306 binary-arch-deps += binary-udebs
307 endif
308 binary-arch: $(binary-arch-deps)
OLDNEW
« no previous file with comments | « debian.chrome/rules.d/1-maintainer.mk ('k') | debian.chrome/rules.d/3-binary-indep.mk » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698