Makefile

 1.PHONY: chromad upload all
 2
 3VERSION ?= $(shell git describe --tags --dirty  --always)
 4export GOOS ?= linux
 5export GOARCH ?= amd64
 6
 7all: README.md tokentype_string.go
 8
 9README.md: lexers/*/*.go
10	./table.py
11
12tokentype_string.go: types.go
13	go generate
14
15chromad:
16	rm -rf build
17	esbuild --bundle cmd/chromad/static/index.js --minify --outfile=cmd/chromad/static/index.min.js
18	esbuild --bundle cmd/chromad/static/index.css --minify --outfile=cmd/chromad/static/index.min.css
19	(export CGOENABLED=0 ; cd ./cmd/chromad && go build -ldflags="-X 'main.version=$(VERSION)'" -o ../../build/chromad .)
20
21upload: build/chromad
22	scp build/chromad root@swapoff.org: && \
23		ssh root@swapoff.org 'install -m755 ./chromad /srv/http/swapoff.org/bin && service chromad restart'