-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
21 lines (21 loc) · 733 Bytes
/
Makefile
File metadata and controls
21 lines (21 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
PKGS=$(shell go list -f '{{.Dir}}' ./... | sed "s@^${PWD}/@@")
FILES=$(shell find . -name '*.go')
test: $(FILES)
go get ./...
go test ./...
fmt: $(FILES)
find . -type f -name '*.go' -exec gofmt -w {} \;
update_deps:
go get -u ./...
go mod tidy
new_version:
git tag $(shell V=$$(git describe --abbrev=0 --tags); echo $${V%.*}.$$(( $${V##*.}+1)))
push_up:
git push --tags origin main:main
README.md: $(FILES) Makefile
printf '# FACILITY\n\nUseful Go Packages\n\nCopyright (c) 2022 Hal Canary\n\n' > $@
for pkg in $(PKGS); do \
printf '<https://pkg.go.dev/github.com/HalCanary/facility/%s>' "$$pkg" > "$$pkg"/README.md; \
printf '\n[%s](%s)\n' $$pkg ./$$pkg/ >> $@; \
done
.PHONY: test fmt update_deps new_version push_up