-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
30 lines (24 loc) · 926 Bytes
/
Makefile
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
dist=build
theme=bootstrap
pkg=github.com/kapmahc/h2o/web
VERSION=`git rev-parse --short HEAD`
BUILD_TIME=`date -R`
AUTHOR_NAME=`git config --get user.name`
AUTHOR_EMAIL=`git config --get user.email`
COPYRIGHT=`head -n 1 LICENSE`
USAGE=`sed -n '3p' README.md`
build: backend frontend
-cp -r dashboard/build $(dist)/dashboard
tar jcvf dist.tar.bz2 $(dist)
backend:
go build -ldflags "-s -w -X ${pkg}.Version=${VERSION} -X '${pkg}.BuildTime=${BUILD_TIME}' -X '${pkg}.AuthorName=${AUTHOR_NAME}' -X ${pkg}.AuthorEmail=${AUTHOR_EMAIL} -X '${pkg}.Copyright=${COPYRIGHT}' -X '${pkg}.Usage=${USAGE}'" -o ${dist}/fly main.go
-cp -rv locales db templates $(dist)/
mkdir -pv $(dist)/themes/$(theme)
-cp -rv themes/$(theme)/assets themes/$(theme)/views $(dist)/themes/$(theme)/
frontend:
cd dashboard && npm run build
clean:
-rm -rv $(dist) dashboard/build dist.tar.bz2
init:
govendor sync
cd dashboard && npm run install