github.com/dmaizel/tests@v0.0.0-20210728163746-cae6a2d9cee8/cmd/checkcommits/Makefile (about) 1 # Copyright (c) 2017-2018 Intel Corporation 2 # 3 # SPDX-License-Identifier: Apache-2.0 4 5 TARGET = checkcommits 6 SOURCES = $(shell find . 2>&1 | grep -E '.*\.go$$') 7 8 VERSION := ${shell cat ./VERSION} 9 COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true) 10 COMMIT := $(if $(shell git status --porcelain --untracked-files=no),"${COMMIT_NO}-dirty","${COMMIT_NO}") 11 12 default: $(TARGET) 13 14 $(TARGET): $(SOURCES) 15 go test . 16 go install -ldflags "-X main.appCommit=${COMMIT} -X main.appVersion=${VERSION}" . 17 18 clean: 19 rm -f $(TARGET)