Skip to content

Commit 1b042c2

Browse files
committed
debian: add support for DEB_BUILD_OPTIONS=parallel=N
This speeds up package builds using "make -jN" and "make -jN check". Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 018cd6e commit 1b042c2

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

debian/rules

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ ifneq ($(filter pkg.e2fsprogs.no-fuse2fs,$(DEB_BUILD_PROFILES)),)
2323
SKIP_FUSE2FS=yes
2424
endif
2525

26+
ifneq (,$(filter-out parallel=1,$(filter parallel=%,$(DEB_BUILD_OPTIONS))))
27+
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
28+
JOBS = -j$(NUMJOBS)
29+
endif
30+
2631
COMERR_VERSION ?= $(shell grep ELF_VERSION lib/et/Makefile.in | cut '-d ' -f3)
2732
SS_VERSION ?= $(shell grep ELF_VERSION lib/ss/Makefile.in | cut '-d ' -f3)
2833

@@ -77,7 +82,7 @@ override_dh_auto_configure:
7782
../../configure ${COMMON_CONF_FLAGS}
7883

7984
override_dh_auto_build:
80-
$(MAKE) -C ${stdbuilddir} V=1 all
85+
$(MAKE) -C ${stdbuilddir} V=1 $(JOBS) all
8186
ifeq (,$(filter pkg.e2fsprogs.no-static,$(DEB_BUILD_PROFILES)))
8287
$(MAKE) -C ${stdbuilddir}/e2fsck V=1 e2fsck.static
8388
endif
@@ -194,7 +199,7 @@ override_dh_gencontrol:
194199

195200
override_dh_auto_test:
196201
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
197-
PRINT_FAILED=yes $(MAKE) -C ${stdbuilddir} V=1 check
202+
PRINT_FAILED=yes $(MAKE) -C ${stdbuilddir} V=1 $(JOBS) check
198203
endif
199204

200205
test_printenv:

0 commit comments

Comments
 (0)