yartsu/Makefile

62 lines
1.4 KiB
Makefile
Raw Permalink Normal View History

2022-06-14 18:35:47 -05:00
SRC_FILES = $(wildcard yartsu/*)
2022-06-15 13:38:45 -05:00
.PHONY: list lint build svg-docs theme-docs docs typing format dist check-tag
2022-06-14 18:35:47 -05:00
lint: format typing
typing:
pdm run mypy yartsu
format:
pdm run pre-commit run --all
2022-06-15 13:38:45 -05:00
check-tag:
@[ "${TAG}" ] || ( echo ">> TAG is not set"; exit 1 )
@git describe HEAD --tags --exact-match
release: build/yartsu check-tag
gh release create $(TAG) build/yartsu -p -d
publish: dist
twine upload dist/*
dist:
pdm build
2022-06-14 18:35:47 -05:00
build: build/yartsu
build/yartsu: $(SRC_FILES)
mkdir -p build
shiv \
-c yartsu \
-o ./build/yartsu \
--preamble scripts/preamble.py \
2022-06-14 18:35:47 -05:00
--reproducible \
.
install-bin: build/yartsu
cp ./build/yartsu ~/bin
2022-06-15 02:11:32 -05:00
docs: svg-docs theme-docs demo-docs
2022-06-14 18:35:47 -05:00
theme-docs:
./scripts/theme-showcase-gen
svg-docs:
lolcat -F .5 -S 9 -f assets/logo.txt | yartsu -o assets/logo.svg
yartsu -o assets/yartsu.svg -t "yartsu --help" -- yartsu -h
2022-06-15 02:11:32 -05:00
demo-docs:
python -c \
"from rich.console import Console; \
console = Console(force_terminal=True); \
console.print('\n:snake: [b i]Emoji\'s!'); \
console.print(' [cyan]Nerd Fonts!');" \
| yartsu -w 25 -o assets/demo.svg
2022-06-15 13:38:45 -05:00
clean:
rm -rf build dist
2022-06-15 02:11:32 -05:00
2022-06-14 18:35:47 -05:00
# https://stackoverflow.com/a/26339924
list:
@LC_ALL=C $(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'