forked from kellegous/go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
30 lines (21 loc) · 877 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
CPP = /usr/bin/cpp -P -undef -Wundef -std=c99 -nostdinc -Wtrigraphs -fdollars-in-identifiers -C -Wno-invalid-pp-token
SRC = $(shell find web/assets -maxdepth 1 -type f)
DST = $(patsubst %.scss,%.css,$(patsubst %.ts,%.js,$(subst web/assets,.build/assets,$(SRC))))
ALL: web/bindata.go
.build/bin/go-bindata:
GOPATH=$(shell pwd)/.build go get github.com/jteeuwen/go-bindata/...
.build/assets:
mkdir -p $@
.build/assets/%.css: web/assets/%.scss
sass --no-cache --sourcemap=none --style=compressed $< $@
.build/assets/%.js: web/assets/%.ts
$(eval TMP := $(shell mktemp))
tsc --out $(TMP) $<
closure-compiler --js $(TMP) --js_output_file $@
rm -f $(TMP)
.build/assets/%: web/assets/%
cp $< $@
web/bindata.go: .build/bin/go-bindata .build/assets $(DST)
$< -o $@ -pkg web -prefix .build/assets -nomemcopy .build/assets/...
clean:
rm -rf .build/assets web/bindata.go