A web interface to an NMDC hub https://code.ivysaur.me/nmdc-webfrontend/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # Makefile for nmdc-webfrontend
  2. BINNAME=nmdc-webfrontend
  3. VERSION=1.3.1
  4. GOFLAGS=-a \
  5. -ldflags "-s -w -X main.VERSION=$(BINNAME)/$(VERSION)" \
  6. -gcflags "-trimpath ${GOPATH}" \
  7. -asmflags "-trimpath ${GOPATH}"
  8. SOURCES=client/ go.mod go.sum Makefile Config.go main.go nmdc-webfrontend.conf.SAMPLE
  9. .PHONY: all deps clean
  10. all: $(BINNAME)-$(VERSION)-win32.7z $(BINNAME)-$(VERSION)-linux64.tar.xz $(BINNAME)-$(VERSION)-src.tar.xz
  11. deps:
  12. npm install -g less uglify-js less-plugin-clean-css html-minifier
  13. go get -u github.com/jteeuwen/go-bindata/...
  14. clean:
  15. rm -f ./$(BINNAME)
  16. rm -f ./$(BINNAME).exe
  17. rm -fr ./clientpack
  18. rm -f ./bindata.go
  19. bindata.go: client client/*
  20. rm -fr ./clientpack
  21. cp -r ./client ./clientpack
  22. ( echo ';(function() {' ; cat clientpack/dcwebui.js ; echo '})();' ) | uglifyjs -o clientpack/dcwebui.min.js -c -m --ie8
  23. lessc --clean-css clientpack/dcwebui.css clientpack/dcwebui.min.css
  24. cat clientpack/index.htm \
  25. | sed -e '/dcwebui.css/{i <style>' -e 'r clientpack/dcwebui.min.css' -e 'a </style>' -e 'd}' \
  26. | sed -e '/dcwebui.js/{i <script>' -e 'r clientpack/dcwebui.min.js' -e 'a </script>' -e 'd}' \
  27. | sed -e '/socket.io-1.7.2.js/{i <script>' -e 'r clientpack/socket.io-1.7.2.js' -e 'a </script>' -e 'd}' \
  28. > clientpack/index.packed.htm
  29. mv clientpack/index.packed.htm clientpack/index.htm
  30. html-minifier --collapse-whitespace -o clientpack/index.min.htm clientpack/index.htm
  31. mv clientpack/index.min.htm clientpack/index.htm
  32. rm ./clientpack/*.js
  33. rm ./clientpack/*.css
  34. go-bindata -nomemcopy -nometadata -prefix clientpack clientpack
  35. $(BINNAME).exe: bindata.go *.go
  36. GOARCH=386 GOOS=windows go build $(GOFLAGS) -o $(BINNAME).exe
  37. $(BINNAME): bindata.go *.go
  38. GOARCH=amd64 GOOS=linux go build $(GOFLAGS) -o $(BINNAME)
  39. $(BINNAME)-$(VERSION)-win32.7z: $(BINNAME).exe nmdc-webfrontend.conf.SAMPLE
  40. 7z a -mx9 "$(BINNAME)-$(VERSION)-win32.7z" $(BINNAME).exe nmdc-webfrontend.conf.SAMPLE
  41. $(BINNAME)-$(VERSION)-linux64.tar.xz: $(BINNAME) nmdc-webfrontend.conf.SAMPLE
  42. XZ_OPT='-9' tar caf "$(BINNAME)-$(VERSION)-linux64.tar.xz" $(BINNAME) nmdc-webfrontend.conf.SAMPLE --owner=0 --group=0
  43. $(BINNAME)-$(VERSION)-src.tar.xz: $(SOURCES)
  44. XZ_OPT='-9' tar caf "$(BINNAME)-$(VERSION)-src.tar.xz" $(SOURCES) --owner=0 --group=0