From a4ce86f31d2faf54dea0f2789edc7bef9d324a4a Mon Sep 17 00:00:00 2001 From: abs3nt Date: Mon, 27 Feb 2023 23:46:21 -0800 Subject: [PATCH] makefile --- .gitignore | 2 ++ Makefile | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b4b8c1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +converter + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0ba55d2 --- /dev/null +++ b/Makefile @@ -0,0 +1,33 @@ +pkgname := converter +build: ${pkgname} + +${pkgname}: $(shell find . -name '*.go') + go build -o ${pkgname} . + +completions: + mkdir -p completions + ./${pkgname} completion zsh > completions/_${pkgname} + ./${pkgname} completion bash > completions/${pkgname} + ./${pkgname} completion fish > completions/${pkgname}.fish + +run: + go run main.go + +tidy: + go mod tidy + +clean: + rm -f ${pkgname} + rm -rf completions + +uninstall: + rm -f /usr/bin/${pkgname} + rm -f /usr/share/zsh/site-functions/_${pkgname} + rm -f /usr/share/bash-completion/completions/${pkgname} + rm -f /usr/share/fish/vendor_completions.d/${pkgname}.fish + +install: + cp ${pkgname} /usr/bin + ${pkgname} completion zsh > /usr/share/zsh/site-functions/_${pkgname} + ${pkgname} completion bash > /usr/share/bash-completion/completions/${pkgname} + ${pkgname} completion fish > /usr/share/fish/vendor_completions.d/${pkgname}.fish