gotosocial/vendor/github.com/leodido/go-urn/makefile
dependabot[bot] e9de7bec15
[chore]: Bump github.com/go-playground/validator/v10 (#1724)
Bumps [github.com/go-playground/validator/v10](https://github.com/go-playground/validator) from 10.12.0 to 10.13.0.
- [Release notes](https://github.com/go-playground/validator/releases)
- [Commits](https://github.com/go-playground/validator/compare/v10.12.0...v10.13.0)

---
updated-dependencies:
- dependency-name: github.com/go-playground/validator/v10
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-01 11:02:44 +02:00

53 lines
No EOL
962 B
Makefile

SHELL := /bin/bash
RAGEL := ragel
GOFMT := go fmt
export GO_TEST=env GOTRACEBACK=all go test $(GO_ARGS)
.PHONY: build
build: machine.go
.PHONY: clean
clean:
@rm -rf docs
@rm -f machine.go
.PHONY: images
images: docs/urn.png
.PHONY: removecomments
removecomments:
@cd ./tools/removecomments; go build -o ../../removecomments ./main.go
machine.go: machine.go.rl
machine.go: removecomments
machine.go:
$(RAGEL) -Z -G2 -e -o $@ $<
@./removecomments $@
$(MAKE) -s file=$@ snake2camel
$(GOFMT) $@
docs/urn.dot: machine.go.rl
@mkdir -p docs
$(RAGEL) -Z -e -Vp $< -o $@
docs/urn.png: docs/urn.dot
dot $< -Tpng -o $@
.PHONY: bench
bench: *_test.go machine.go
go test -bench=. -benchmem -benchtime=5s ./...
.PHONY: tests
tests: *_test.go
$(GO_TEST) ./...
.PHONY: snake2camel
snake2camel:
@awk -i inplace '{ \
while ( match($$0, /(.*)([a-z]+[0-9]*)_([a-zA-Z0-9])(.*)/, cap) ) \
$$0 = cap[1] cap[2] toupper(cap[3]) cap[4]; \
print \
}' $(file)