aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 8f6d462fa6a51fdf81da416dae3f1807c54019c5 (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
COMMIT := $(shell git rev-parse --short HEAD)
LDFLAGS := "-X 'git.gabrielgio.me/cerrado/templates.Slug=.$(COMMIT)' -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.$(COMMIT).css

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

tmpl:
	cd ./templates && \
	qtc *

.PHONY: sass