From 8df8898dd8772179b063e676731e72361581a3b6 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 18 Jan 2025 17:22:45 +1300 Subject: [PATCH] makefile: allow using a custom docker invocation --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 6a27bf3a..66149ed7 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,18 @@ BUILDSTAMPS = docker/genbindings.docker-buildstamp +DOCKER = docker all: genbindings docker/genbindings.docker-buildstamp: docker/genbindings.Dockerfile - docker build -t miqt/genbindings:latest -f docker/genbindings.Dockerfile . + $(DOCKER) build -t miqt/genbindings:latest -f docker/genbindings.Dockerfile . touch $@ clean: - docker image rm -f miqt/genbindings:latest + $(DOCKER) image rm -f miqt/genbindings:latest rm -f $(BUILDSTAMPS) genbindings: $(BUILDSTAMPS) mkdir -p ~/.cache/go-build - docker run --user $$(id -u):$$(id -g) -v ~/.cache/go-build:/.cache/go-build -v $$PWD:/src -w /src miqt/genbindings:latest /bin/bash -c 'cd cmd/genbindings && go build && ./genbindings' + $(DOCKER) run --user $$(id -u):$$(id -g) -v ~/.cache/go-build:/.cache/go-build -v $$PWD:/src -w /src miqt/genbindings:latest /bin/bash -c 'cd cmd/genbindings && go build && ./genbindings' .PHONY : all clean genbindings