diff --git a/Makefile.in b/Makefile.in index d1873ab1..0d9a68fe 100644 --- a/Makefile.in +++ b/Makefile.in @@ -62,6 +62,12 @@ ifneq ($(SUPPRESS_WARNINGS),) COMMON_FLAGS += -w endif +ifeq ($(ENABLE_BEAR),1) + BEAR := bear --append -- +else + BEAR := +endif + $(DST_DIR): mkdir -p $@ @@ -1204,10 +1210,10 @@ redist: all .PHONY: module32 module64 module module32: | all-source wine-configure32 - +$(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) $(MFLAGS) $(MAKEOVERRIDES) -C $(WINE_OBJ32)/dlls/$(module) + +$(BEAR) $(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) $(MFLAGS) $(MAKEOVERRIDES) -C $(WINE_OBJ32)/dlls/$(module) module64: | all-source wine-configure64 - +$(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) $(MFLAGS) $(MAKEOVERRIDES) -C $(WINE_OBJ64)/dlls/$(module) + +$(BEAR) $(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) $(MFLAGS) $(MAKEOVERRIDES) -C $(WINE_OBJ64)/dlls/$(module) module: | all-source wine-configure module: module32 module64 diff --git a/configure.sh b/configure.sh index bc3ccc65..ed0a7b28 100755 --- a/configure.sh +++ b/configure.sh @@ -170,6 +170,9 @@ function configure() { if [[ -n "$arg_enable_ccache" ]]; then echo "ENABLE_CCACHE := 1" fi + if [[ -n "$arg_enable_bear" ]]; then + echo "ENABLE_BEAR := 1" + fi # Include base echo "" @@ -190,6 +193,7 @@ arg_container_engine="" arg_docker_opts="" arg_relabel_volumes="" arg_enable_ccache="" +arg_enable_bear="" arg_help="" invalid_args="" function parse_args() { @@ -236,6 +240,8 @@ function parse_args() { arg_relabel_volumes="1" elif [[ $arg = --enable-ccache ]]; then arg_enable_ccache="1" + elif [[ $arg = --enable-bear ]]; then + arg_enable_bear="1" elif [[ $arg = --proton-sdk-image ]]; then val_used=1 arg_protonsdk_image="$val" @@ -291,6 +297,8 @@ usage() { "$1" "" "$1" " --enable-ccache Mount \$CCACHE_DIR or \$HOME/.ccache inside of the container and use ccache for the build." "$1" "" + "$1" " --enable-bear Invokes make via bear creating compile_commands.json." + "$1" "" "$1" " Steam Runtime" "$1" " Proton builds that are to be installed & run under the steam client must be built with" "$1" " the Steam Runtime SDK to ensure compatibility. See README.md for more information." diff --git a/make/rules-autoconf.mk b/make/rules-autoconf.mk index ad04eeb8..1f5fb9e9 100644 --- a/make/rules-autoconf.mk +++ b/make/rules-autoconf.mk @@ -31,8 +31,8 @@ $$(OBJ)/.$(1)-configure$(3): $$(OBJ)/.$(1)-pre-configure $$(OBJ)/.$(1)-build$(3): @echo ":: building $(3)bit $(1)..." >&2 - cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ - $$(MAKE) + +cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ + $$(BEAR) $$(MAKE) cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ $$(MAKE) install touch $$@ diff --git a/make/rules-configure.mk b/make/rules-configure.mk index 29eee132..a2205c1c 100644 --- a/make/rules-configure.mk +++ b/make/rules-configure.mk @@ -24,8 +24,8 @@ $$(OBJ)/.$(1)-configure$(3): $$(OBJ)/.$(1)-build$(3): @echo ":: building $(3)bit $(1)..." >&2 - cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ - $$(MAKE) + +cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ + $$(BEAR) $$(MAKE) cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ $$(MAKE) install touch $$@