34 lines
770 B
Makefile
34 lines
770 B
Makefile
VERSION= $(shell cat ./VERSION)
|
|
GO?= go
|
|
NPM?= npm
|
|
|
|
.PHONY: build assets deps lint prebaked-build test
|
|
|
|
all: build
|
|
|
|
deps:
|
|
$(NPM) ci
|
|
$(GO) mod download
|
|
|
|
assets: PATH:=$(PWD)/node_modules/.bin:$(PATH)
|
|
assets: deps
|
|
$(GO) generate ./...
|
|
./web/build.sh
|
|
./xess/build.sh
|
|
|
|
build: assets
|
|
$(GO) build -o ./var/nuke ./cmd/nuke
|
|
$(GO) build -o ./var/robots2policy ./cmd/robots2policy
|
|
@echo "nuke is now built to ./var/nuke"
|
|
|
|
lint: assets
|
|
$(GO) vet ./...
|
|
$(GO) tool staticcheck ./...
|
|
$(GO) tool govulncheck ./...
|
|
|
|
prebaked-build:
|
|
$(GO) build -o ./var/nuke -ldflags "-X 'git.sad.ovh/sophie/nuke.Version=$(VERSION)'" ./cmd/nuke
|
|
$(GO) build -o ./var/robots2policy -ldflags "-X 'git.sad.ovh/sophie/nuke.Version=$(VERSION)'" ./cmd/robots2policy
|
|
|
|
test: assets
|
|
$(GO) test ./...
|