aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile36
1 files changed, 20 insertions, 16 deletions
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 ./...