From 20f1d40b61e12c7a104b5b81bba6dc9e2dfa1c7c Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Sat, 12 Apr 2025 05:00:48 +0300 Subject: dev: Improvements to build scripts (#232) * dev: make sure that stuff is building properly * chore: changelog * remove npx --- Makefile | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9b8b61c..cb4d978 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,31 @@ -NODE_MODULES = node_modules -VERSION := $(shell cat ./VERSION) +VERSION= $(shell cat ./VERSION) +GO?= go +NPM?= npm .PHONY: build assets deps lint prebaked-build test -assets: - npm run assets +all: build deps: - npm ci - go mod download + $(NPM) ci + $(GO) mod download -build: deps - npm run build - @echo "Anubis is now built to ./var/anubis" +assets: PATH:=$(PWD)/node_modules/.bin:$(PATH) +assets: deps + $(GO) generate ./... + ./web/build.sh + ./xess/build.sh -all: build +build: assets + $(GO) build -o ./var/anubis ./cmd/anubis + @echo "Anubis is now built to ./var/anubis" -lint: - go vet ./... - go tool staticcheck ./... +lint: assets + $(GO) vet ./... + $(GO) tool staticcheck ./... prebaked-build: - go build -o ./var/anubis -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/anubis + $(GO) build -o ./var/anubis -ldflags "-X 'github.com/TecharoHQ/anubis.Version=$(VERSION)'" ./cmd/anubis -test: - npm run test \ No newline at end of file +test: assets + $(GO) test ./... -- cgit v1.2.3