aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 068f872f4466fcf2cf7cacddb0a6dc17c0e22241 (plain)
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
31
SLUG ?= $(shell git rev-parse --short HEAD)
LDFLAGS := "-X 'git.gabrielgio.me/cerrado/templates.Slug=.$(SLUG)' -s -w"

build: sass-slug tmpl
	go build \
		-ldflags=$(LDFLAGS) \
		-o bin/cerrado

run: sass tmpl
	go run .

test:
	go test -v --tags=unit ./...

# this is meant for "prod" build
sass-slug:
	mkdir -p static
	sassc \
		--style compressed \
		-I scss scss/main.scss static/main.$(SLUG).css

sass:
	mkdir -p static
	sassc \
		-I scss scss/main.scss static/main.css

tmpl:
	cd ./templates && \
	qtc *

.PHONY: sass