UBUNTU: [Config] Removed stamp-flavours target
[linux-flexiantxendom0-natty.git] / debian / rules.d / 2-binary-arch.mk
index c66973d..00df4a9 100644 (file)
@@ -10,9 +10,7 @@ build_cd =
 build_O  = O=$(builddir)/build-$*
 endif
 
-prepare-%: $(stampdir)/stamp-prepare-%
-       @# Empty for make to be happy
-$(stampdir)/stamp-prepare-%: $(stampdir)/stamp-prepare-tree-% prepare-checks-%
+$(stampdir)/stamp-prepare-%: config-prepare-check-%
        @touch $@
 $(stampdir)/stamp-prepare-tree-%: target_flavour = $*
 $(stampdir)/stamp-prepare-tree-%: $(commonconfdir)/config.common.$(family) $(archconfdir)/config.common.$(arch) $(archconfdir)/config.flavour.%
@@ -23,17 +21,16 @@ $(stampdir)/stamp-prepare-tree-%: $(commonconfdir)/config.common.$(family) $(arc
                rsync -a --exclude debian --exclude debian.master --exclude $(DEBIAN) * $(builddir)/build-$*
        cat $^ | sed -e 's/.*CONFIG_VERSION_SIGNATURE.*/CONFIG_VERSION_SIGNATURE="Ubuntu $(release)-$(revision)-$* $(release)$(extraversion)"/' > $(builddir)/build-$*/.config
        find $(builddir)/build-$* -name "*.ko" | xargs rm -f
-       $(build_cd) $(kmake) $(build_O) silentoldconfig prepare scripts
+       $(build_cd) $(kmake) $(build_O) -j1 silentoldconfig prepare scripts
        touch $@
 
 # Do the actual build, including image and modules
 build-%: $(stampdir)/stamp-build-%
        @# Empty for make to be happy
 $(stampdir)/stamp-build-%: target_flavour = $*
-$(stampdir)/stamp-build-%: prepare-%
+$(stampdir)/stamp-build-%: $(stampdir)/stamp-prepare-%
        @echo "Building $*..."
-       $(build_cd) $(kmake) $(build_O) $(conc_level) $(build_image)
-       $(build_cd) $(kmake) $(build_O) $(conc_level) modules
+       $(build_cd) $(kmake) $(build_O) $(conc_level) $(build_image) modules
        @touch $@
 
 # Install the finished build
@@ -43,7 +40,7 @@ install-%: dbgpkgdir = $(CURDIR)/debian/$(bin_pkg_name)-$*-dbgsym
 install-%: basepkg = $(hdrs_pkg_name)
 install-%: hdrdir = $(CURDIR)/debian/$(basepkg)-$*/usr/src/$(basepkg)-$*
 install-%: target_flavour = $*
-install-%: $(stampdir)/stamp-build-% checks-%
+install-%: checks-%
        dh_testdir
        dh_testroot
        dh_clean -k -p$(bin_pkg_name)-$*
@@ -54,27 +51,28 @@ install-%: $(stampdir)/stamp-build-% checks-%
        # compress_file logic required because not all architectures
        # generate a zImage automatically out of the box
 ifeq ($(compress_file),)
-       install -m644 -D $(builddir)/build-$*/$(kernel_file) \
+       install -m600 -D $(builddir)/build-$*/$(kernel_file) \
                $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
 else
        install -d $(pkgdir)/boot
        gzip -c9v $(builddir)/build-$*/$(kernel_file) > \
                $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
-       chmod 644 $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
+       chmod 600 $(pkgdir)/boot/$(install_file)-$(abi_release)-$*
 endif
 
        install -m644 $(builddir)/build-$*/.config \
                $(pkgdir)/boot/config-$(abi_release)-$*
        install -m644 $(abidir)/$* \
                $(pkgdir)/boot/abi-$(abi_release)-$*
-       install -m644 $(builddir)/build-$*/System.map \
+       install -m600 $(builddir)/build-$*/System.map \
                $(pkgdir)/boot/System.map-$(abi_release)-$*
 ifeq ($(no_dumpfile),)
        makedumpfile -g $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$* \
                -x $(builddir)/build-$*/vmlinux
+       chmod 0600 $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$*
 endif
 
-       $(build_cd) $(kmake) $(build_O) modules_install \
+       $(build_cd) $(kmake) $(build_O) $(conc_level) modules_install \
                INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=$(pkgdir)/ \
                INSTALL_FW_PATH=$(pkgdir)/lib/firmware/$(abi_release)-$*
 
@@ -92,6 +90,7 @@ endif
 ifeq ($(no_dumpfile),)
        makedumpfile -g $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$* \
                -x $(builddir)/build-$*/vmlinux
+       chmod 0600 $(pkgdir)/boot/vmcoreinfo-$(abi_release)-$*
 endif
        rm -f $(pkgdir)/lib/modules/$(abi_release)-$*/build
        rm -f $(pkgdir)/lib/modules/$(abi_release)-$*/source
@@ -159,7 +158,7 @@ endif
                sed -e 's/.*CONFIG_DEBUG_INFO=.*/# CONFIG_DEBUG_INFO is not set/g' > \
                $(hdrdir)/.config
        chmod 644 $(hdrdir)/.config
-       $(kmake) O=$(hdrdir) silentoldconfig prepare scripts
+       $(kmake) O=$(hdrdir) -j1 silentoldconfig prepare scripts
        # We'll symlink this stuff
        rm -f $(hdrdir)/Makefile
        rm -rf $(hdrdir)/include2
@@ -237,12 +236,14 @@ install-arch-headers:
          -e 's/.*CONFIG_LOCALVERSION_AUTO.*/# CONFIG_LOCALVERSION_AUTO is not set/' \
          $(headers_tmp)/.config.old > $(headers_tmp)/.config
        $(hmake) silentoldconfig
-       $(hmake) headers_install
+       $(hmake) $(conc_level) headers_install
 
        ( cd $(headers_tmp)/install/include/ && \
                find . -name '.' -o -name '.*' -prune -o -print | \
                 cpio -pvd --preserve-modification-time \
                        $(headers_dir)/usr/include/ )
+       mkdir $(headers_dir)/usr/include/$(DEB_HOST_MULTIARCH)
+       mv $(headers_dir)/usr/include/asm $(headers_dir)/usr/include/$(DEB_HOST_MULTIARCH)/
 
        rm -rf $(headers_tmp)
 
@@ -275,7 +276,7 @@ binary-%: install-%
        dh_installchangelogs -p$(pkgimg)
        dh_installdocs -p$(pkgimg)
        dh_compress -p$(pkgimg)
-       dh_fixperms -p$(pkgimg)
+       dh_fixperms -p$(pkgimg) -X/boot/
        dh_installdeb -p$(pkgimg)
        dh_shlibdeps -p$(pkgimg)
        dh_gencontrol -p$(pkgimg)
@@ -298,7 +299,7 @@ ifneq ($(skipsub),true)
                dh_installchangelogs -p$$pkg;           \
                dh_installdocs -p$$pkg;                 \
                dh_compress -p$$pkg;                    \
-               dh_fixperms -p$$pkg;                    \
+               dh_fixperms -p$$pkg -X/boot/;           \
                dh_shlibdeps -p$$pkg;                   \
                dh_installdeb -p$$pkg;                  \
                dh_gencontrol -p$$pkg;                  \
@@ -342,15 +343,13 @@ ifneq ($(full_build),false)
        rm -rf $(dbgpkgdir)
 endif
 
-$(stampdir)/stamp-flavours:
-       @echo $(flavours) > $@
-
 #
 # per-architecture packages
 #
 $(stampdir)/stamp-prepare-perarch:
        @echo "Preparing perarch ..."
 ifeq ($(do_tools),true)
+       rm -rf $(builddir)/tools-$*
        install -d $(builddir)/tools-$*
        for i in *; do ln -s $(CURDIR)/$$i $(builddir)/tools-$*/; done
        rm $(builddir)/tools-$*/tools
@@ -358,9 +357,10 @@ ifeq ($(do_tools),true)
 endif
        touch $@
 
-$(stampdir)/stamp-build-perarch: prepare-perarch
+$(stampdir)/stamp-build-perarch: $(stampdir)/stamp-prepare-perarch
 ifeq ($(do_tools),true)
-       cd $(builddir)/tools-$*/tools/perf && make
+       cd $(builddir)/tools-$*/tools/perf && \
+               make HAVE_CPLUS_DEMANGLE=1 $(CROSS_COMPILE) $(conc_level)
 endif
        @touch $@
 
@@ -388,7 +388,7 @@ ifeq ($(do_tools),true)
        dh_builddeb -p$(toolspkg)
 endif
 
-binary-debs: binary-perarch $(stampdir)/stamp-flavours $(addprefix binary-,$(flavours))
+binary-debs: binary-perarch $(addprefix binary-,$(flavours))
 
 build-arch-deps-$(do_flavour_image_package) += $(addprefix build-,$(flavours))
 build-arch: $(build-arch-deps-true)