anki-sync-server/Makefile
2022-01-16 21:58:25 +00:00

44 lines
1.1 KiB
Makefile
Executable File

#!/usr/bin/env make
ANKISYNCD_NAME ?= Anki Sync Server
ANKISYNCD_VERSION ?= v2.2.0
ANKISYNCD_DESCRIPTION ?= Self-hosted Anki Sync Server.
ENV ?= local
-include config/.env.${ENV}
-include config/secrets/.env.*.${ENV}
export
.DEFAULT_GOAL := help
.PHONY: help #: Display list of command and exit.
help:
@${AWK} 'BEGIN {FS = " ?#?: "; print "${ANKISYNCD_NAME} ${ANKISYNCD_VERSION}\n${ANKISYNCD_DESCRIPTION}\n\nUsage: make \033[36m<command>\033[0m\n\nCommands:"} /^.PHONY: ?[a-zA-Z_-]/ { printf " \033[36m%-10s\033[0m %s\n", $$2, $$3 }' $(MAKEFILE_LIST)
.PHONY: docs #: Build and serve documentation.
docs:
@${MKDOCS} ${MKDOCS_CMD} -f docs/mkdocs.yml ${MKDOCS_OPTS}
.PHONY: tests #: Run unit tests.
tests:
@${UNITTEST} discover -s tests
.PHONY: run
run:
@${PYTHON} src/ankisyncd/__main__.py
# Run scripts using make
%:
@if [[ -f "scripts/${*}.sh" ]]; then \
${BASH} "scripts/${*}.sh"; fi
.PHONY: init #: Download Python dependencies.
init:
@${POETRY} install
.PHONY: release #: Create new Git release and tags.
release:
@${BASH} scripts/release.sh
.PHONY: open
open:
@${OPEN} ${ANKISYNCD_URL}