Michael Smith 4f6d1de8e2 Always clean-build in Docker to avoid stale binary
The Docker build target now runs `make clean all` instead of bare
`make`, so it rebuilds regardless of an existing build/sdlamp2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:44:14 +01:00

26 lines
630 B
Makefile

.PHONY: shell build clean
IMAGE_NAME = arm64-dev
PROJECT_DIR := $(shell cd .. && pwd)
CONTAINER_NAME = $(shell docker ps -f "ancestor=$(IMAGE_NAME)" --format "{{.Names}}")
.build: Dockerfile
docker build --platform linux/arm64 -t $(IMAGE_NAME) .
touch .build
ifeq ($(CONTAINER_NAME),)
shell: .build
docker run --platform linux/arm64 -it --rm -v "$(PROJECT_DIR)":/workspace $(IMAGE_NAME) /bin/bash
else
shell:
docker exec -it $(CONTAINER_NAME) /bin/bash
endif
build: .build
docker run --platform linux/arm64 --rm -v "$(PROJECT_DIR)":/workspace $(IMAGE_NAME) make clean all
clean:
docker rmi $(IMAGE_NAME)
rm -f .build