Makefile 863 B

123456789101112131415161718192021222324252627282930
  1. CPP = /usr/bin/cpp -P -undef -Wundef -std=c99 -nostdinc -Wtrigraphs -fdollars-in-identifiers -C -Wno-invalid-pp-token
  2. SRC = $(shell find web/assets -maxdepth 1 -type f)
  3. DST = $(patsubst %.scss,%.css,$(patsubst %.ts,%.js,$(subst web/assets,.build/assets,$(SRC))))
  4. ALL: web/bindata.go
  5. .build/bin/go-bindata:
  6. GOPATH=$(shell pwd)/.build go get github.com/a-urth/go-bindata/...
  7. .build/assets:
  8. mkdir -p $@
  9. .build/assets/%.css: web/assets/%.scss
  10. sass --no-source-map --style=compressed $< $@
  11. .build/assets/%.js: web/assets/%.ts
  12. $(eval TMP := $(shell mktemp))
  13. tsc --out $(TMP) $<
  14. closure-compiler --js $(TMP) --js_output_file $@
  15. rm -f $(TMP)
  16. .build/assets/%: web/assets/%
  17. cp $< $@
  18. web/bindata.go: .build/bin/go-bindata .build/assets $(DST)
  19. $< -o $@ -pkg web -prefix .build/assets -nomemcopy .build/assets/...
  20. clean:
  21. rm -rf .build/assets web/bindata.go