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