提交 d88bae1a authored 作者: Travis Cross's avatar Travis Cross

Support optional debian parallel builds

With this commit we allow getting `make -jN` behavior by setting
`parallel=N` in `DEB_BUILD_OPTIONS`.  Setting `parallel=` will result
in `make -j` being run (i.e. no limit on the number of jobs).  The
default is to run one job at a time; this is still the safest bet when
building all modules.

Thanks to Peter Wu for suggesting a different way to do this.

ref: https://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules-options
上级 430433a6
...@@ -20,6 +20,11 @@ export CFLAGS:=$(FS_CFLAGS) ...@@ -20,6 +20,11 @@ export CFLAGS:=$(FS_CFLAGS)
export CXXFLAGS:=$(FS_CXXFLAGS) export CXXFLAGS:=$(FS_CXXFLAGS)
export LDFLAGS:=$(FS_LDFLAGS) export LDFLAGS:=$(FS_LDFLAGS)
NJOBS=1
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NJOBS=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
endif
show_vars= \ show_vars= \
echo; \ echo; \
echo "Making target $@"; \ echo "Making target $@"; \
...@@ -91,7 +96,7 @@ override_dh_auto_configure: .stamp-configure ...@@ -91,7 +96,7 @@ override_dh_auto_configure: .stamp-configure
.stamp-build: .stamp-configure .stamp-build: .stamp-configure
@$(call show_vars) @$(call show_vars)
make make -j$(NJOBS)
touch $@ touch $@
override_dh_auto_build: .stamp-build override_dh_auto_build: .stamp-build
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论