make only toolchain-shell interactive, only delete dirs if they exist

This commit is contained in:
Lance Vick 2023-04-27 13:40:31 -07:00
parent a65be367d9
commit dafafd5d6c
Signed by: lrvick
GPG Key ID: 8E47A1EC35A1551D
1 changed files with 10 additions and 6 deletions

View File

@ -66,7 +66,7 @@ toolchain: \
# Launch a shell inside the toolchain container # Launch a shell inside the toolchain container
.PHONY: toolchain-shell .PHONY: toolchain-shell
toolchain-shell: toolchain toolchain-shell: toolchain
$(call toolchain,bash --norc) $(call toolchain,bash --norc,--interactive)
# Pin all packages in toolchain container to latest versions # Pin all packages in toolchain container to latest versions
.PHONY: toolchain-update .PHONY: toolchain-update
@ -74,7 +74,6 @@ toolchain-update:
docker run \ docker run \
--rm \ --rm \
--tty \ --tty \
--interactive \
--platform=linux/$(ARCH) \ --platform=linux/$(ARCH) \
--env LOCAL_USER=$(UID):$(GID) \ --env LOCAL_USER=$(UID):$(GID) \
--volume $(PWD)/$(CONFIG_DIR):/config \ --volume $(PWD)/$(CONFIG_DIR):/config \
@ -87,9 +86,14 @@ toolchain-update:
.PHONY: toolchain-clean .PHONY: toolchain-clean
toolchain-clean: toolchain-clean:
chmod -R u+w $(CACHE_DIR_ROOT) if [ -d "$(CACHE_DIR_ROOT)" ]; then \
rm -rf $(CACHE_DIR_ROOT) $(OUT_DIR) chmod -R u+w $(CACHE_DIR_ROOT); \
docker image rm -f $(IMAGE) rm -rf $(CACHE_DIR_ROOT); \
fi
if [ -d "$(OUT_DIR)" ]; then \
rm -rf $(OUT_DIR); \
fi
docker image rm -f $(IMAGE) || :
.PHONY: reproduce .PHONY: reproduce
reproduce: toolchain-clean reproduce: toolchain-clean
@ -212,7 +216,7 @@ define toolchain
docker run \ docker run \
--rm \ --rm \
--tty \ --tty \
--interactive \ $(2) \
--env UID=$(UID) \ --env UID=$(UID) \
--env GID=$(GID) \ --env GID=$(GID) \
--platform=linux/$(ARCH) \ --platform=linux/$(ARCH) \