Initial Makefile

Signed-off-by: jolheiser <john.olheiser@gmail.com>
jolheiser 2020-11-18 11:29:21 -06:00
parent 2fbf3220eb
commit 699ee74114
Signed by: jolheiser
GPG Key ID: B853ADA5DA7BBF7A
4 changed files with 21 additions and 9 deletions

View File

@ -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 ## License

View File

@ -1,6 +1 @@
# template.toml go_mod = "gitea.com/user/repo"
# Write any template args here to prompt the user for, giving any defaults/options as applicable
name = "MyProject"
lang = ["Go", "Rust", "Python"]

View File

@ -1 +0,0 @@
Delete this file and put something else here!

18
template/Makefile 100644
View File

@ -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 ./...