netoik-shfmt/Makefile

53 lines
940 B
Makefile
Raw Permalink Normal View History

2023-04-27 12:44:46 +00:00
NAME = shfmt
VERSION = $(shell [ -d ".git" ] && git describe | sed "s/-/./g")
BRANCH = $(shell [ -d ".git" ] && git branch --show-current)
RPM_SOURCEDIR = $(shell rpm --eval "%{_sourcedir}")
VARDIR = $(shell rpm --eval "%{_var}")
NOTHING = "Nothing to do"
.PHONY: build
build:
@echo "$(NOTHING)"
.PHONY: clean
clean:
@echo "$(NOTHING)"
.PHONY: name
name:
@echo "$(NAME)"
.PHONY: version
version:
@echo "$(VERSION)"
$(RPM_SOURCEDIR)/$(NAME)-%.tar.gz: *
git archive --format=tar.gz \
--output="$@" \
--prefix="$(NAME)-$(VERSION)/" \
--worktree-attributes \
--verbose \
"$(BRANCH)"
.PHONY: tarball
tarball: $(RPM_SOURCEDIR)/$(NAME)-$(VERSION).tar.gz
.PHONY: install
install:
install -D --target-directory="$(DESTDIR)$(VARDIR)/$(NAME)" README.md LICENSE
.PHONY: check_format
check_format:
@echo "$(NOTHING)"
.PHONY: check_linting
check_linting:
@echo "$(NOTHING)"
.PHONY: unit_test
unit_test:
@echo "$(NOTHING)"