Use static assets for HTML templates
[cacert-boardvoting.git] / Makefile
1 VERSION := $(shell git describe --always --dirty=-dev)
2 BUILD := $(shell date --iso-8601=seconds --utc)
3 GOFILES = $(shell find . -type f -name '*.go')
4 STATICFILES = $(shell find boardvoting/static/ -type f)
5 TEMPLATES = $(shell find boardvoting/templates/ -type f)
6 DBMIGRATIONS = $(shell find boardvoting/migrations/ -type f)
7
8 all: cacert-boardvoting
9
10 boardvoting/assets.go: $(DBMIGRATIONS) $(STATICFILES) $(TEMPLATES) $(DBMIGRATIONS) boardvoting/main.go
11 go generate -v ./boardvoting
12
13 cacert-boardvoting: ${GOFILES} boardvoting/assets.go
14 go build -o $@ -x -ldflags " -X 'main.version=${VERSION}' -X 'main.build=${BUILD}'"
15
16 clean:
17 rm -f cacert-boardvoting
18
19 distclean: clean
20 rm -f boardvoting/assets.go
21
22 .PHONY: clean distclean all