summaryrefslogtreecommitdiffstats
path: root/scripts/mk/buildopts.mk
blob: 734d55e021a965f1b090eb5b0c8ab272fb3f56a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# This Makefile fragment (since dpkg 1.20.1) parses option arguments from
# DEB_BUILD_OPTIONS, and exposes these as variables.
#
# Defines the following variables:
#
#   DEB_BUILD_OPTION_PARALLEL: the argument for the parallel=N option.
#     $(DEB_BUILD_OPTIONS)                "parallel=2"  "parallel="  ""
#     $(DEB_BUILD_OPTION_PARALLEL)        "2"           ""           unset
#     $(DEB_BUILD_OPTION_PARALLEL:%=-j%)  "-j2"         ""           ""

ifndef dpkg_buildopts_mk_included
dpkg_buildopts_mk_included = yes

dpkg_buildopts_parallel := $(filter parallel=%,$(DEB_BUILD_OPTIONS))
ifdef dpkg_buildopts_parallel
  DEB_BUILD_OPTION_PARALLEL = $(patsubst parallel=%,%,$(dpkg_buildopts_parallel))
endif

endif # dpkg_buildopts_mk_included