summaryrefslogtreecommitdiff
path: root/Makefile
blob: e3109180ca42f0fcfc1f6ab3fbcb929b67c92b89 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
VERSION := $(shell git describe --always --dirty=-dev)
BUILD := $(shell date --iso-8601=seconds --utc)
GOFILES = $(shell find . -type f -name '*.go')
STATICFILES = $(shell find boardvoting/static/ -type f)
TEMPLATES = $(shell find boardvoting/templates/ -type f)
DBMIGRATIONS = $(shell find boardvoting/migrations/ -type f)

all: cacert-boardvoting

boardvoting/assets.go: $(DBMIGRATIONS) $(STATICFILES) $(TEMPLATES) $(DBMIGRATIONS) boardvoting/main.go
	go generate -v ./boardvoting

cacert-boardvoting: ${GOFILES} boardvoting/assets.go
	go build -o $@ -x -ldflags " -X 'main.version=${VERSION}' -X 'main.build=${BUILD}'"

clean:
	rm -f cacert-boardvoting

distclean: clean
	rm -f boardvoting/assets.go

.PHONY: clean distclean all