Files
tmux-static-build/Makefile
2020-08-26 17:26:11 -07:00

29 lines
761 B
Makefile

.PHONY: help build extract
TMUX := https://github.com/tmux/tmux.git
LATEST = $(shell git ls-remote --tags $(TMUX) \
| egrep 'refs/tags/[0-9]+(\.[0-9]+)+[a-z]*$$' \
| tail -1 | cut -d/ -f3)
IMAGE = tmux:$(LATEST)
help: ## Display this help message
@echo "Latest: $(LATEST)"
@echo "Usage:"
@sed -nE "s/^([^:]+):\s+##\s+(.+)$$/\tmake \\1\t- \\2/p" \
$(lastword $(MAKEFILE_LIST))
build: ## Build tmux in a docker image
docker build \
--build-arg VERSION=$(LATEST) \
--tag $(IMAGE) \
--rm .
extract: ## Extract the binaries from the docker image
docker run \
-ti --rm \
-u $(shell id -u):$(shell id -g) \
-v $(CURDIR):/mnt/cwd \
-w /usr/local/lib \
$(IMAGE) tar czf /mnt/cwd/tmux_v$(LATEST).tar.gz tmux_v$(LATEST)