Makefile 790 B

12345678910111213141516171819202122232425262728293031323334
  1. VERSION= $(shell cat ./VERSION)
  2. GO?= go
  3. NPM?= npm
  4. .PHONY: build assets deps lint prebaked-build test
  5. all: build
  6. deps:
  7. $(NPM) ci
  8. $(GO) mod download
  9. assets: PATH:=$(PWD)/node_modules/.bin:$(PATH)
  10. assets: deps
  11. $(GO) generate ./...
  12. ./web/build.sh
  13. ./xess/build.sh
  14. build: assets
  15. $(GO) build -o ./var/anubis ./cmd/anubis
  16. $(GO) build -o ./var/robots2policy ./cmd/robots2policy
  17. @echo "Anubis is now built to ./var/anubis"
  18. lint: assets
  19. $(GO) vet ./...
  20. $(GO) tool staticcheck ./...
  21. $(GO) tool govulncheck ./...
  22. prebaked-build:
  23. $(GO) build -o ./var/anubis -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/anubis
  24. $(GO) build -o ./var/robots2policy -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/robots2policy
  25. test: assets
  26. $(GO) test ./...