diff --git a/src/Build/Packaging/openwrt/package/utils/veracrypt/Makefile.in b/src/Build/Packaging/openwrt/package/utils/veracrypt/Makefile.in index 6b73e8e0..a914b338 100644 --- a/src/Build/Packaging/openwrt/package/utils/veracrypt/Makefile.in +++ b/src/Build/Packaging/openwrt/package/utils/veracrypt/Makefile.in @@ -74,7 +74,7 @@ VC_COMMON_MAKE_FLAGS = \ define Build/Compile +$(MAKE) -C "$(PKG_BUILD_DIR)/veracrypt/src" $(VC_COMMON_MAKE_FLAGS) clean - +$(MAKE) -C "$(PKG_BUILD_DIR)/veracrypt/src" $(VC_COMMON_MAKE_FLAGS) wxbuild + +$(MAKE) -C "$(PKG_BUILD_DIR)/veracrypt/src" $(PKG_JOBS) $(VC_COMMON_MAKE_FLAGS) WX_MAKE_JOBS= wxbuild +$(MAKE) -C "$(PKG_BUILD_DIR)/veracrypt/src" $(PKG_JOBS) $(VC_COMMON_MAKE_FLAGS) endef diff --git a/src/Makefile b/src/Makefile index 7c15e5a3..43d77ac6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -726,6 +726,16 @@ CXXFLAGS := LFLAGS := endif +# The wxWidgets build runs 4 jobs by default, but follows the job count and +# jobserver of a parent "make -jN" (e.g. a distribution package build). +# MFLAGS may group single-letter options into one word (GNU make 3.81 gives +# "-sj" for "-s -j"), so look for "j" in every single-dash option word, +# skipping the options that take an argument. An argument that contains a +# space followed by "-j" (e.g. -I '/x -j3') still looks like a job option; +# set WX_MAKE_JOBS explicitly in that case. +WX_MAKE_OPTS = $(filter-out --% -C% -E% -I% -O% -W% -f% -o%,$(filter -%,$(MFLAGS))) +WX_MAKE_JOBS = $(if $(findstring j,$(WX_MAKE_OPTS))$(filter --jobserver%,$(MFLAGS)),,-j 4) + wxbuild: ifneq "$(shell test -f $(WX_ROOT)/configure || test -f $(WX_BUILD_DIR)/../configure && echo 1)" "1" @@ -746,4 +756,4 @@ endif "$(WX_ROOT)/configure" $(WX_CONFIGURE_FLAGS) $(WX_CONFIGURE_EXTRA_FLAGS) $$WX_CONFIGURE_LEGACY_FLAGS >/dev/null @echo Building wxWidgets library... - cd "$(WX_BUILD_DIR)" && $(MAKE) -j 4 + cd "$(WX_BUILD_DIR)" && $(MAKE) $(WX_MAKE_JOBS)