aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 27 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 8cc8884..15a9875 100644
--- a/Makefile
+++ b/Makefile
@@ -2,13 +2,8 @@
## Use of this source code is governed by a BSD-style
## license that can be found in the LICENSE file.
-.PHONY: all build lint test install generate deploy
-
-LINT_OPTS =
-
-GENERATE_INPUTS = _content/index.html \
- _content/index.js \
- _content/kbbiclient.js
+.PHONY: all build lint test install release deploy
+.PHONY: dev-server
all: build lint test
@@ -31,10 +26,32 @@ test:
install:
go install ./cmd/kbbi/
-cmd/www-kbbi/static.go: $(GENERATE_INPUTS)
- go generate
+##
+## Release tasks
+##
+
+release:
+ mkdir -p _content/bin/
+ rm _content/bin/kbbi-*
+ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./cmd/kbbi && \
+ gzip kbbi && \
+ mv kbbi.gz _content/bin/kbbi-linux-amd64.gz
+ CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build ./cmd/kbbi && \
+ gzip kbbi && \
+ mv kbbi.gz _content/bin/kbbi-darwin-amd64.gz
+ CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build ./cmd/kbbi && \
+ zip -m kbbi.zip kbbi.exe && \
+ mv kbbi.zip _content/bin/kbbi-windows-amd64.zip
-deploy: cmd/www-kbbi/static.go
+deploy:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -o www-kbbi-linux-amd64 ./cmd/www-kbbi/
rsync --progress ./www-kbbi-linux-amd64 www-kbbi:~/bin/www-kbbi
+ rsync --progress --recursive ./_www-kbbi/ www-kbbi:~/bin/_www-kbbi/
+
+##
+## Development task
+##
+
+dev-server:
+ DEBUG=1 go run ./cmd/www-kbbi