docreflect/Makefile

42 lines
956 B
Makefile
Raw Normal View History

2025-08-08 21:44:31 +02:00
SOURCES = $(shell find . -name "*.go")
PREFIX ?= ~/bin
default: build
build: $(SOURCES) .bin
go build .
go build ./generate
go build -o .bin/docreflect ./cmd/docreflect
.bin/docreflect: build
.bin:
mkdir -p .bin
check: $(SOURCES) .bin/docreflect
2025-08-08 22:05:05 +02:00
.bin/docreflect generate docreflect_test code.squareroundforest.org/arpio/docreflect/internal/tests/src/testpackage > testdocs_test.go
2025-08-08 21:44:31 +02:00
go test -count 1 . ./generate
rm -f testdocs_test.go
.cover: $(SOURCES) .bin/docreflect
2025-08-08 22:05:05 +02:00
.bin/docreflect generate docreflect_test code.squareroundforest.org/arpio/docreflect/internal/tests/src/testpackage > testdocs_test.go
2025-08-08 21:44:31 +02:00
go test -count 1 -coverprofile .cover . ./generate
rm -f testdocs_test.go
cover: .cover
go tool cover -func .cover
showcover: .cover
go tool cover -html .cover
fmt: $(SOURCES)
go fmt . ./generate ./cmd/docreflect
install: .bin/docreflect
cp .bin/docreflect $(PREFIX)
clean:
go clean ./...
rm -rf .bin
rm -f testdocs_test.go