Whamcloud - gitweb
b=22790 discover and utilize multiple CPUs
[fs/lustre-release.git] / debian / rules
index 39dcbe9..a3e8541 100755 (executable)
@@ -75,6 +75,11 @@ MODS_PKG=lustre-client-modules
 BUILDDIR=.
 SRCDIR=.
 
 BUILDDIR=.
 SRCDIR=.
 
+AVAIL_CPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1)
+ifneq ($(AVAIL_CPUS),1)
+      PMAKEARGS := -j $(AVAIL_CPUS)
+endif
+
 autogen: autogen-stamp
 autogen-stamp: patch-stamp
        # see if any patches requires us to run autogen
 autogen: autogen-stamp
 autogen-stamp: patch-stamp
        # see if any patches requires us to run autogen
@@ -125,7 +130,7 @@ build-arch build-indep: build
 build: build-stamp
 build-stamp: patch-stamp configure-stamp
        dh_testdir
 build: build-stamp
 build-stamp: patch-stamp configure-stamp
        dh_testdir
-       $(MAKE) -C $(BUILDDIR)
+       $(MAKE) -C $(BUILDDIR) $(PMAKEARGS)
        $(MAKE) -C $(BUILDDIR) DESTDIR=$(TOP_DIR)/debian/tmp install
        # jump our lustre-client-modules into the control file if not using m-a
        if ! $(USE_MA); then \
        $(MAKE) -C $(BUILDDIR) DESTDIR=$(TOP_DIR)/debian/tmp install
        # jump our lustre-client-modules into the control file if not using m-a
        if ! $(USE_MA); then \
@@ -370,7 +375,7 @@ kdist_configure: kdist_config
 binary-modules: prep-deb-files
        dh_testroot
        dh_clean -k
 binary-modules: prep-deb-files
        dh_testroot
        dh_clean -k
-       $(MAKE)
+       $(MAKE) $(PMAKEARGS)
        $(MAKE) install DESTDIR=$(CURDIR)/debian/$(PKGNAME)
        # Remove stuff that doesn't belong (no module-only target)
        cd $(CURDIR)/debian/$(PKGNAME) && rm -rf usr sbin etc
        $(MAKE) install DESTDIR=$(CURDIR)/debian/$(PKGNAME)
        # Remove stuff that doesn't belong (no module-only target)
        cd $(CURDIR)/debian/$(PKGNAME) && rm -rf usr sbin etc