1SLUG ?= $(shell git rev-parse --short HEAD)
2LDFLAGS := "-X 'git.gabrielgio.me/cerrado/templates.Slug=.$(SLUG)' -s -w"
3
4build: sass-slug tmpl
5 go build \
6 -ldflags=$(LDFLAGS) \
7 -o bin/cerrado
8
9run: sass tmpl
10 go run .
11
12test:
13 go test -v --tags=unit ./...
14
15# this is meant for "prod" build
16sass-slug:
17 mkdir -p static
18 sassc \
19 --style compressed \
20 -I scss scss/main.scss static/main.$(SLUG).css
21
22sass:
23 mkdir -p static
24 sassc \
25 -I scss scss/main.scss static/main.css
26
27tmpl:
28 cd ./templates && \
29 qtc *
30
31.PHONY: sass