summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2018-03-29 20:08:41 +0200
committerJan Dittberner <jandd@cacert.org>2018-03-29 20:08:41 +0200
commit4dd5e0982050ae92a9a37cb62e606b2807a85c27 (patch)
treed2b9900068afe3d747524b43fbae49b86feaa7c8 /Makefile
parentaea93c328e76fba300f5dd2c380b46c62a6db904 (diff)
downloadcacert-boardvoting-4dd5e0982050ae92a9a37cb62e606b2807a85c27.tar.gz
cacert-boardvoting-4dd5e0982050ae92a9a37cb62e606b2807a85c27.tar.xz
cacert-boardvoting-4dd5e0982050ae92a9a37cb62e606b2807a85c27.zip
Embed database migrations
- switch from goose to github.com/rubenv/sql-migrate - move assets (static, templates, migrations) to boardvoting package - add generated boardvoting/assets.go - remove unused static files from static directory - add package db with db migration configuration
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 5a97685..e310918 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,22 @@
VERSION := $(shell git describe --always --dirty=-dev)
BUILD := $(shell date --iso-8601=seconds --utc)
-GOFILES := $(wildcard *.go)
+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)
-cacert-boardvoting: ${GOFILES}
+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
-.PHONY: clean
+distclean: clean
+ rm -f boardvoting/assets.go
+
+.PHONY: clean distclean all