build toolchain on demand, require clean tree for dist
This commit is contained in:
parent
23fc267a9d
commit
b9894265d0
13
Makefile
13
Makefile
|
@ -148,6 +148,10 @@ reproduce: toolchain-clean
|
||||||
|
|
||||||
.PHONY: $(DIST_DIR)
|
.PHONY: $(DIST_DIR)
|
||||||
$(DIST_DIR):
|
$(DIST_DIR):
|
||||||
|
git ls-files -o --exclude-standard | grep . \
|
||||||
|
&& { echo "Error: Git has untracked files present"; exit 1; } || :
|
||||||
|
git diff --name-only | grep . \
|
||||||
|
&& { echo "Error: Git has unstaged changes present"; exit 1; } || :
|
||||||
rm -rf $@/*
|
rm -rf $@/*
|
||||||
[ "$(PRESERVE_CACHE)" = "true" ] || $(MAKE) toolchain-clean
|
[ "$(PRESERVE_CACHE)" = "true" ] || $(MAKE) toolchain-clean
|
||||||
$(MAKE) default
|
$(MAKE) default
|
||||||
|
@ -316,9 +320,10 @@ define fetch_pgp_key
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define toolchain
|
define toolchain
|
||||||
docker run \
|
$(MAKE) toolchain \
|
||||||
--rm \
|
&& docker run \
|
||||||
--tty \
|
--rm \
|
||||||
|
--tty \
|
||||||
$(2) \
|
$(2) \
|
||||||
--env UID=$(UID) \
|
--env UID=$(UID) \
|
||||||
--env GID=$(GID) \
|
--env GID=$(GID) \
|
||||||
|
@ -329,7 +334,7 @@ define toolchain
|
||||||
--volume $(TOOLCHAIN_VOLUME) \
|
--volume $(TOOLCHAIN_VOLUME) \
|
||||||
--workdir $(TOOLCHAIN_WORKDIR) \
|
--workdir $(TOOLCHAIN_WORKDIR) \
|
||||||
--env-file=$(CACHE_DIR_ROOT)/container.env \
|
--env-file=$(CACHE_DIR_ROOT)/container.env \
|
||||||
$(shell cat cache/toolchain.state 2> /dev/null) \
|
$$(cat $(CACHE_DIR_ROOT)/toolchain.state 2> /dev/null) \
|
||||||
$(SRC_DIR)/toolchain/scripts/host-env bash -c $(1)
|
$(SRC_DIR)/toolchain/scripts/host-env bash -c $(1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue