mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-30 14:25:43 +00:00
Move the tool as a dependency for static checks migration. Fixes #8187 Signed-off-by: Bin Liu <bin@hyper.sh> Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com> Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com> Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com> Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com> Signed-off-by: Julio Montes <julio.montes@intel.com>
33 lines
785 B
Makefile
33 lines
785 B
Makefile
#
|
|
# Copyright (c) 2017-2019 Intel Corporation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
TARGET = kata-check-markdown
|
|
SOURCES = $(shell find . -type f 2>&1 | grep -E '.*\.go$$')
|
|
|
|
VERSION := ${shell cat ./VERSION}
|
|
COMMIT_NO := $(shell git rev-parse HEAD 2> /dev/null || true)
|
|
COMMIT := $(if $(shell git status --porcelain --untracked-files=no),"${COMMIT_NO}-dirty","${COMMIT_NO}")
|
|
|
|
BINDIR := $(GOPATH)/bin
|
|
DESTTARGET := $(abspath $(BINDIR)/$(TARGET))
|
|
|
|
default: install
|
|
|
|
check: $(SOURCES)
|
|
go test -v ./...
|
|
|
|
$(TARGET): $(SOURCES)
|
|
go build -o "$(TARGET)" -ldflags "-X main.name=${TARGET} -X main.commit=${COMMIT} -X main.version=${VERSION}" .
|
|
|
|
install: $(TARGET)
|
|
install -d $(shell dirname $(DESTTARGET))
|
|
install $(TARGET) $(DESTTARGET)
|
|
|
|
clean:
|
|
rm -f $(TARGET)
|
|
|
|
.PHONY: install clean
|