github.com/docker/app@v0.9.1-beta3.0.20210611140623-a48f773ab002/vars.mk (about) 1 PKG_NAME := github.com/docker/app 2 BIN_NAME ?= docker-app 3 E2E_NAME := $(BIN_NAME)-e2e 4 5 ALPINE_VERSION=3.11.5 6 7 # Failing to resolve sh.exe to a full path denotes a windows vanilla shell. 8 # Although 'simple' commands are still exec'ed, 'complex' ones are batch'ed instead of sh'ed. 9 ifeq ($(SHELL),sh.exe) 10 mkdir = mkdir $(subst /,\,$(1)) > nul 2>&1 || (exit 0) 11 rm = del /F /Q $(subst /,\,$(1)) > nul 2>&1 || (exit 0) 12 rmdir = rmdir /S /Q $(subst /,\,$(1)) > nul 2>&1 || (exit 0) 13 chmod = 14 NULL := nul 15 else 16 # The no-op redirection forces make to shell out the commands instead of spawning a process as 17 # the latter can fail on windows running cmd or powershell while having a unix style shell in the path. 18 mkdir = mkdir -p $(1) 1>&1 19 rm = rm -rf $(1) 1>&1 20 rmdir = rm -rf $(1) 1>&1 21 chmod = chmod $(1) $(2) 1>&1 22 NULL := /dev/null 23 endif 24 25 ifeq ($(COMMIT),) 26 COMMIT := $(shell git rev-parse --short HEAD 2> $(NULL)) 27 endif 28 ifeq ($(BUILD_TAG),) 29 BUILD_TAG := $(shell git describe --always --dirty --abbrev=10 2> $(NULL)) 30 endif 31 ifeq ($(TAG),) 32 ifeq ($(TAG_NAME),) 33 TAG := $(BUILD_TAG) 34 else 35 TAG := $(TAG_NAME) 36 endif 37 endif