diff options
author | Rémi Bernon <rbernon@codeweavers.com> | 2021-04-19 15:43:01 +0300 |
---|---|---|
committer | Rémi Bernon <rbernon@codeweavers.com> | 2021-05-27 17:58:18 +0300 |
commit | ecca62efa8109b26108296853637179f875f3354 (patch) | |
tree | 6327b8da905a59d03cf9eafc776fdf7161a7af3c | |
parent | 8dd5db85dd95b58a34ded1372843ac79178beba8 (diff) |
build: Create CCACHE_DIR if it doesn't exist and mount it.
Instead of the HOME dir, and only when ENABLE_CCACHE is set.
-rw-r--r-- | build/makefile_base.mak | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/build/makefile_base.mak b/build/makefile_base.mak index 2993fd27..7afaba31 100644 --- a/build/makefile_base.mak +++ b/build/makefile_base.mak @@ -49,14 +49,14 @@ CCACHE_ENV := $(patsubst %,-e %,$(shell env|cut -d= -f1|grep '^CCACHE_')) ifeq ($(ENABLE_CCACHE),1) CCACHE_BIN := ccache export CCACHE_DIR := $(if $(CCACHE_DIR),$(CCACHE_DIR),$(HOME)/.ccache) - DOCKER_OPTS := $(CCACHE_ENV) -e CCACHE_DIR=$(CCACHE_DIR) $(DOCKER_OPTS) + DOCKER_OPTS := -v $(CCACHE_DIR):$(CCACHE_DIR) $(CCACHE_ENV) -e CCACHE_DIR=$(CCACHE_DIR) $(DOCKER_OPTS) else export CCACHE_DISABLE := 1 DOCKER_OPTS := $(CCACHE_ENV) -e CCACHE_DISABLE=1 $(DOCKER_OPTS) endif DOCKER_BASE = docker run --rm -e HOME -e USER -e USERID=$(shell id -u) -u $(shell id -u):$(shell id -g) \ - -v $(HOME):$(HOME) -v $(SRC):$(SRC) -v $(OBJ):$(OBJ) -w $(OBJ) -e MAKEFLAGS \ + -v $(SRC):$(SRC) -v $(OBJ):$(OBJ) -w $(OBJ) -e MAKEFLAGS \ $(DOCKER_OPTS) $(STEAMRT_IMAGE) STEAMRT_NAME ?= soldier @@ -90,6 +90,9 @@ all32 $(MAKECMDGOALS64): ifeq ($(CONTAINER),) J := $(shell nproc) +ifeq ($(ENABLE_CCACHE),1) +container-build: $(shell mkdir -p $(CCACHE_DIR)) +endif container-build: private SHELL := $(CONTAINER_SHELL) container-build: +$(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) -f $(firstword $(MAKEFILE_LIST)) $(MFLAGS) $(MAKEOVERRIDES) CONTAINER=1 $(CONTAINERGOALS) |