1
0
docreflect/Makefile

44 lines
883 B
Makefile
Raw Normal View History

2025-10-31 20:27:07 +01:00
sources = $(shell find . -name "*.go" | grep -v testdocs_test.go)
prefix ?= ~/bin
2025-08-08 21:44:31 +02:00
default: build
2025-10-31 20:27:07 +01:00
libdocreflect: $(sources)
2025-08-08 21:44:31 +02:00
go build .
2025-10-31 20:27:07 +01:00
libgenerate: $(sources)
2025-08-17 15:59:01 +02:00
go build ./generate
2025-08-08 21:44:31 +02:00
.bin:
mkdir -p .bin
2025-10-31 20:27:07 +01:00
.bin/docreflect: $(sources) .bin
2025-08-17 15:59:01 +02:00
go build -o .bin/docreflect ./cmd/docreflect
build: libdocreflect libgenerate .bin/docreflect
2025-08-08 21:44:31 +02:00
2025-10-31 20:27:07 +01:00
testdocs_test.go: $(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-17 15:59:01 +02:00
2025-10-31 20:27:07 +01:00
.cover: $(sources) testdocs_test.go
2025-08-08 21:44:31 +02:00
go test -count 1 -coverprofile .cover . ./generate
2025-08-17 15:59:01 +02:00
check: .cover
2025-08-08 21:44:31 +02:00
cover: .cover
go tool cover -func .cover
showcover: .cover
go tool cover -html .cover
2025-10-31 20:27:07 +01:00
fmt: $(sources)
2025-08-08 21:44:31 +02:00
go fmt . ./generate ./cmd/docreflect
install: .bin/docreflect
2025-10-31 20:27:07 +01:00
cp .bin/docreflect $(prefix)
2025-08-08 21:44:31 +02:00
clean:
go clean ./...
rm -rf .bin
rm -f testdocs_test.go