-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (35 loc) · 1.12 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
VERSION ?= $(shell git describe --tags --always --dirty)
RELEASE_VERSION ?= $(shell git describe --abbrev=0)
LDFLAGS ?= -X github.com/connctd/showandtell.Version=$(VERSION) -w -s
GO_ENV = GO111MODULE=on
REVEAL_JS_VERSION = 3.8.0
REVEAL_JS_URL = https://github.com/hakimel/reveal.js/archive/$(REVEAL_JS_VERSION).zip
GO_BUILD = $(GO_ENV) go build -ldflags "$(LDFLAGS)"
GO_TEST = $(GO_ENV) go test -v
.PHONY: clean dist-clean test dist build
build: dist/sat
install: build
@echo Installing showandtell
@cp dist/sat $(GOPATH)/bin
dist/sat: dist_temp/reveal
@echo "Building showandtell"
@mkdir -p ./dist
packr2
$(GO_BUILD) -o ./dist/sat ./cmd/sat
packr2 clean
dist_temp/reveal:
@echo Downloading reveal JS
@mkdir -p ./dist_temp
@wget -o /dev/null -O ./dist_temp/reveal.tar.gz $(REVEAL_JS_URL)
@cd ./dist_temp/ && tar xzf reveal.tar.gz
@mv ./dist_temp/reveal.js-$(REVEAL_JS_VERSION) ./dist_temp/reveal
dist: dist/sat
test:
@echo Running tests
$(GO_TEST) ./...
clean:
@packr2 clean
@rm -rf ./dist
@rm -rf ./test_out
dist-clean: clean
@rm -rf ./dist_temp