1. .PHONY: chromad upload all
    
  2. 
    
  3. VERSION ?= $(shell git describe --tags --dirty  --always)
    
  4. export GOOS ?= linux
    
  5. export GOARCH ?= amd64
    
  6. 
    
  7. all: README.md tokentype_string.go
    
  8. 
    
  9. README.md: lexers/*/*.go
    
  10. 	./table.py
    
  11. 
    
  12. tokentype_string.go: types.go
    
  13. 	go generate
    
  14. 
    
  15. chromad:
    
  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. 
    
  21. upload: build/chromad
    
  22. 	scp build/chromad [email protected]: && \
    
  23. 		ssh [email protected] 'install -m755 ./chromad /srv/http/swapoff.org/bin && service chromad restart'