mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-02-07 20:39:37 -06:00
40 lines
888 B
Makefile
40 lines
888 B
Makefile
VERSION= $(shell cat ./VERSION)
|
|
GO?= go
|
|
NPM?= npm
|
|
CARGO?= cargo
|
|
|
|
.PHONY: build assets assets-wasm deps lint prebaked-build test
|
|
|
|
all: build
|
|
|
|
deps:
|
|
$(NPM) ci
|
|
$(GO) mod download
|
|
$(CARGO) fetch
|
|
|
|
assets-wasm:
|
|
bash ./scripts/build_wasm.sh
|
|
|
|
assets: PATH:=$(PWD)/node_modules/.bin:$(PATH)
|
|
assets: deps assets-wasm
|
|
$(GO) generate ./...
|
|
./web/build.sh
|
|
./xess/build.sh
|
|
|
|
build: assets
|
|
$(GO) build -o ./var/anubis ./cmd/anubis
|
|
$(GO) build -o ./var/robots2policy ./cmd/robots2policy
|
|
@echo "Anubis is now built to ./var/anubis"
|
|
|
|
lint: assets
|
|
$(GO) vet ./...
|
|
$(GO) tool staticcheck ./...
|
|
$(GO) tool govulncheck ./...
|
|
|
|
prebaked-build:
|
|
$(GO) build -o ./var/anubis -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/anubis
|
|
$(GO) build -o ./var/robots2policy -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/robots2policy
|
|
|
|
test: assets
|
|
$(GO) test ./...
|