diff --git a/README.md b/README.md index 4b65cbd..3c65272 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# tmpl templates +# Makefile Template -Check out the various branches for some basic examples of templates. +A basic Makefile template for [tmpl](https://gitea.com/jolheiser/tmpl) ## License diff --git a/template.toml b/template.toml index 1507fc7..658073d 100644 --- a/template.toml +++ b/template.toml @@ -1,6 +1 @@ -# template.toml -# Write any template args here to prompt the user for, giving any defaults/options as applicable - -name = "MyProject" - -lang = ["Go", "Rust", "Python"] +go_mod = "gitea.com/user/repo" diff --git a/template/.gitkeep b/template/.gitkeep deleted file mode 100644 index b4bd1aa..0000000 --- a/template/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -Delete this file and put something else here! \ No newline at end of file diff --git a/template/Makefile b/template/Makefile new file mode 100644 index 0000000..b786d42 --- /dev/null +++ b/template/Makefile @@ -0,0 +1,18 @@ +GO ?= go +VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//') + +.PHONY: build +build: + $(GO) build -ldflags '-s -w -X "{{go_mod}}/cmd.Version=$(VERSION)"' + +.PHONY: vet +vet: + $(GO) vet ./... + +.PHONY: fmt +fmt: + $(GO) fmt ./... + +.PHONY: test +test: + $(GO) test -race ./...