From f637e8362765d3c59e4fcf715d2dd36e33a0ead9 Mon Sep 17 00:00:00 2001 From: Vikash Kothary Date: Thu, 30 Jul 2020 20:09:39 +0100 Subject: [PATCH] Add Makefile to simplify development commands --- Makefile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0404dba --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +#/bin/make + +ANKI_SERVER_NAME ?= "Anki Sync Server" +ANKI_SERVER_VERSION ?= "v0.1.0" +ANKI_SERVER_DESCRIPTION ?= "Self-hosted Anki Sync Server." +ENV ?= local + +-include config/.env.${ENV} +export + +.DEFAULT_GOAL := help +.PHONY: help #: Display list of command and exit. +help: + @awk 'BEGIN {FS = " ?#?: "; print ""${ANKI_SERVER_NAME}" "${ANKI_SERVER_VERSION}"\n"${ANKI_SERVER_DESCRIPTION}"\n\nUsage: make \033[36m\033[0m\n\nCommands:"} /^.PHONY: ?[a-zA-Z_-]/ { printf " \033[36m%-10s\033[0m %s\n", $$2, $$3 }' $(MAKEFILE_LIST) + +%: + @test -f scripts/${*}.sh + @${SHELL} scripts/${*}.sh \ No newline at end of file