aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-13 17:26:31 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-13 17:26:31 -0800
commit988de1e688e4df27a21f62782ecaabf96b819dfe (patch)
tree4c3a71d1d0e451d0d273eb684b14572ec645a36f /Makefile
parentd53b8026efa8d774893f6e451bfe62a749e4e262 (diff)
downloadneko-988de1e688e4df27a21f62782ecaabf96b819dfe.tar.gz
neko-988de1e688e4df27a21f62782ecaabf96b819dfe.tar.bz2
neko-988de1e688e4df27a21f62782ecaabf96b819dfe.zip
chore: modernize Makefile with new targets and variables (NK-acq08a)
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 29 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index b9c376f..d99e550 100644
--- a/Makefile
+++ b/Makefile
@@ -1,24 +1,47 @@
SH=/bin/sh
+GO=go
+NPM=npm
+RICE=rice
+PANDOC=pandoc
+
BINARY=neko
-VERSION=0.2
+VERSION=0.3
BUILD=`git rev-parse HEAD`
LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}"
+.PHONY: default all clean ui build install test run dev
+
default: build
+
all: clean build docs
+clean:
+ rm -f ${BINARY}
+ rm -f web/rice-box.go
+ rm -f readme.html
+
ui:
- cd frontend && npm install && npm run build
+ cd frontend && ${NPM} install && ${NPM} run build
build: ui
- rice -i ./web embed-go
- go build ${LDFLAGS} -o ${BINARY}
+ ${RICE} -i ./web embed-go
+ ${GO} build ${LDFLAGS} -o ${BINARY}
install: build
cp ${BINARY} ${GOBIN}
-readme: REAMDE.md
+test:
+ ${GO} test ./...
+ cd frontend && ${NPM} test -- --run
+
+run: build
+ ./${BINARY}
+
+dev: build
+ ./${BINARY} -d
+
docs: readme.html
+
readme.html: README.md
- ghmarkdown README.md > readme.html
+ ${PANDOC} README.md -o readme.html